--- /dev/null
+/result/** -text
+/test/** -text
--- /dev/null
+*.exe
+*.o
+*.lo
+*.log
+*.pyc
+*.patch
+.deps
+.libs
+.memdump
+COPYING
+CVE-*
+INSTALL
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+bissect*
+compile
+config.guess
+config.h
+config.h.in
+config.h.in~
+config.log
+config.status
+config.sub
+configure
+dba100000.xml
+depcomp
+doc/Makefile
+doc/Makefile.in
+doc/devhelp/Makefile
+doc/devhelp/Makefile.in
+doc/examples/.deps
+doc/examples/Makefile
+doc/examples/Makefile.in
+doc/examples/io1
+doc/examples/io2
+doc/examples/parse1
+doc/examples/parse2
+doc/examples/parse3
+doc/examples/parse4
+doc/examples/reader1
+doc/examples/reader2
+doc/examples/reader3
+doc/examples/reader4
+doc/examples/testWriter
+doc/examples/tree1
+doc/examples/tree2
+doc/examples/xpath1
+doc/examples/xpath2
+example/.deps
+example/Makefile
+example/Makefile.in
+example/gjobread
+include/Makefile
+include/Makefile.in
+include/libxml/Makefile
+include/libxml/Makefile.in
+include/libxml/xmlversion.h
+install-sh
+libtool
+libxml-2.0-uninstalled.pc
+libxml-2.0.pc
+libxml2-config.cmake
+libxml2.la
+libxml2.spec
+list
+ltmain.sh
+log
+missing
+missing.lst
+m4
+python/.deps
+python/.libs
+python/Makefile
+python/Makefile.in
+python/gen_prog
+python/libxml2-export.c
+python/libxml2-py.c
+python/libxml2-py.h
+python/libxml2.py
+python/libxml2class.py
+python/libxml2class.txt
+python/libxml2mod.la
+python/setup.py
+python/tests/Makefile
+python/tests/Makefile.in
+python/tests/tmp.xml
+runsuite
+runtest
+runxmlconf
+runxmlconf.log
+stamp-h1
+tags
+test.out
+testAutomata
+testC14N
+testHTML
+testModule
+testReader
+testRegexp
+testRelax
+testSAX
+testSchemas
+testThreads
+testURI
+testXPath
+testapi
+testapi.c.new
+testchar
+testdict
+testdso.la
+testlimits
+testrecurse
+tmp
+tst.c
+tst
+xml2-config
+xml2Conf.sh
+xmlcatalog
+xmlconf
+xmllint
+xstc/*-test.py
+xstc/Makefile
+xstc/Makefile.in
+xstc/Tests
+xstc/xsts-*.tar.gz
--- /dev/null
+.test:
+ # The image was generated with the following Dockerfile. It is also used
+ # for libxslt, that's why we need git and libgcrypt-dev.
+ #
+ # FROM ubuntu:20.04
+ # ENV DEBIAN_FRONTEND=noninteractive
+ # RUN apt-get update && \
+ # apt-get upgrade -y && \
+ # apt-get install -y --no-install-recommends \
+ # curl git ca-certificates \
+ # autoconf automake libtool pkg-config \
+ # make gcc clang llvm \
+ # zlib1g-dev liblzma-dev libgcrypt-dev \
+ # python-dev python3-dev \
+ # cmake
+ # WORKDIR /tests
+ # RUN curl https://www.w3.org/XML/Test/xmlts20080827.tar.gz |tar xz
+ image: registry.gitlab.gnome.org/gnome/libxml2
+ script:
+ - |
+ ln -s /tests/xmlconf
+ sh autogen.sh $CONFIG
+ make -j$(nproc) V=1 CFLAGS="$CFLAGS -Werror"
+ make check
+
+gcc:
+ extends: .test
+ variables:
+ CFLAGS: "-O2 -std=c89 -D_XOPEN_SOURCE=700"
+
+gcc:python3:
+ extends: .test
+ only:
+ - schedules
+ variables:
+ CONFIG: "--with-python=/usr/bin/python3"
+ CFLAGS: "-O2"
+
+clang:asan:
+ extends: .test
+ variables:
+ CONFIG: "--without-python"
+ CC: clang
+ CFLAGS: "-O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,unsigned-integer-overflow -fno-sanitize-recover=all -Wno-error=cast-align"
+ # LeakSanitizer requires SYS_CAP_PTRACE
+ ASAN_OPTIONS: "detect_leaks=0"
+ UBSAN_OPTIONS: "print_stacktrace=1"
+
+clang:msan:
+ extends: .test
+ only:
+ - schedules
+ variables:
+ CONFIG: "--without-python --without-zlib --without-lzma"
+ CC: clang
+ CFLAGS: "-O2 -g -fno-omit-frame-pointer -fsanitize=memory -Wno-error=cast-align"
+
+.cmake:linux:
+ image: registry.gitlab.gnome.org/gnome/libxml2
+ script:
+ - cmake -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBXML2_XMLCONF_WORKING_DIR=/tests -S . -B libxml2-build
+ - cmake --build libxml2-build --target install
+ - mkdir -p libxml2-install/share/libxml2
+ - cp Copyright libxml2-install/share/libxml2
+ - cd libxml2-build
+ - ctest -VV
+ after_script:
+ - cd libxml2-install
+ - tar -czf ../libxml2-$CI_COMMIT_SHORT_SHA-$CC-$SUFFIX.tar.gz *
+ artifacts:
+ paths:
+ - libxml2-$CI_COMMIT_SHORT_SHA-$CC-$SUFFIX.tar.gz
+ expire_in: 1 day
+
+cmake:linux:gcc:shared:
+ extends: .cmake:linux
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ CC: gcc
+ SUFFIX: shared
+
+cmake:linux:gcc:static:
+ extends: .cmake:linux
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ CC: gcc
+ SUFFIX: static
+
+cmake:linux:clang:shared:
+ extends: .cmake:linux
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ CC: clang
+ SUFFIX: shared
+
+cmake:linux:clang:static:
+ extends: .cmake:linux
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ CC: clang
+ SUFFIX: static
+
+.cmake:mingw:
+ tags:
+ - win32-ps
+ before_script:
+ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
+ - $Env:Path="C:\msys64\$Env:MINGW_PATH\bin;C:\msys64\usr\bin;$Env:Path"
+ - pacman --noconfirm -Syu
+ - pacman --noconfirm -S
+ $Env:MINGW_PACKAGE_PREFIX-cmake
+ $Env:MINGW_PACKAGE_PREFIX-libiconv
+ $Env:MINGW_PACKAGE_PREFIX-ninja
+ $Env:MINGW_PACKAGE_PREFIX-python
+ $Env:MINGW_PACKAGE_PREFIX-python2
+ $Env:MINGW_PACKAGE_PREFIX-xz
+ $Env:MINGW_PACKAGE_PREFIX-zlib
+ - if (-not (Test-Path 7za.exe)) {
+ Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
+ cmake -E tar xf 7z1900-extra.7z 7za.exe
+ }
+ - if (-not (Test-Path libxml2-build/xmlconf)) {
+ Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
+ .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+ }
+ script:
+ - cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
+ - cmake --build libxml2-build --target install
+ - New-Item -ItemType Directory libxml2-install\share\libxml2
+ - Copy-Item Copyright libxml2-install\share\libxml2
+ - cd libxml2-build
+ - ctest -VV
+ after_script:
+ - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env:SUFFIX.7z .\libxml2-install\*
+ cache:
+ key: "$MINGW_PACKAGE_PREFIX"
+ paths:
+ - libxml2-build/xmlconf/
+ - 7za.exe
+ artifacts:
+ paths:
+ - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env:SUFFIX.7z
+ expire_in: 1 day
+
+cmake:mingw:w64-i686:shared:
+ extends: .cmake:mingw
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ MINGW_PACKAGE_PREFIX: mingw-w64-i686
+ MINGW_PATH: mingw32
+ SUFFIX: shared
+
+cmake:mingw:w64-i686:static:
+ extends: .cmake:mingw
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ MINGW_PACKAGE_PREFIX: mingw-w64-i686
+ MINGW_PATH: mingw32
+ SUFFIX: static
+
+cmake:mingw:w64-x86_64:shared:
+ extends: .cmake:mingw
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ MINGW_PACKAGE_PREFIX: mingw-w64-x86_64
+ MINGW_PATH: mingw64
+ SUFFIX: shared
+
+cmake:mingw:w64-x86_64:static:
+ extends: .cmake:mingw
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ MINGW_PACKAGE_PREFIX: mingw-w64-x86_64
+ MINGW_PATH: mingw64
+ SUFFIX: static
+
+.cmake:msvc:
+ tags:
+ - win32-ps
+ variables:
+ CMAKE_VERSION: 3.19.4
+ before_script:
+ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
+ - if (-not (Test-Path cmake-$Env:CMAKE_VERSION-win64-x64)) {
+ Invoke-WebRequest -Uri http://github.com/Kitware/CMake/releases/download/v$Env:CMAKE_VERSION/cmake-$Env:CMAKE_VERSION-win64-x64.zip -OutFile cmake-$Env:CMAKE_VERSION-win64-x64.zip ;
+ Expand-Archive cmake-$Env:CMAKE_VERSION-win64-x64.zip -DestinationPath .
+ }
+ - $Env:Path="$Env:CI_PROJECT_DIR\cmake-$Env:CMAKE_VERSION-win64-x64\bin;$Env:Path"
+ - if (-not (Test-Path 7za.exe)) {
+ Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
+ cmake -E tar xf 7z1900-extra.7z 7za.exe
+ }
+ - if (-not (Test-Path libxml2-build/xmlconf)) {
+ Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
+ .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+ }
+ script:
+ - cmake -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -S . -B libxml2-build
+ - cmake --build libxml2-build --config Debug --target install
+ - cmake --build libxml2-build --config Release --target install
+ - New-Item -ItemType Directory libxml2-install\share\libxml2
+ - Copy-Item Copyright libxml2-install\share\libxml2
+ - cd libxml2-build
+ - ctest -C Debug -VV
+ - ctest -C Release -VV
+ after_script:
+ - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z .\libxml2-install\*
+ cache:
+ key: "msvc"
+ paths:
+ - cmake-$Env:CMAKE_VERSION-win64-x64/
+ - libxml2-build/xmlconf/
+ - 7za.exe
+ artifacts:
+ paths:
+ - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z
+ expire_in: 1 day
+
+.cmake:msvc:v141:
+ extends: .cmake:msvc
+ variables:
+ CMAKE_GENERATOR: Visual Studio 15 2017
+ CMAKE_GENERATOR_TOOLSET: v141
+
+.cmake:msvc:v141:x64:
+ extends: .cmake:msvc:v141
+ variables:
+ CMAKE_GENERATOR_PLATFORM: x64
+
+cmake:msvc:v141:x64:shared:
+ extends: .cmake:msvc:v141:x64
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ SUFFIX: shared
+
+cmake:msvc:v141:x64:static:
+ extends: .cmake:msvc:v141:x64
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ SUFFIX: static
+
+.cmake:msvc:v141:x86:
+ extends: .cmake:msvc:v141
+ only:
+ - schedules
+ variables:
+ CMAKE_GENERATOR_PLATFORM: Win32
+
+cmake:msvc:v141:x86:shared:
+ extends: .cmake:msvc:v141:x86
+ only:
+ - schedules
+ variables:
+ BUILD_SHARED_LIBS: "ON"
+ SUFFIX: shared
+
+cmake:msvc:v141:x86:static:
+ extends: .cmake:msvc:v141:x86
+ variables:
+ BUILD_SHARED_LIBS: "OFF"
+ SUFFIX: static
--- /dev/null
+language: c
+sudo: false
+addons:
+ apt:
+ packages:
+ # Some tests require the DTDs.
+ w3c-sgml-lib
+matrix:
+ include:
+ # Try to emulate a C89 compiler on a POSIX system by disabling as many
+ # GNU extensions as possible.
+ - compiler: gcc
+ env: CFLAGS="-O2 -std=c89 -D_XOPEN_SOURCE=700 -Werror -Wno-error=array-bounds"
+ # clang with AddressSanitizer and UndefinedBehaviorSanitizer.
+ - compiler: clang
+ sudo: required
+ dist: trusty
+ env: CONFIG="--without-python"
+ CFLAGS="-O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,unsigned-integer-overflow -fno-sanitize-recover=all -Werror -Wno-error=cast-align"
+ UBSAN_OPTIONS=print_stacktrace=1
+script: sh autogen.sh $CONFIG && make -j2 V=1 && make check
+git:
+ depth: 10
--- /dev/null
+cmake_minimum_required(VERSION 3.15)
+
+project(libxml2 VERSION 2.9.10 LANGUAGES C)
+
+include(CheckCSourceCompiles)
+include(CheckFunctionExists)
+include(CheckIncludeFiles)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckSymbolExists)
+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
+
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+set(LIBXML2_WITH_AUTOMATA ON)
+option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON)
+option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON)
+option(LIBXML2_WITH_DEBUG "Add the debugging module" ON)
+option(LIBXML2_WITH_DOCB "Add Docbook SGML support" ON)
+set(LIBXML2_WITH_EXPR ON)
+option(LIBXML2_WITH_FTP "Add the FTP support" ON)
+option(LIBXML2_WITH_HTML "Add the HTML support" ON)
+option(LIBXML2_WITH_HTTP "Add the HTTP support" ON)
+option(LIBXML2_WITH_ICONV "Add ICONV support" ON)
+option(LIBXML2_WITH_ICU "Add ICU support" OFF)
+option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" ON)
+option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" ON)
+option(LIBXML2_WITH_LZMA "Use liblzma" ON)
+option(LIBXML2_WITH_MEM_DEBUG "Add the memory debugging module" OFF)
+option(LIBXML2_WITH_MODULES "Add the dynamic modules support" ON)
+option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON)
+option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" ON)
+option(LIBXML2_WITH_PROGRAMS "Build programs" ON)
+option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON)
+option(LIBXML2_WITH_PYTHON "Build Python bindings" ON)
+option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON)
+option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON)
+option(LIBXML2_WITH_RUN_DEBUG "Add the runtime debugging module" OFF)
+option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON)
+option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON)
+option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON)
+option(LIBXML2_WITH_TESTS "Build tests" ON)
+option(LIBXML2_WITH_THREADS "Add multithread support" ON)
+option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF)
+option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON)
+set(LIBXML2_WITH_TRIO OFF)
+set(LIBXML2_WITH_UNICODE ON)
+option(LIBXML2_WITH_VALID "Add the DTD validation support" ON)
+option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON)
+option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON)
+option(LIBXML2_WITH_XPATH "Add the XPATH support" ON)
+option(LIBXML2_WITH_XPTR "Add the XPointer support" ON)
+option(LIBXML2_WITH_ZLIB "Use libz" ON)
+set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite")
+
+if(LIBXML2_WITH_ICONV)
+ find_package(Iconv REQUIRED)
+endif()
+
+if(LIBXML2_WITH_ICU)
+ find_package(ICU REQUIRED COMPONENTS data i18n uc)
+endif()
+
+if(LIBXML2_WITH_LZMA)
+ find_package(LibLZMA REQUIRED)
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+ check_include_files(unistd.h HAVE_UNISTD_H)
+ check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
+ if(HAVE_UNISTD_H AND HAVE_F_GETFL)
+ find_package(Python COMPONENTS Interpreter Development REQUIRED)
+ else()
+ find_package(Python2 COMPONENTS Interpreter Development REQUIRED)
+ add_library(Python::Python ALIAS Python2::Python)
+ set(Python_EXECUTABLE ${Python2_EXECUTABLE})
+ set(Python_SITEARCH ${Python2_SITEARCH})
+ endif()
+ set(LIBXML2_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+ find_package(Threads REQUIRED)
+endif()
+
+if(LIBXML2_WITH_ZLIB)
+ find_package(ZLIB REQUIRED)
+endif()
+
+foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_DOCB WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MEM_DEBUG WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_RUN_DEBUG WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_TRIO WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_ZLIB)
+ if(LIBXML2_${VARIABLE})
+ set(${VARIABLE} 1)
+ else()
+ set(${VARIABLE} 0)
+ endif()
+endforeach()
+
+set(LIBXML_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
+set(LIBXML_MINOR_VERSION ${PROJECT_VERSION_MINOR})
+set(LIBXML_MICRO_VERSION ${PROJECT_VERSION_PATCH})
+
+set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}")
+set(LIBXML_VERSION ${LIBXML_MAJOR_VERSION}0${LIBXML_MINOR_VERSION}0${LIBXML_MICRO_VERSION})
+set(LIBXML_VERSION_STRING "${LIBXML_VERSION}")
+set(LIBXML_VERSION_EXTRA "")
+set(LIBXML_VERSION_NUMBER ${LIBXML_VERSION})
+
+set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
+
+set(PACKAGE "libxml2")
+set(PACKAGE_BUGREPORT "xml@gnome.org")
+set(PACKAGE_NAME "libxml2")
+set(PACKAGE_STRING "libxml2 ${VERSION}")
+set(PACKAGE_TARNAME "libxml2")
+set(PACKAGE_URL "http://www.xmlsoft.org/")
+set(PACKAGE_VERSION ${VERSION})
+
+if(LIBLZMA_FOUND)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES LibLZMA::LibLZMA)
+endif()
+
+if(Threads_FOUND)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
+endif()
+
+if(ZLIB_FOUND)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)
+endif()
+
+if(MSVC)
+ configure_file(include/win32config.h config.h COPYONLY)
+else()
+ check_c_source_compiles("
+ void __attribute__((destructor))
+ f(void) {}
+ int main(void) { return 0; }
+ " ATTRIBUTE_DESTRUCTOR)
+ check_c_source_compiles("
+ #include <netdb.h>
+ int main() { (void) gethostbyname((const char*) \"\"); return 0; }
+ " GETHOSTBYNAME_ARG_CAST_CONST)
+ if(NOT GETHOSTBYNAME_ARG_CAST_CONST)
+ set(GETHOSTBYNAME_ARG_CAST "(char *)")
+ else()
+ set(GETHOSTBYNAME_ARG_CAST "/**/")
+ endif()
+ check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
+ check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
+ check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h;sys/types.h" HAVE_SS_FAMILY)
+ check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h;sys/types.h" HAVE_BROKEN_SS_FAMILY)
+ if(HAVE_BROKEN_SS_FAMILY)
+ set(ss_family __ss_family)
+ endif()
+ check_function_exists(class HAVE_CLASS)
+ check_include_files(ctype.h HAVE_CTYPE_H)
+ check_include_files(dirent.h HAVE_DIRENT_H)
+ check_include_files(dlfcn.h HAVE_DLFCN_H)
+ check_library_exists(dl dlopen "" HAVE_DLOPEN)
+ check_include_files(dl.h HAVE_DL_H)
+ check_include_files(errno.h HAVE_ERRNO_H)
+ check_include_files(fcntl.h HAVE_FCNTL_H)
+ check_function_exists(finite HAVE_FINITE)
+ check_include_files(float.h HAVE_FLOAT_H)
+ check_function_exists(fpclass HAVE_FPCLASS)
+ check_function_exists(fprintf HAVE_FPRINTF)
+ check_function_exists(fp_class HAVE_FP_CLASS)
+ check_function_exists(ftime HAVE_FTIME)
+ check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+ check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+ check_include_files(inttypes.h HAVE_INTTYPES_H)
+ check_function_exists(isascii HAVE_ISASCII)
+ check_function_exists(isinf HAVE_ISINF)
+ check_function_exists(isnan HAVE_ISNAN)
+ check_function_exists(isnand HAVE_ISNAND)
+ check_library_exists(history append_history "" HAVE_LIBHISTORY)
+ check_library_exists(lzma lzma_code "" HAVE_LIBLZMA)
+ check_library_exists(pthread pthread_join "" HAVE_LIBPTHREAD)
+ check_library_exists(readline readline "" HAVE_LIBREADLINE)
+ check_library_exists(z gzread "" HAVE_LIBZ)
+ check_include_files(limits.h HAVE_LIMITS_H)
+ check_function_exists(localtime HAVE_LOCALTIME)
+ check_include_files(lzma.h HAVE_LZMA_H)
+ check_include_files(malloc.h HAVE_MALLOC_H)
+ check_include_files(math.h HAVE_MATH_H)
+ check_include_files(memory.h HAVE_MEMORY_H)
+ check_function_exists(mmap HAVE_MMAP)
+ check_function_exists(munmap HAVE_MUNMAP)
+ check_symbol_exists(DIR ndir.h HAVE_NDIR_H)
+ check_include_files(netdb.h HAVE_NETDB_H)
+ check_include_files(netinet/in.h HAVE_NETINET_IN_H)
+ check_include_files(poll.h HAVE_POLL_H)
+ check_function_exists(printf HAVE_PRINTF)
+ check_include_files(pthread.h HAVE_PTHREAD_H)
+ check_function_exists(putenv HAVE_PUTENV)
+ check_function_exists(rand HAVE_RAND)
+ check_function_exists(rand_r HAVE_RAND_R)
+ check_include_files(resolv.h HAVE_RESOLV_H)
+ check_library_exists(dld shl_load "" HAVE_SHLLOAD)
+ check_function_exists(signal HAVE_SIGNAL)
+ check_include_files(signal.h HAVE_SIGNAL_H)
+ check_function_exists(snprintf HAVE_SNPRINTF)
+ check_function_exists(sprintf HAVE_SPRINTF)
+ check_function_exists(srand HAVE_SRAND)
+ check_function_exists(sscanf HAVE_SSCANF)
+ check_function_exists(stat HAVE_STAT)
+ check_include_files(stdarg.h HAVE_STDARG_H)
+ check_include_files(stdint.h HAVE_STDINT_H)
+ check_include_files(stdlib.h HAVE_STDLIB_H)
+ check_function_exists(strftime HAVE_STRFTIME)
+ check_include_files(strings.h HAVE_STRINGS_H)
+ check_include_files(string.h HAVE_STRING_H)
+ check_symbol_exists(DIR sys/dir.h HAVE_SYS_DIR_H)
+ check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
+ check_symbol_exists(DIR sys/ndir.h HAVE_SYS_NDIR_H)
+ check_include_files(sys/select.h HAVE_SYS_SELECT_H)
+ check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
+ check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+ check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
+ check_include_files(sys/time.h HAVE_SYS_TIME_H)
+ check_include_files(sys/types.h HAVE_SYS_TYPES_H)
+ check_function_exists(time HAVE_TIME)
+ check_include_files(time.h HAVE_TIME_H)
+ check_include_files(unistd.h HAVE_UNISTD_H)
+ check_function_exists(va_copy HAVE_VA_COPY)
+ check_function_exists(vfprintf HAVE_VFPRINTF)
+ check_function_exists(vsnprintf HAVE_VSNPRINTF)
+ check_function_exists(vsprintf HAVE_VSPRINTF)
+ check_function_exists(__va_copy HAVE___VA_COPY)
+ check_c_source_compiles("
+ #include <stdlib.h>
+ #include <iconv.h>
+ extern
+ #ifdef __cplusplus
+ \"C\"
+ #endif
+ #if defined(__STDC__) || defined(__cplusplus)
+ size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft);
+ #else
+ size_t iconv();
+ #endif
+ int main() { return 0; }
+ " ICONV_CONST_TEST)
+ if(NOT ICONV_CONST_TEST)
+ set(ICONV_CONST "const")
+ endif()
+ set(LT_OBJDIR ".libs/")
+ check_c_source_compiles("
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ int main() { (void) send(1, (const char*) \"\", 1, 1); return 0; }
+ " SEND_ARG2_CAST_CONST)
+ if(NOT SEND_ARG2_CAST_CONST)
+ set(SEND_ARG2_CAST "(char *)")
+ else()
+ set(SEND_ARG2_CAST "/**/")
+ endif()
+ check_include_files("float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS)
+ check_c_source_compiles("
+ #include <stdarg.h>
+ void a(va_list* ap) {};
+ int main() { va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1; return 0; }
+ " VA_LIST_IS_ARRAY_TEST)
+ if(VA_LIST_IS_ARRAY_TEST)
+ set(VA_LIST_IS_ARRAY FALSE)
+ else()
+ set(VA_LIST_IS_ARRAY TRUE)
+ endif()
+ check_c_source_compiles("
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
+ " XML_SOCKLEN_T_SOCKLEN_T)
+ if(XML_SOCKLEN_T_SOCKLEN_T)
+ set(XML_SOCKLEN_T socklen_t)
+ else()
+ check_c_source_compiles("
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
+ " XML_SOCKLEN_T_SIZE_T)
+ if(XML_SOCKLEN_T_SIZE_T)
+ set(XML_SOCKLEN_T size_t)
+ else()
+ check_c_source_compiles("
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
+ " XML_SOCKLEN_T_INT)
+ set(XML_SOCKLEN_T int)
+ endif()
+ endif()
+ configure_file(config.h.cmake.in config.h)
+endif()
+
+set(
+ LIBXML2_HDRS
+ include/libxml/c14n.h
+ include/libxml/catalog.h
+ include/libxml/chvalid.h
+ include/libxml/debugXML.h
+ include/libxml/dict.h
+ include/libxml/DOCBparser.h
+ include/libxml/encoding.h
+ include/libxml/entities.h
+ include/libxml/globals.h
+ include/libxml/hash.h
+ include/libxml/HTMLparser.h
+ include/libxml/HTMLtree.h
+ include/libxml/list.h
+ include/libxml/nanoftp.h
+ include/libxml/nanohttp.h
+ include/libxml/parser.h
+ include/libxml/parserInternals.h
+ include/libxml/pattern.h
+ include/libxml/relaxng.h
+ include/libxml/SAX.h
+ include/libxml/SAX2.h
+ include/libxml/schemasInternals.h
+ include/libxml/schematron.h
+ include/libxml/threads.h
+ include/libxml/tree.h
+ include/libxml/uri.h
+ include/libxml/valid.h
+ include/libxml/xinclude.h
+ include/libxml/xlink.h
+ include/libxml/xmlIO.h
+ include/libxml/xmlautomata.h
+ include/libxml/xmlerror.h
+ include/libxml/xmlexports.h
+ include/libxml/xmlmemory.h
+ include/libxml/xmlmodule.h
+ include/libxml/xmlreader.h
+ include/libxml/xmlregexp.h
+ include/libxml/xmlsave.h
+ include/libxml/xmlschemas.h
+ include/libxml/xmlschemastypes.h
+ include/libxml/xmlstring.h
+ include/libxml/xmlunicode.h
+ include/libxml/xmlwriter.h
+ include/libxml/xpath.h
+ include/libxml/xpathInternals.h
+ include/libxml/xpointer.h
+)
+
+set(
+ LIBXML2_SRCS
+ buf.c
+ c14n.c
+ catalog.c
+ chvalid.c
+ debugXML.c
+ dict.c
+ encoding.c
+ entities.c
+ error.c
+ globals.c
+ hash.c
+ HTMLparser.c
+ HTMLtree.c
+ legacy.c
+ list.c
+ nanoftp.c
+ nanohttp.c
+ parser.c
+ parserInternals.c
+ pattern.c
+ relaxng.c
+ SAX.c
+ SAX2.c
+ schematron.c
+ threads.c
+ tree.c
+ uri.c
+ valid.c
+ xinclude.c
+ xlink.c
+ xmlIO.c
+ xmlmemory.c
+ xmlmodule.c
+ xmlreader.c
+ xmlregexp.c
+ xmlsave.c
+ xmlschemas.c
+ xmlschemastypes.c
+ xmlstring.c
+ xmlunicode.c
+ xmlwriter.c
+ xpath.c
+ xpointer.c
+ xzlib.c
+)
+
+if(WIN32)
+ list(APPEND LIBXML2_SRCS win32/libxml2.rc)
+ file(
+ WRITE
+ ${CMAKE_CURRENT_BINARY_DIR}/rcVersion.h
+ "#define LIBXML_MAJOR_VERSION ${LIBXML_MAJOR_VERSION}\n"
+ "#define LIBXML_MINOR_VERSION ${LIBXML_MINOR_VERSION}\n"
+ "#define LIBXML_MICRO_VERSION ${LIBXML_MICRO_VERSION}\n"
+ "#define LIBXML_DOTTED_VERSION \"${VERSION}\"\n"
+ )
+endif()
+
+if(LIBXML2_WITH_SAX1)
+ list(APPEND LIBXML2_SRCS DOCBparser.c)
+endif()
+
+if(LIBXML2_WITH_TRIO)
+ list(APPEND LIBXML2_SRCS trio.c triostr.c)
+endif()
+
+add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS})
+
+if(NOT BUILD_SHARED_LIBS)
+ target_compile_definitions(LibXml2 INTERFACE LIBXML_STATIC)
+ set(XML_CFLAGS "-DLIBXML_STATIC")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+ target_compile_definitions(LibXml2 PRIVATE _REENTRANT)
+ if(WIN32)
+ target_compile_definitions(LibXml2 PRIVATE HAVE_WIN32_THREADS)
+ endif()
+endif()
+
+target_include_directories(
+ LibXml2
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/libxml2>
+)
+
+if(HAVE_DLOPEN)
+ target_link_libraries(LibXml2 PRIVATE dl)
+ set(MODULE_PLATFORM_LIBS "-ldl")
+endif()
+
+if(HAVE_SHLLOAD)
+ target_link_libraries(LibXml2 PRIVATE dld)
+ set(MODULE_PLATFORM_LIBS "-ldld")
+endif()
+
+if(UNIX)
+ target_link_libraries(LibXml2 PRIVATE m)
+ set(M_LIBS "-lm")
+endif()
+
+if(WIN32)
+ target_link_libraries(LibXml2 PRIVATE ws2_32)
+ set(WIN32_EXTRA_LIBADD "-lws2_32")
+endif()
+
+if(LIBXML2_WITH_ICONV)
+ target_link_libraries(LibXml2 PUBLIC Iconv::Iconv)
+ if(NOT Iconv_IS_BUILT_IN)
+ set(ICONV_LIBS "-liconv")
+ endif()
+endif()
+
+if(LIBXML2_WITH_ICU)
+ target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
+ if(WIN32)
+ set(ICU_LIBS "-licudt -licuin -licuuc")
+ else()
+ set(ICU_LIBS "-licudata -licui18n -licuuc")
+ endif()
+endif()
+
+if(LIBXML2_WITH_LZMA)
+ target_link_libraries(LibXml2 PRIVATE LibLZMA::LibLZMA)
+ set(LZMA_LIBS "-llzma")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+ target_link_libraries(LibXml2 PRIVATE Threads::Threads)
+ set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
+endif()
+
+if(LIBXML2_WITH_ZLIB)
+ target_link_libraries(LibXml2 PRIVATE ZLIB::ZLIB)
+ set(Z_LIBS "-lz")
+endif()
+
+set_target_properties(
+ LibXml2
+ PROPERTIES
+ IMPORT_PREFIX lib
+ OUTPUT_NAME xml2
+ POSITION_INDEPENDENT_CODE ON
+ PREFIX lib
+ VERSION ${PROJECT_VERSION}
+)
+
+if(MSVC)
+ if(BUILD_SHARED_LIBS)
+ set_target_properties(
+ LibXml2
+ PROPERTIES
+ DEBUG_POSTFIX d
+ )
+ else()
+ set_target_properties(
+ LibXml2
+ PROPERTIES
+ DEBUG_POSTFIX sd
+ MINSIZEREL_POSTFIX s
+ RELEASE_POSTFIX s
+ RELWITHDEBINFO_POSTFIX s
+ )
+ endif()
+endif()
+
+install(FILES ${LIBXML2_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+
+install(
+ TARGETS LibXml2
+ EXPORT LibXml2
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
+)
+
+if(MSVC AND BUILD_SHARED_LIBS)
+ install(FILES $<TARGET_PDB_FILE:LibXml2> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
+endif()
+
+if(LIBXML2_WITH_PROGRAMS)
+ set(
+ PROGRAMS
+ xmlcatalog
+ xmllint
+ )
+ foreach(PROGRAM ${PROGRAMS})
+ add_executable(${PROGRAM} ${PROGRAM}.c)
+ target_link_libraries(${PROGRAM} LibXml2)
+ if(HAVE_LIBHISTORY)
+ target_link_libraries(${PROGRAM} history)
+ endif()
+ if(HAVE_LIBREADLINE)
+ target_link_libraries(${PROGRAM} readline)
+ endif()
+ install(TARGETS ${PROGRAM} EXPORT LibXml2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
+ endforeach()
+endif()
+
+if(LIBXML2_WITH_TESTS)
+ enable_testing()
+ set(
+ TESTS
+ runxmlconf
+ runsuite
+ testapi
+ testAutomata
+ testC14N
+ testchar
+ testdict
+ testHTML
+ testModule
+ testlimits
+ testReader
+ testrecurse
+ testRegexp
+ testRelax
+ testSAX
+ testSchemas
+ testURI
+ testXPath
+ )
+ foreach(TEST ${TESTS})
+ add_executable(${TEST} ${TEST}.c)
+ target_link_libraries(${TEST} LibXml2)
+ endforeach()
+ if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml)
+ add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR})
+ endif()
+ if(NOT WIN32)
+ add_test(NAME testapi COMMAND testapi)
+ endif()
+ add_test(NAME testchar COMMAND testchar)
+ add_test(NAME testdict COMMAND testdict)
+ add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ if(Threads_FOUND)
+ set(
+ TESTS_THREADS
+ runtest
+ testThreads
+ )
+ foreach(TEST ${TESTS_THREADS})
+ add_executable(${TEST} ${TEST}.c)
+ if(WIN32)
+ target_compile_definitions(${TEST} PRIVATE HAVE_WIN32_THREADS)
+ endif()
+ target_link_libraries(${TEST} LibXml2 Threads::Threads)
+ endforeach()
+ add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ endif()
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+ execute_process(
+ COMMAND
+ ${Python_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml
+ WORKING_DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ file(READ python/libxml.py LIBXML_PY)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML_PY}")
+ file(READ ${CMAKE_CURRENT_BINARY_DIR}/libxml2class.py LIBXML2CLASS_PY)
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML2CLASS_PY}")
+ configure_file(${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in libxml2.py COPYONLY)
+ add_library(
+ LibXml2Mod
+ libxml2-py.c
+ libxml2-py.h
+ python/libxml.c
+ python/libxml_wrap.h
+ python/types.c
+ )
+ target_include_directories(
+ LibXml2Mod
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/python>
+ )
+ target_link_libraries(LibXml2Mod LibXml2 Python::Python)
+ set_target_properties(
+ LibXml2Mod
+ PROPERTIES
+ IMPORT_PREFIX lib
+ OUTPUT_NAME xml2mod
+ PREFIX lib
+ VERSION ${PROJECT_VERSION}
+ )
+ install(
+ TARGETS LibXml2Mod
+ ARCHIVE DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT development
+ LIBRARY DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime NAMELINK_COMPONENT development
+ RUNTIME DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime
+ )
+ if(MSVC AND BUILD_SHARED_LIBS)
+ install(FILES $<TARGET_PDB_FILE:LibXml2Mod> DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
+ endif()
+ install(FILES python/drv_libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
+endif()
+
+install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
+install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE)
+
+configure_package_config_file(
+ libxml2-config.cmake.cmake.in libxml2-config.cmake
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+)
+
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+ COMPONENT development
+)
+
+write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY ExactVersion
+)
+
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+ COMPONENT development
+)
+
+install(
+ EXPORT LibXml2
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+ NAMESPACE LibXml2::
+ FILE libxml2-export.cmake
+ COMPONENT development
+)
+
+configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+
+if(MSVC)
+ configure_file(include/libxml/xmlwin32version.h.in libxml/xmlwin32version.h)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlwin32version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+ set(prefix "${CMAKE_INSTALL_PREFIX}")
+ configure_file(python/setup.py.in setup.py @ONLY)
+endif()
+
+set(XML_INCLUDEDIR "-I\${includedir}/libxml2")
+set(XML_LIBDIR "-L\${libdir}")
+set(XML_LIBS "-lxml2")
+set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_LIBS} ${ICONV_LIBS} ${ICU_LIBS} ${M_LIBS}")
+
+file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
+string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
+
+set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
+set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
+
+set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
+configure_file(xml2-config.in xml2-config @ONLY)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
+
+set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
+set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
+configure_file(xml2Conf.sh.in xml2Conf.sh @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml2Conf.sh DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development)
+
+set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
+set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime)
+set(CPACK_DEB_COMPONENT_INSTALL ON)
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${PACKAGE_TARNAME}-dev")
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
+set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL})
+set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils")
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-utils")
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
+set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING})
+set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL})
+set(CPACK_PACKAGE_CONTACT ${PACKAGE_BUGREPORT})
+set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING})
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}")
+set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
+set(CPACK_PACKAGE_VERSION_MAJOR ${LIBXML_MAJOR_VERSION})
+set(CPACK_PACKAGE_VERSION_MINOR ${LIBXML_MINOR_VERSION})
+set(CPACK_PACKAGE_VERSION_PATCH ${LIBXML_MICRO_VERSION})
+set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/Copyright)
+set(CPACK_RPM_COMPONENT_INSTALL ON)
+set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_NAME}-devel")
+set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_NAME}")
+set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
+set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL})
+set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils")
+set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}")
+set(CPACK_RPM_runtime_PACKAGE_NAME "${PACKAGE_NAME}")
+set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils")
+
+include(CPack)
* test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd
test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0
result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided
- regession tests for this
+ regression tests for this
Tue Aug 26 09:25:39 CEST 2008 Daniel Veillard <daniel@veillard.com>
* include/libxml/xmlerror.h parser.c: clean up namespace errors
checking and reporting, errors when a document is labelled
as UTF-16 while it is parsed as UTF-8 and no encoding was given
- explicitely.
+ explicitly.
* result/errors/webdav.xml.*: some warnings are no recategorized
as Namespace errors
Thu Apr 3 11:02:02 CEST 2008 Daniel Veillard <daniel@veillard.com>
- * HTMLparser.c: apparently it's okay to forget the semicolumn after
+ * HTMLparser.c: apparently it's okay to forget the semicolon after
entity refs in HTML, fixing char refs parsing accordingly based on
T. Manske patch, this should fix #517653
Wed Mar 12 10:22:01 CET 2008 Daniel Veillard <daniel@veillard.com>
- * python/types.c: fix a memory errro when using namespace nodes
+ * python/types.c: fix a memory error when using namespace nodes
returned from XPath queries, should fix #521699
* python/tests/Makefile.am python/tests/xpathns.py: add a specific
regression test for it
Thu Jan 24 15:37:04 CET 2008 Daniel Veillard <daniel@veillard.com>
- * parser.c: fix a memeory leak in internal subset parsing with
+ * parser.c: fix a memory leak in internal subset parsing with
a fix from Ashwin
* test/errors/content1.xml result/errors/content1.xml*:
add test to regressions
* list.c: applied patch to fix xmlListAppend() from
Georges-André SILBER
- * valid.c: also fix the place wher it was called.
+ * valid.c: also fix the place where it was called.
Wed May 2 18:47:33 CEST 2007 Daniel Veillard <daniel@veillard.com>
test/relaxng/empty1_0.xml test/relaxng/comps.rng
test/relaxng/empty0.rng test/relaxng/empty0_0.xml
test/relaxng/empty1_1.xml: tests which were apparently
- never commited to CVS
+ never committed to CVS
Wed Jan 3 16:05:21 PST 2007 Aleksey Sanin <aleksey@aleksey.com>
* HTMLparser.c: fixing HTML minimized attribute values to be generated
internally if not present, fixes bug #332124
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
- result/HTML/wired.html.sax: this affects the SAX event strem for
+ result/HTML/wired.html.sax: this affects the SAX event stream for
a few test cases
Tue Oct 17 17:56:31 CEST 2006 Daniel Veillard <daniel@veillard.com>
Wed Oct 11 18:40:00 CEST 2006 Daniel Veillard <daniel@veillard.com>
- * valid.c: fixed a weird error where validity context whould not
+ * valid.c: fixed a weird error where validity context would not
show up if warnings were disabled pointed out by Bob Stayton
* xmlIO.c doc/generator.py: cleanup and fix to regenerate the docs
* doc//* testapi.c: rebuilt the docs
Wed Aug 16 01:15:12 CEST 2006 Rob Richards <rrichards@ctindustries.net>
* HTMLtree.c xmlsave.c: Add linefeeds to error messages allowing
- for consistant handling.
+ for consistent handling.
Tue Aug 15 15:02:18 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
initialized to zero here; this could lead to the activation
of the axis rewrite code in xmlXPathNodeCollectAndTest() when
@rewriteType is randomly set to the value 1. A test
- (hardcoding the intial value to 1) revealed that the
+ (hardcoding the initial value to 1) revealed that the
resulting incorrect behaviour is similar to the behaviour
as described by Arnold Hendriks on the mailing list; so I
hope that will fix the issue.
for my custom handling of ns-references in my DOM wrapper.
Substituted code which created the XML namespace decl on
the doc for a call to xmlTreeEnsureXMLDecl(). Removed
- those nastly "warnigns" from the docs of the clone/adopt
+ those nasty "warnings" from the docs of the clone/adopt
functions; they work fine on my side.
Mon Jun 12 13:23:11 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
Mon May 29 18:06:17 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xpath.c include/libxml/xpath.h: Added an XPath object cache.
- It sits on an xmlXPathContext and need to be explicitely
+ It sits on an xmlXPathContext and need to be explicitly
activated (or deactivated again) with
xmlXPathContextSetObjectCache(). The cache consists of 5
lists for node-set, string, number, boolean and misc XPath
* xpath.c: Removed a memcpy if xmlXPathNodeSetMerge(); it
seems we really need to walk the whole list, since those
- nastly namespace nodes need to be added with
+ nasty namespace nodes need to be added with
xmlXPathNodeSetDupNs(); thus a pure memcpy is not possible.
A flag on the node-set indicating if namespace nodes are in
the set would help here; this is the 3rd flag which would
2) Of what type are the nodes in the set (or of mixed type)?
This would allow for faster merging of node-sets.
3) Are namespace nodes in the set?
- This would allow to skipp all the namespace node specific
+ This would allow to skip all the namespace node specific
special handling. Faster node-set merging if the first
set is empty; just memcpy the set.
Thu Jan 5 16:25:06 CET 2006 Daniel Veillard <daniel@veillard.com>
- * NEWS configure.in libxml.spec.in testapi.c doc/*: upated the news
+ * NEWS configure.in libxml.spec.in testapi.c doc/*: updated the news
regenerated the docs, preparing for release of 2.6.23
* pattern.c xmlschemas.c: fixed some comments
Wed Jan 4 15:00:51 CET 2006 Daniel Veillard <daniel@veillard.com>
* SAX2.c: fix bug #324432 with <xml:foo/>
- * test/ns7 resul//ns7*: added to the regression tests
+ * test/ns7 result/ns7*: added to the regression tests
Wed Jan 4 10:53:56 CET 2006 Daniel Veillard <daniel@veillard.com>
Wed Oct 19 16:53:47 BST 2005 Daniel Veillard <daniel@veillard.com>
- * xmlregexp.c: commiting a some fixes and debug done yesterday in
+ * xmlregexp.c: committing a some fixes and debug done yesterday in
the London airport.
Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
Allowed IDCs to resolve also to nodes of complex type with
simple content.
Added check for keyrefs with references to keyrefs.
- IDC target-nodes were interferring with IDC node-tables,
+ IDC target-nodes were interfering with IDC node-tables,
since they used one list of entries only. I separated this
one big list into 3 lists: 1 for IDC node-table entries,
1 for _duplicates_ of IDC node-table entries and 1 for
* xmlschemas.c include/libxml/schemasInternals.h
include/libxml/xmlerror.h: Completion of the schema graph.
Centralisation, more robustness of the schema document
- aquisition story. Centralised and restructured component fixup.
+ acquisition story. Centralised and restructured component fixup.
Fixed attribute derivation when 'prohibiting' attribute uses.
Added warnings: when schema documents cannot be localized
during imports; when we get duplicate and pointless attribute
list values.
* test/relaxng/307377* result/relaxng/307377* Makefile.am runtest.c:
added examples to the regression tests, problem is that streaming
- version gives slightly more informations.
+ version gives slightly more information.
Wed Aug 10 15:25:53 CEST 2005 Daniel Veillard <daniel@veillard.com>
Tue Aug 9 23:37:22 CEST 2005 Daniel Veillard <daniel@veillard.com>
* xmlregexp.c: fixed a determinism detection problem exposed by
- ##other tests commited by Kasimier, also added a small speedup
+ ##other tests committed by Kasimier, also added a small speedup
of determinism detection.
* test/results/any6_2_0* any8_1_0* any7_1_2* any7_2_2*: added
the results to the regression tests now
* result/schemas/any7* test/schemas/any7: completed the tests
and added the results
* result/schemas/any3_0_0.err result/schemas/any5_0_0.err
- result/schemas/any5_1_0.err: this slightly chnages the output
+ result/schemas/any5_1_0.err: this slightly changes the output
from 3 existing tests
Mon Aug 8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
Sun Aug 7 12:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com>
- * test/relaxng/docbook_0.xml: get rid of the dependancy on a locally
+ * test/relaxng/docbook_0.xml: get rid of the dependency on a locally
installed DTD
* uri.c include/libxml/uri.h xmlIO.c nanoftp.c nanohttp.c: try to
cleanup the Path/URI conversion mess, needed fixing in various
Sat Jul 30 17:08:07 EDT 2005 Daniel Veillard <daniel@veillard.com>
- * schematron.c xmllint.c include/libxml/schematron.h: commiting
+ * schematron.c xmllint.c include/libxml/schematron.h: committing
work done on the plane last week-end
Sat Jul 30 15:16:29 CEST 2005 Daniel Veillard <daniel@veillard.com>
Sun Jun 26 20:08:24 CEST 2005 Daniel Veillard <daniel@veillard.com>
- * include/libxml/valid.h valid.c: avoid name glob in agruments as
+ * include/libxml/valid.h valid.c: avoid name glob in arguments as
it matches the glob() routine.
* runtest.c Makefile.am: first steps toward a C regression test
framework.
* doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h
format to cope with gcc4 change of aliasing allowed scopes, had
- to add extra informations to doc/libxml2-api.xml to separate
+ to add extra information to doc/libxml2-api.xml to separate
the header from the c module source.
* *.c: updated all c library files to add a #define bottom_xxx
and reimport elfgcchack.h thereafter, and a bit of cleanups.
Fri Jan 28 16:51:47 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
- * xmlschemas.c: Corrected an ambigious symbol-space for
+ * xmlschemas.c: Corrected an ambiguous symbol-space for
local attribute declarations. IFDEFed more IDC code to
- surpress compiler warnings.
+ suppress compiler warnings.
Fri Jan 28 00:57:04 CET 2005 Daniel Veillard <daniel@veillard.com>
Added an initial skeleton for indentity-constraints. This is all
defined out, since not complete, plus it needs support from other
modules.
- Added machanism to store element information for the
+ Added mechanism to store element information for the
ancestor-or-self axis; this is needed for identity-constraints
and should be helpful for a future streamable validation.
* include/libxml/xmlerror.h: Added an error code for
Sun Jan 23 18:35:00 CET 2005 Daniel Veillard <daniel@veillard.com>
- * parser.c: boosting common commnent parsing code, it was really
+ * parser.c: boosting common comment parsing code, it was really
slow.
* test/comment[3-5].xml result//comment[3-5].xml*: added sprecific
regression tests
Fri Jan 7 14:54:51 CET 2005 Daniel Veillard <daniel@veillard.com>
* TODO: small update
- * xmlregexp.c: trying to add an API to get useful error informations
+ * xmlregexp.c: trying to add an API to get useful error information
back from a failing regexp context.
Thu Jan 6 17:35:41 HKT 2005 William Brack <wbrack@mmm.com.hk>
Fri Dec 24 16:31:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
- * python/generator.py: added most required entires to
+ * python/generator.py: added most required entries to
foreign encoding table, plus some additional logic to
assure only the 1st param uses the 't#' format. Fixes
bug #152286, but may still have some other UTF-16 problems.
of elements for which a declaration existed were still processed
by the wildcard mechanism (reported by philippe ventrillon to the
mailing list).
- Changed the import and include machanism to share dictionaries.
+ Changed the import and include mechanism to share dictionaries.
Fri Nov 26 11:44:36 CET 2004 Daniel Veillard <daniel@veillard.com>
* SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c
xmlstring.c: various API hardeing changes as a result of running
the first set of automatic API regression tests.
- * test/slashdot16.xml: apparently missing from CVS, commited it
+ * test/slashdot16.xml: apparently missing from CVS, committed it
Mon Nov 1 15:54:18 CET 2004 Daniel Veillard <daniel@veillard.com>
model group "all".
* test/schemas/bug152470_1.xsd: Removed an "abstract" attribute,
which broke the test.
- * xstc/xstc.py: Workaround to accomodate case insensitive
+ * xstc/xstc.py: Workaround to accommodate case insensitive
test definitions in ms-test.def.xml (was missing in a previous
commit).
* xmlschemas.c include/libxml/schemasInternals.h
test/schemas/bug152470_1.* result/schemas/bug152470_1_1*:
- Simpified attribute wildcard creation and assignment to get rid
+ Simplified attribute wildcard creation and assignment to get rid
of memory leaks.
Restructured the validation process.
Restructured and expanded parsing of <attributeGroup>.
'anyType' using the short-hand form (see bug # 152470,
submitted by Thilo Jeremias).
* include/libxml/xmlschematypes.h: Cleaned up some comments.
- * xstc/xstc.py: Workaround to accomodate case insensitive
+ * xstc/xstc.py: Workaround to accommodate case insensitive
test definitions in ms-test.def.xml.
* result/schemas/deter0_0_0.err result/schemas/ns0_0_2.err
result/schemas/ns0_1_2.err: Adapted.
to document xmlSchemasSetValidErrors() limitations, #141827
* error.c: Add information in generic and structured error
setter functions that this need to be done per thread #144308
- * xmlsave.c: fixed bug whith missing NOTATION(s) serialization
+ * xmlsave.c: fixed bug with missing NOTATION(s) serialization
bug #144162
* doc/xmllint.xml: typo fix #144840
Tue Jun 8 14:01:14 CEST 2004 Daniel Veillard <daniel@veillard.com>
* parser.c xmlreader.c include/libxml/parser.h: fixed a serious
- problem when substituing entities using the Reader, the entities
+ problem when substituting entities using the Reader, the entities
content might be freed and if rereferenced would crash
* Makefile.am test/* result/*: added a new test case and a new
test operation for the reader with substitution of entities.
Sat May 15 20:14:21 CEST 2004 Daniel Veillard <daniel@veillard.com>
* doc/ChangeLog.awk doc/ChangeLog.xsl: first steps of a good
- ChangeLog page generation. The awk shoudl escape characters
+ ChangeLog page generation. The awk should escape characters
not okay in XML and the xslt should make links to functions
or variables or bug reported in the entries.
Sun Apr 18 22:51:43 CEST 2004 Daniel Veillard <daniel@veillard.com>
- * xpath.c: relaxed id() to not check taht the name(s) passed
+ * xpath.c: relaxed id() to not check that the name(s) passed
are actually NCName, decided this in agreement with Aleksey Sanin
since existing specs like Visa3D broke that conformance checking
and other tools seems to not implement it sigh...
* xpath.c: work around Microsoft compiler NaN bug raise reported
by Mark Vakoc
* xmlschemas.c include/libxml/schemasInternals.h
- include/libxml/xmlerror.h: fixed a recusive extention schemas
+ include/libxml/xmlerror.h: fixed a recursive extension schemas
compilation error raised by taihei goi
Sun Apr 18 16:57:02 CEST 2004 Daniel Veillard <daniel@veillard.com>
* configure.in doc/* News: preparing 2.6.8 release, updated and rebuilt
the docs.
- * Makefile.am: use valgring fro the new Python based regression tests
+ * Makefile.am: use valgring for the new Python based regression tests
Mon Mar 22 20:07:27 CET 2004 Daniel Veillard <daniel@veillard.com>
Wed Mar 10 19:42:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
- * doc/search.php: Minor change for later verson of php requiring
+ * doc/search.php: Minor change for later version of php requiring
$HTTP_GET_VARS.
Wed Mar 10 00:12:31 HKT 2004 William Brack <wbrack@mmm.com.hk>
Thu Mar 4 14:39:38 CET 2004 Daniel Veillard <daniel@veillard.com>
- * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: commiting
- the new xmlsave module before the actuall big code change.
+ * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: committing
+ the new xmlsave module before the actual big code change.
Thu Mar 4 12:38:53 CET 2004 Daniel Veillard <daniel@veillard.com>
Tue Jan 6 00:10:33 CET 2004 Daniel Veillard <daniel@veillard.com>
- * rngparser.c: commiting the compact relax ng parser. It's not
+ * rngparser.c: committing the compact relax ng parser. It's not
completely finished, it's not integrated but I want to save the
current state
Tue Dec 23 15:14:37 HKT 2003 William Brack <wbrack@mmm.com.hk>
* valid.c: fixed bug concerning validation using external
- dtd of element with mutiple namespace declarations
+ dtd of element with multiple namespace declarations
(Bug 129821)
Tue Dec 23 11:41:42 HKT 2003 William Brack <wbrack@mmm.com.hk>
* doc/examples/*: added his test as the xmlWriter example
* doc/html/ doc/*.html: this resulted in some improvements
* include/libxml/hash.h: fixed an inclusion problem when
- <libxml/hash.h> wasn't preceeded by <xml/parser.h>
+ <libxml/hash.h> wasn't preceded by <xml/parser.h>
Wed Nov 19 17:19:35 CET 2003 Daniel Veillard <daniel@veillard.com>
Tue Nov 18 21:51:15 CET 2003 Daniel Veillard <daniel@veillard.com>
* include/libxml/*.h include/libxml/*.h.in: modified the file
- header to add more informations, painful...
+ header to add more information, painful...
* genChRanges.py genUnicode.py: updated to generate said changes
in headers
* doc/apibuild.py: extract headers, add them to libxml2-api.xml
added autogeneration of a web page for the examples
* doc/examples/example1.c doc/examples/.cvsignore
doc/examples/examples.xml doc/examples/index.py: updated the
- informations extracted, improved the format and indexing.
+ information extracted, improved the format and indexing.
Tue Nov 11 22:08:59 CET 2003 Daniel Veillard <daniel@veillard.com>
* error.c valid.c include/libxml/xmlerror.h: fixing bug #125653
sometimes the error handlers can get a parser context on DTD
errors, and sometime they don't. So be very careful when trying
- to grab those informations.
+ to grab those information.
Tue Oct 28 15:26:18 CET 2003 Daniel Veillard <daniel@veillard.com>
* python/tests/Makefile.am python/tests/reader7.py
python/tests/walker.py: adding regression testing for the
new xmlreader APIs, new APIs for reader creation, including
- makeing reader "walker" operating on preparsed document trees.
+ making reader "walker" operating on preparsed document trees.
Sun Oct 20 22:37:03 HKT 2003 William Brack <wbrack@mmm.com.hk>
Fri Oct 10 16:19:17 CEST 2003 Daniel Veillard <daniel@veillard.com>
* include/libxml/tree.h: make room in Doc, Element, Attributes
- for PSVI type informations.
+ for PSVI type information.
Fri Oct 10 16:08:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
scrolling to see where thing broke wasn't pleasant
* configure.in: some beta4 preparation, but not ready yet
* error.c globals.c include/libxml/globals.h include/libxml/xmlerror.h:
- new error handling code, last error informations are stored
+ new error handling code, last error information are stored
in the parsing context or a global variable, new APIs to
handle the xmlErrorPtr type.
* parser.c parserInternals.c valid.c : started migrating to the
* parser.c: small potential buffer access problem in push code
provided by Justin Fletcher
* result/*.sax result/VC/PENesting* result/namespaces/*
- result/valid/*.err: some error messages were sligthly changed.
+ result/valid/*.err: some error messages were slightly changed.
Thu Oct 2 13:01:13 2003 Aleksey Sanin <aleksey@aleksey.com>
* include/libxml/SAX.h include/libxml/parser.h: move the
SAXv1 block definitions to parser.h fixes bug #123380
* xmlreader.c include/libxml/xmlreader.h: reinstanciate
- the attribute and element pool borken 2 commits ago.
+ the attribute and element pool broken 2 commits ago.
Start playing with an entry point to preserve a subtree.
* entities.c: remove a warning.
include/libxml/globals.h include/libxml/SAX.h: make sure the
global variables for the default SAX handler are V1 ones to
avoid ABI compat problems.
- * xmlreader.c: cleanup of uneeded code
+ * xmlreader.c: cleanup of unneeded code
* hash.c: fix a comment
Thu Sep 25 14:16:51 CEST 2003 Daniel Veillard <daniel@veillard.com>
* dict.c: allow to give -1 for undefined length in lookups
* include/libxml/parser.h parser.c parserInternals.c testSAX.c:
first round of work on the new SAX2 interfaces, the API
- will change but commiting before changing for historical
+ will change but committing before changing for historical
reference.
Sat Sep 6 10:55:01 PTD 2003 William Brack <wbrack@mmm.com.hk>
Wed Aug 6 12:32:11 HKT 2003 William Brack <wbrack@mmm.com.hk>
* error.c trionan.[ch] testThreads.c python/generator.py:
- further small changes to elminate most of the remaining
+ further small changes to eliminate most of the remaining
warnings.
Tue Aug 5 23:51:21 HKT 2003 William Brack <wbrack@mmm.com.hk>
* valid.c: fixed another problem with namespaces on element
in mixed content case
* python/tests/reader2.py: updated the testcase with
- Bjorn Reese fix to reader for unsignificant white space
+ Bjorn Reese fix to reader for insignificant white space
* parser.c HTMLparser.c: cleanup.
Sun Aug 3 20:55:40 EDT 2003 Daniel Veillard <daniel@veillard.com>
Fri Aug 1 23:55:23 HKT 2003 William Brack <wbrack@mmm.com.hk>
Coninuing work on bug 118559
- * DOCBparser.c: removed 2 unsed vars
+ * DOCBparser.c: removed 2 unused vars
* xmlregexp.c: changed some numeric const to their enum symbols
* xmlreader.c: changed one var define from int to enum
(a little more to be done, awaiting co-ordination)
Tue Jul 8 16:02:19 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * globals.c threads.c: fixes some problem when freeing unititialized
+ * globals.c threads.c: fixes some problem when freeing uninitialized
mutexes
Tue Jul 8 14:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
Sat Jul 5 00:51:30 HKT 2003 William Brack <wbrack@mmm.com.hk>
Fixed problem with multi-threading, shown by the test program
- testThreads. After fix, ran mutiple tests on various speed
+ testThreads. After fix, ran multiple tests on various speed
machines (single and dual processor X86), which all seem okay.
* catalog.c: added missing xmlRMutexUnlock in xmlLoadCatalog
Mon Jun 2 21:56:15 MVT 2003 Daniel Veillard <daniel@veillard.com>
- * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: commiting
+ * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: committing
some work done while in the Maldives (hence the timezone on the
laptop !)
* result/schemas/length3* test/schemas/deter0_*
Wed Feb 19 01:17:48 CET 2003 Daniel Veillard <daniel@veillard.com>
- * relaxng.c: guess what ! Relax-NG bugfixing, what a surprize...
+ * relaxng.c: guess what ! Relax-NG bugfixing, what a surprise...
Tue Feb 18 22:09:50 CET 2003 Daniel Veillard <daniel@veillard.com>
* configure.in NEWS: preparing 2.5.0 release
* SAX.c: only warn in pedantic mode about namespace name
- brokeness
+ brokenness
* globals.c: fix a doc generation problem
* uri.c: fix #101520
- * doc/*: updated and rebuilt the doc for the release, includuding
+ * doc/*: updated and rebuilt the doc for the release, including
stylesheet update
* python/Makefile.am: fix a filename bug
Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml:
- extended the XmlTextReader API a bit, addding accessors for
+ extended the XmlTextReader API a bit, adding accessors for
the current doc and node, and an entity substitution mode for
the parser.
* python/libxml.py python/libxml2class.txt: related updates
Sat Nov 16 16:30:25 CET 2002 Daniel Veillard <daniel@veillard.com>
- * parser.c xpath.c: fixing #96925 wich was also dependent on the
+ * parser.c xpath.c: fixing #96925 which was also dependent on the
processing of parsed entities, and XPath computation on sustitued
entities.
* testXPath.c: make sure entities are substituted.
Tue Oct 15 12:41:01 CEST 2002 Daniel Veillard <daniel@veillard.com>
- * README: updated the contact informations
+ * README: updated the contact information
Tue Oct 15 10:35:57 CEST 2002 Daniel Veillard <daniel@veillard.com>
Thu Sep 5 12:57:38 CEST 2002 Daniel Veillard <daniel@veillard.com>
- * valid.c: try to provide file and line informations, not all
+ * valid.c: try to provide file and line information, not all
messages are covered, but it's a (good) start
Thu Sep 5 12:49:35 CEST 2002 Daniel Veillard <daniel@veillard.com>
Sun Aug 25 16:38:05 CEST 2002 Daniel Veillard <daniel@veillard.com>
- * xmlIO.c: handle Windows sepecific file://localhost/ semantic ...
+ * xmlIO.c: handle Windows specific file://localhost/ semantic ...
Thu Aug 22 22:03:19 CEST 2002 Daniel Veillard <daniel@veillard.com>
* tree.h: added xmlDocFormatDump which is just as xmlDocDump
but with the format parameter
- * tree.c: made xmlDocDump a wrapper arround xmlDocFormatDump
+ * tree.c: made xmlDocDump a wrapper around xmlDocFormatDump
Fri May 31 12:16:48 2002 Aleksey Sanin <aleksey@aleksey.com>
Tue May 14 13:00:48 CEST 2002 Daniel Veillard <daniel@veillard.com>
- * xpath.c: fixing an XPath function evalutation bug pointed out
+ * xpath.c: fixing an XPath function evaluation bug pointed out
by Alexey Efimov where the context was lost when evaluating
the function arguments
Mon 13 May 2002 11:37:39 PM PDT Aleksey Sanin <aleksey@aleksey.com>
- * xpath.c include/libxml/xpathInternals.h: maked xmlXPathNodeSetAddNs()
+ * xpath.c include/libxml/xpathInternals.h: made xmlXPathNodeSetAddNs()
function public for XMLSec performance optimizations
Mon May 13 12:32:22 CEST 2002 Daniel Veillard <daniel@veillard.com>
* include/libxml/xmlIO.h win32/dsp/libxml2.def.src
win32/libxml2.def.src xmlIO.c: exported default
'file:', 'http:' and 'ftp:' protocols input handlers
- and maked protocols comparisson case insensitive
+ and made protocols comparison case insensitive
Tue Apr 30 16:29:05 CEST 2002 Daniel Veillard <daniel@veillard.com>
Sun Mar 10 17:47:58 CET 2002 Daniel Veillard <daniel@veillard.com>
* valid.c: applied patch from Dodji Seketeli fixing an
- uninitailized variable in xmlValidGetValidElements()
+ uninitialized variable in xmlValidGetValidElements()
Sat Mar 9 15:10:49 CET 2002 Daniel Veillard <daniel@veillard.com>
Fri Mar 1 13:56:12 CET 2002 Daniel Veillard <daniel@veillard.com>
- * python/*: commiting some Python bindings work done while travelling
+ * python/*: committing some Python bindings work done while travelling
Fri Mar 1 10:11:15 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmllint.c: close #72663 and #72658, don't memdump unless compiled
- explicitely with memory debugging switched on
+ explicitly with memory debugging switched on
Sat Feb 23 11:08:09 CET 2002 Daniel Veillard <daniel@veillard.com>
Sat Feb 2 10:13:52 CET 2002 Daniel Veillard <daniel@veillard.com>
* configure.in libxml.spec.in python/Makefile.am python/TODO
- python/generator.py python/libxml2class.txt: added more informations
+ python/generator.py python/libxml2class.txt: added more information
in the libxml2-python package including docs. Slightly changed
the class hierarchy
* python/tests/*: added basic regression tests infrastructure too
Wed Jan 30 17:35:33 CET 2002 Daniel Veillard <daniel@veillard.com>
* python/generator.py python/libxml.c python/libxml.py
- python/libxml_wrap.h: commited early version of a python binding
+ python/libxml_wrap.h: committed early version of a python binding
for private use only ATM
Sat Jan 26 22:41:13 CET 2002 Daniel Veillard <daniel@veillard.com>
Wed Sep 19 10:01:37 CEST 2001 Daniel Veillard <daniel@veillard.com>
* Makefile.am libxml.spec.in: backing up non-documented changes
- commited without review or aproval by Jens Finke <jens@gnome.org>
+ committed without review or approval by Jens Finke <jens@gnome.org>
* HACKING: made 100% clear that no commit should be done directly
Mon Sep 17 18:52:37 CEST 2001 Daniel Veillard <daniel@veillard.com>
Thu Aug 23 23:16:32 CEST 2001 Daniel Veillard <daniel@veillard.com>
* catalog.c xmlIO.c: started some serious testing and fixed
- a few bug and optmization needs.
+ a few bug and optimization needs.
Thu Aug 23 17:26:58 CEST 2001 Daniel Veillard <daniel@veillard.com>
this slightly
* include/libxml/parser.h SAX.c parser.c parserInternals.c
xmllint.c: make element content line number generation
- optionnal to avoid breaking old apps added interface to switch
+ optional to avoid breaking old apps added interface to switch
Tue Jul 24 15:06:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Sat May 19 17:11:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * doc/xml.html: update with 2.3.9 informations
+ * doc/xml.html: update with 2.3.9 information
Sat May 19 16:50:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Sat Apr 28 16:33:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xpath.c: simple and efficient optimization, XPath functions
- aways bind to the same code, cache this
+ always bind to the same code, cache this
* TODO: updated (by saying some is obsolete)
Sat Apr 28 14:23:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed Apr 11 16:37:50 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* tree.h: include xmlmemory.h this seems to havoid a nasty glibc
- bug where the linktime verions of free() won't work ...
+ bug where the linktime versions of free() won't work ...
Wed Apr 11 14:21:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed Feb 14 11:35:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* hash.[ch]: added Paolo Casarini patch to provide Delete from
- hash functionnalities.
+ hash functionalities.
* doc/html/* : rebuild the doc
Tue Feb 13 18:01:48 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed Jan 24 20:27:28 COT 2001 Alejandro Forero <bachue@bachue.com>
- * xmlIO.c (xmlFileOpen, xmlFileOpenW): Removed unnecesary checks.
+ * xmlIO.c (xmlFileOpen, xmlFileOpenW): Removed unnecessary checks.
* xmlIO.c (xmlCheckFilename): Function added to know whether a given
filename points to a valid file (not a directory).
of the data format with node set, as well as operators.
* HTMLtree.c: added a newline at the end of the doctype output
whe this one is not present initially.
- * tree.c: make sure taht the parent and doc pointers are properly
+ * tree.c: make sure that the parent and doc pointers are properly
set when copying attributes (lists).
Sun Jan 21 10:47:38 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Sat Jan 6 19:13:27 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * Makefile.am: applied patch fro make check from Martin Vidner
+ * Makefile.am: applied patch for make check from Martin Vidner
Thu Jan 4 19:07:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
of xmllint too when using --memory flag, added a memory test
suite at the Makefile level.
* xpathInternals.h xpath.[ch] xpointer.c: fixed problems
- with namespace use when encountering QNames in XPath evalation,
+ with namespace use when encountering QNames in XPath evaluation,
added xmlns() scheme in XPointer.
* nanoftp.c : incorporated a fix
* parser.c xmlIO.c: fixed problems raised with encoding when using
* valid.c: handling of blank nodes in DTd validation (raised
by problems with a posteriori validation).
* nanohttp.c: changing behaviour on HTTP write stuff.
- * HTMLtree.c: forced body and html to be explicitely closed.
+ * HTMLtree.c: forced body and html to be explicitly closed.
* xpath.h: exported more XPath functions.
Sun Oct 15 22:28:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
Thu Oct 5 18:13:15 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
- * debugXML.c testXPath.c xpath.[ch]: got pissed by some nastyness
+ * debugXML.c testXPath.c xpath.[ch]: got pissed by some nastiness
in the XPath engine, rewrote large parts of it, now it's far
cleaner and in sync with the REC not an old WD. Fixed a parsing
problem in the interactive XML shell found when testing XPath.
* result/HTML/*.htm*: Updated the HTML examples regression tests output
* SAX.c tree.c: fixed bug on defaulting namespaces on attributes
* debugXML.c: fixed a bug on printing default namespaces.
- * HTMLtree.c: fixed a problem when outputing XML parsed docs as HTML
+ * HTMLtree.c: fixed a problem when outputting XML parsed docs as HTML
Mon Dec 20 16:20:55 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
Thu Dec 16 16:19:29 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.c: fixed a bug introduced in 1.8.0 and breaking default
- namespace recognition, and Dia as a resul :-(
+ namespace recognition, and Dia as a result :-(
* encoding.c: closed bug #3950
Wed Dec 15 19:22:23 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
buffers instead, this was really needed, validation was breaking
in strange ways due to that. Added xmlParseStringPEReference()
and other parsing from strings functions. Entities processing
- modified again, but PERef are still not handled correcly but
+ modified again, but PERef are still not handled correctly but
unless you're Eve Maller you won't notice :-)
* HTMLparser.c: large changes toward reliability, and switched to
lowercase internal tags, XHTML is lowercase, so it will help
a new release out
* HTMLparser.c: fixed auto-close bugs on list items, zeroing
some structures, comments before and after the
- main element, and other nastyness
- * HTMLtree.c tree.c: accomodate the extended HTML supported
+ main element, and other nastiness
+ * HTMLtree.c tree.c: accommodate the extended HTML supported
* configure.in: pushing 1.7.4
* test/ent8 and related outputs : added a new test for bug #2784
* test/HTML/wired.html and related output: a nasty HTML example
* valid.[ch], tree.c, parser.c : more work toward full parsing
of XML DTDs.
- * README: added informations about mailing-list and on-line
+ * README: added information about mailing-list and on-line
documentation
1999-01-27 Raja R Harinath <harinath@cs.umn.edu>
Wed Oct 28 17:56:35 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
- * tree.[ch]: more cleanup on the API, made the tree mor conformant.
+ * tree.[ch]: more cleanup on the API, made the tree more conformant.
Tue Oct 27 17:54:00 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
Tue Oct 13 21:46:57 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.h, tree.c, parser.c: added prev and doc pointers to Node,
- and changed NODEs contants for conformity with DOM Level 1
+ and changed NODEs constants for conformity with DOM Level 1
Wed Oct 7 23:42:46 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
1998-08-20 Raja R Harinath <harinath@cs.umn.edu>
- * error.h: New file. Contains prototyes from `error.c'.
+ * error.h: New file. Contains prototypes from `error.c'.
Thu Aug 13 19:02:34 1998 Tom Tromey <tromey@cygnus.com>
Sun Jul 26 00:17:51 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* configure.in: added test for CPP
- * AUTHORS, Changelog: the original ones didn't get commited but the
+ * AUTHORS, Changelog: the original ones didn't get committed but the
glib ones instead, fixed.
* Makefile.am: corrected an error in library naming
Fri Jul 24 16:47:14 1998 Daniel Veillard <Daniel.Veillard@w3.org>
- * integrated code developped at W3C
+ * integrated code developed at W3C
* changed the original Copyright
* migrated to automake
* prefixed the filenames by xml_ to avoid filename clashes
/**
* htmlErrMemory:
* @ctxt: an HTML parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
#define UPPER (toupper(*ctxt->input->cur))
-#define SKIP(val) ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val)
+#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
#define NXT(val) ctxt->input->cur[(val)]
if (*(ctxt->input->cur) == '\n') { \
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
- ctxt->token = 0; ctxt->input->cur += l; ctxt->nbChars++; \
+ ctxt->token = 0; ctxt->input->cur += l; \
} while (0)
/************
static int
htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
+ const unsigned char *cur;
+ unsigned char c;
+ unsigned int val;
+
if (ctxt->instate == XML_PARSER_EOF)
return(0);
*len = 0;
return(ctxt->token);
}
- if (ctxt->charset == XML_CHAR_ENCODING_UTF8) {
- /*
- * We are supposed to handle UTF8, check it's valid
- * From rfc2044: encoding of the Unicode values on UTF-8:
- *
- * UCS-4 range (hex.) UTF-8 octet sequence (binary)
- * 0000 0000-0000 007F 0xxxxxxx
- * 0000 0080-0000 07FF 110xxxxx 10xxxxxx
- * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx
- *
- * Check for the 0x110000 limit too
- */
- const unsigned char *cur = ctxt->input->cur;
- unsigned char c;
- unsigned int val;
-
- c = *cur;
- if (c & 0x80) {
- if (cur[1] == 0) {
- xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
- cur = ctxt->input->cur;
- }
- if ((cur[1] & 0xc0) != 0x80)
- goto encoding_error;
- if ((c & 0xe0) == 0xe0) {
+ if (ctxt->charset != XML_CHAR_ENCODING_UTF8) {
+ xmlChar * guess;
+ xmlCharEncodingHandlerPtr handler;
- if (cur[2] == 0) {
- xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
- cur = ctxt->input->cur;
- }
- if ((cur[2] & 0xc0) != 0x80)
- goto encoding_error;
- if ((c & 0xf0) == 0xf0) {
- if (cur[3] == 0) {
- xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
- cur = ctxt->input->cur;
- }
- if (((c & 0xf8) != 0xf0) ||
- ((cur[3] & 0xc0) != 0x80))
- goto encoding_error;
- /* 4-byte code */
- *len = 4;
- val = (cur[0] & 0x7) << 18;
- val |= (cur[1] & 0x3f) << 12;
- val |= (cur[2] & 0x3f) << 6;
- val |= cur[3] & 0x3f;
- } else {
- /* 3-byte code */
- *len = 3;
- val = (cur[0] & 0xf) << 12;
- val |= (cur[1] & 0x3f) << 6;
- val |= cur[2] & 0x3f;
- }
- } else {
- /* 2-byte code */
- *len = 2;
- val = (cur[0] & 0x1f) << 6;
- val |= cur[1] & 0x3f;
- }
- if (!IS_CHAR(val)) {
- htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
- "Char 0x%X out of allowed range\n", val);
- }
- return(val);
- } else {
+ /*
+ * Assume it's a fixed length encoding (1) with
+ * a compatible encoding for the ASCII set, since
+ * HTML constructs only use < 128 chars
+ */
+ if ((int) *ctxt->input->cur < 0x80) {
+ *len = 1;
if ((*ctxt->input->cur == 0) &&
(ctxt->input->cur < ctxt->input->end)) {
- htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
- "Char 0x%X out of allowed range\n", 0);
- *len = 1;
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Char 0x%X out of allowed range\n", 0);
return(' ');
}
- /* 1-byte code */
- *len = 1;
- return((int) *ctxt->input->cur);
- }
- }
- /*
- * Assume it's a fixed length encoding (1) with
- * a compatible encoding for the ASCII set, since
- * XML constructs only use < 128 chars
- */
- *len = 1;
- if ((int) *ctxt->input->cur < 0x80)
- return((int) *ctxt->input->cur);
-
- /*
- * Humm this is bad, do an automatic flow conversion
- */
- {
- xmlChar * guess;
- xmlCharEncodingHandlerPtr handler;
+ return((int) *ctxt->input->cur);
+ }
+ /*
+ * Humm this is bad, do an automatic flow conversion
+ */
guess = htmlFindEncoding(ctxt);
if (guess == NULL) {
xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
ctxt->input->encoding = guess;
handler = xmlFindCharEncodingHandler((const char *) guess);
if (handler != NULL) {
- xmlSwitchToEncoding(ctxt, handler);
+ /*
+ * Don't use UTF-8 encoder which isn't required and
+ * can produce invalid UTF-8.
+ */
+ if (!xmlStrEqual(BAD_CAST handler->name, BAD_CAST "UTF-8"))
+ xmlSwitchToEncoding(ctxt, handler);
} else {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"Unsupported encoding %s", guess, NULL);
ctxt->charset = XML_CHAR_ENCODING_UTF8;
}
- return(xmlCurrentChar(ctxt, len));
+ /*
+ * We are supposed to handle UTF8, check it's valid
+ * From rfc2044: encoding of the Unicode values on UTF-8:
+ *
+ * UCS-4 range (hex.) UTF-8 octet sequence (binary)
+ * 0000 0000-0000 007F 0xxxxxxx
+ * 0000 0080-0000 07FF 110xxxxx 10xxxxxx
+ * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx
+ *
+ * Check for the 0x110000 limit too
+ */
+ cur = ctxt->input->cur;
+ c = *cur;
+ if (c & 0x80) {
+ if ((c & 0x40) == 0)
+ goto encoding_error;
+ if (cur[1] == 0) {
+ xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+ cur = ctxt->input->cur;
+ }
+ if ((cur[1] & 0xc0) != 0x80)
+ goto encoding_error;
+ if ((c & 0xe0) == 0xe0) {
+
+ if (cur[2] == 0) {
+ xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+ cur = ctxt->input->cur;
+ }
+ if ((cur[2] & 0xc0) != 0x80)
+ goto encoding_error;
+ if ((c & 0xf0) == 0xf0) {
+ if (cur[3] == 0) {
+ xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+ cur = ctxt->input->cur;
+ }
+ if (((c & 0xf8) != 0xf0) ||
+ ((cur[3] & 0xc0) != 0x80))
+ goto encoding_error;
+ /* 4-byte code */
+ *len = 4;
+ val = (cur[0] & 0x7) << 18;
+ val |= (cur[1] & 0x3f) << 12;
+ val |= (cur[2] & 0x3f) << 6;
+ val |= cur[3] & 0x3f;
+ if (val < 0x10000)
+ goto encoding_error;
+ } else {
+ /* 3-byte code */
+ *len = 3;
+ val = (cur[0] & 0xf) << 12;
+ val |= (cur[1] & 0x3f) << 6;
+ val |= cur[2] & 0x3f;
+ if (val < 0x800)
+ goto encoding_error;
+ }
+ } else {
+ /* 2-byte code */
+ *len = 2;
+ val = (cur[0] & 0x1f) << 6;
+ val |= cur[1] & 0x3f;
+ if (val < 0x80)
+ goto encoding_error;
+ }
+ if (!IS_CHAR(val)) {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Char 0x%X out of allowed range\n", val);
+ }
+ return(val);
+ } else {
+ if ((*ctxt->input->cur == 0) &&
+ (ctxt->input->cur < ctxt->input->end)) {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Char 0x%X out of allowed range\n", 0);
+ *len = 1;
+ return(' ');
+ }
+ /* 1-byte code */
+ *len = 1;
+ return((int) *ctxt->input->cur);
+ }
encoding_error:
/*
BAD_CAST buffer, NULL);
}
- ctxt->charset = XML_CHAR_ENCODING_8859_1;
+ /*
+ * Don't switch encodings twice. Note that if there's an encoder, we
+ * shouldn't receive invalid UTF-8 anyway.
+ *
+ * Note that if ctxt->input->buf == NULL, switching encodings is
+ * impossible, see Gitlab issue #34.
+ */
+ if ((ctxt->input->buf != NULL) &&
+ (ctxt->input->buf->encoder == NULL))
+ xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
*len = 1;
return((int) *ctxt->input->cur);
}
ctxt->input->line++; ctxt->input->col = 1;
} else ctxt->input->col++;
ctxt->input->cur++;
- ctxt->nbChars++;
if (*ctxt->input->cur == 0)
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
}
}
};
+typedef struct {
+ const char *oldTag;
+ const char *newTag;
+} htmlStartCloseEntry;
+
/*
* start tags that imply the end of current element
*/
-static const char * const htmlStartClose[] = {
-"form", "form", "p", "hr", "h1", "h2", "h3", "h4", "h5", "h6",
- "dl", "ul", "ol", "menu", "dir", "address", "pre",
- "listing", "xmp", "head", NULL,
-"head", "p", NULL,
-"title", "p", NULL,
-"body", "head", "style", "link", "title", "p", NULL,
-"frameset", "head", "style", "link", "title", "p", NULL,
-"li", "p", "h1", "h2", "h3", "h4", "h5", "h6", "dl", "address",
- "pre", "listing", "xmp", "head", "li", NULL,
-"hr", "p", "head", NULL,
-"h1", "p", "head", NULL,
-"h2", "p", "head", NULL,
-"h3", "p", "head", NULL,
-"h4", "p", "head", NULL,
-"h5", "p", "head", NULL,
-"h6", "p", "head", NULL,
-"dir", "p", "head", NULL,
-"address", "p", "head", "ul", NULL,
-"pre", "p", "head", "ul", NULL,
-"listing", "p", "head", NULL,
-"xmp", "p", "head", NULL,
-"blockquote", "p", "head", NULL,
-"dl", "p", "dt", "menu", "dir", "address", "pre", "listing",
- "xmp", "head", NULL,
-"dt", "p", "menu", "dir", "address", "pre", "listing", "xmp",
- "head", "dd", NULL,
-"dd", "p", "menu", "dir", "address", "pre", "listing", "xmp",
- "head", "dt", NULL,
-"ul", "p", "head", "ol", "menu", "dir", "address", "pre",
- "listing", "xmp", NULL,
-"ol", "p", "head", "ul", NULL,
-"menu", "p", "head", "ul", NULL,
-"p", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL,
-"div", "p", "head", NULL,
-"noscript", "script", NULL,
-"center", "font", "b", "i", "p", "head", NULL,
-"a", "a", "head", NULL,
-"caption", "p", NULL,
-"colgroup", "caption", "colgroup", "col", "p", NULL,
-"col", "caption", "col", "p", NULL,
-"table", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre",
- "listing", "xmp", "a", NULL,
-"th", "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL,
-"td", "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL,
-"tr", "th", "td", "tr", "caption", "col", "colgroup", "p", NULL,
-"thead", "caption", "col", "colgroup", NULL,
-"tfoot", "th", "td", "tr", "caption", "col", "colgroup", "thead",
- "tbody", "p", NULL,
-"tbody", "th", "td", "tr", "caption", "col", "colgroup", "thead",
- "tfoot", "tbody", "p", NULL,
-"optgroup", "option", NULL,
-"option", "option", NULL,
-"fieldset", "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6",
- "pre", "listing", "xmp", "a", NULL,
-/* most tags in in FONTSTYLE, PHRASE and SPECIAL should close <head> */
-"tt", "head", NULL,
-"i", "head", NULL,
-"b", "head", NULL,
-"u", "head", NULL,
-"s", "head", NULL,
-"strike", "head", NULL,
-"big", "head", NULL,
-"small", "head", NULL,
-
-"em", "head", NULL,
-"strong", "head", NULL,
-"dfn", "head", NULL,
-"code", "head", NULL,
-"samp", "head", NULL,
-"kbd", "head", NULL,
-"var", "head", NULL,
-"cite", "head", NULL,
-"abbr", "head", NULL,
-"acronym", "head", NULL,
-
-/* "a" */
-"img", "head", NULL,
-/* "applet" */
-/* "embed" */
-/* "object" */
-"font", "head", NULL,
-/* "basefont" */
-"br", "head", NULL,
-/* "script" */
-"map", "head", NULL,
-"q", "head", NULL,
-"sub", "head", NULL,
-"sup", "head", NULL,
-"span", "head", NULL,
-"bdo", "head", NULL,
-"iframe", "head", NULL,
-NULL
+static const htmlStartCloseEntry htmlStartClose[] = {
+ { "a", "a" },
+ { "a", "fieldset" },
+ { "a", "table" },
+ { "a", "td" },
+ { "a", "th" },
+ { "address", "dd" },
+ { "address", "dl" },
+ { "address", "dt" },
+ { "address", "form" },
+ { "address", "li" },
+ { "address", "ul" },
+ { "b", "center" },
+ { "b", "p" },
+ { "b", "td" },
+ { "b", "th" },
+ { "big", "p" },
+ { "caption", "col" },
+ { "caption", "colgroup" },
+ { "caption", "tbody" },
+ { "caption", "tfoot" },
+ { "caption", "thead" },
+ { "caption", "tr" },
+ { "col", "col" },
+ { "col", "colgroup" },
+ { "col", "tbody" },
+ { "col", "tfoot" },
+ { "col", "thead" },
+ { "col", "tr" },
+ { "colgroup", "colgroup" },
+ { "colgroup", "tbody" },
+ { "colgroup", "tfoot" },
+ { "colgroup", "thead" },
+ { "colgroup", "tr" },
+ { "dd", "dt" },
+ { "dir", "dd" },
+ { "dir", "dl" },
+ { "dir", "dt" },
+ { "dir", "form" },
+ { "dir", "ul" },
+ { "dl", "form" },
+ { "dl", "li" },
+ { "dt", "dd" },
+ { "dt", "dl" },
+ { "font", "center" },
+ { "font", "td" },
+ { "font", "th" },
+ { "form", "form" },
+ { "h1", "fieldset" },
+ { "h1", "form" },
+ { "h1", "li" },
+ { "h1", "p" },
+ { "h1", "table" },
+ { "h2", "fieldset" },
+ { "h2", "form" },
+ { "h2", "li" },
+ { "h2", "p" },
+ { "h2", "table" },
+ { "h3", "fieldset" },
+ { "h3", "form" },
+ { "h3", "li" },
+ { "h3", "p" },
+ { "h3", "table" },
+ { "h4", "fieldset" },
+ { "h4", "form" },
+ { "h4", "li" },
+ { "h4", "p" },
+ { "h4", "table" },
+ { "h5", "fieldset" },
+ { "h5", "form" },
+ { "h5", "li" },
+ { "h5", "p" },
+ { "h5", "table" },
+ { "h6", "fieldset" },
+ { "h6", "form" },
+ { "h6", "li" },
+ { "h6", "p" },
+ { "h6", "table" },
+ { "head", "a" },
+ { "head", "abbr" },
+ { "head", "acronym" },
+ { "head", "address" },
+ { "head", "b" },
+ { "head", "bdo" },
+ { "head", "big" },
+ { "head", "blockquote" },
+ { "head", "body" },
+ { "head", "br" },
+ { "head", "center" },
+ { "head", "cite" },
+ { "head", "code" },
+ { "head", "dd" },
+ { "head", "dfn" },
+ { "head", "dir" },
+ { "head", "div" },
+ { "head", "dl" },
+ { "head", "dt" },
+ { "head", "em" },
+ { "head", "fieldset" },
+ { "head", "font" },
+ { "head", "form" },
+ { "head", "frameset" },
+ { "head", "h1" },
+ { "head", "h2" },
+ { "head", "h3" },
+ { "head", "h4" },
+ { "head", "h5" },
+ { "head", "h6" },
+ { "head", "hr" },
+ { "head", "i" },
+ { "head", "iframe" },
+ { "head", "img" },
+ { "head", "kbd" },
+ { "head", "li" },
+ { "head", "listing" },
+ { "head", "map" },
+ { "head", "menu" },
+ { "head", "ol" },
+ { "head", "p" },
+ { "head", "pre" },
+ { "head", "q" },
+ { "head", "s" },
+ { "head", "samp" },
+ { "head", "small" },
+ { "head", "span" },
+ { "head", "strike" },
+ { "head", "strong" },
+ { "head", "sub" },
+ { "head", "sup" },
+ { "head", "table" },
+ { "head", "tt" },
+ { "head", "u" },
+ { "head", "ul" },
+ { "head", "var" },
+ { "head", "xmp" },
+ { "hr", "form" },
+ { "i", "center" },
+ { "i", "p" },
+ { "i", "td" },
+ { "i", "th" },
+ { "legend", "fieldset" },
+ { "li", "li" },
+ { "link", "body" },
+ { "link", "frameset" },
+ { "listing", "dd" },
+ { "listing", "dl" },
+ { "listing", "dt" },
+ { "listing", "fieldset" },
+ { "listing", "form" },
+ { "listing", "li" },
+ { "listing", "table" },
+ { "listing", "ul" },
+ { "menu", "dd" },
+ { "menu", "dl" },
+ { "menu", "dt" },
+ { "menu", "form" },
+ { "menu", "ul" },
+ { "ol", "form" },
+ { "ol", "ul" },
+ { "option", "optgroup" },
+ { "option", "option" },
+ { "p", "address" },
+ { "p", "blockquote" },
+ { "p", "body" },
+ { "p", "caption" },
+ { "p", "center" },
+ { "p", "col" },
+ { "p", "colgroup" },
+ { "p", "dd" },
+ { "p", "dir" },
+ { "p", "div" },
+ { "p", "dl" },
+ { "p", "dt" },
+ { "p", "fieldset" },
+ { "p", "form" },
+ { "p", "frameset" },
+ { "p", "h1" },
+ { "p", "h2" },
+ { "p", "h3" },
+ { "p", "h4" },
+ { "p", "h5" },
+ { "p", "h6" },
+ { "p", "head" },
+ { "p", "hr" },
+ { "p", "li" },
+ { "p", "listing" },
+ { "p", "menu" },
+ { "p", "ol" },
+ { "p", "p" },
+ { "p", "pre" },
+ { "p", "table" },
+ { "p", "tbody" },
+ { "p", "td" },
+ { "p", "tfoot" },
+ { "p", "th" },
+ { "p", "title" },
+ { "p", "tr" },
+ { "p", "ul" },
+ { "p", "xmp" },
+ { "pre", "dd" },
+ { "pre", "dl" },
+ { "pre", "dt" },
+ { "pre", "fieldset" },
+ { "pre", "form" },
+ { "pre", "li" },
+ { "pre", "table" },
+ { "pre", "ul" },
+ { "s", "p" },
+ { "script", "noscript" },
+ { "small", "p" },
+ { "span", "td" },
+ { "span", "th" },
+ { "strike", "p" },
+ { "style", "body" },
+ { "style", "frameset" },
+ { "tbody", "tbody" },
+ { "tbody", "tfoot" },
+ { "td", "tbody" },
+ { "td", "td" },
+ { "td", "tfoot" },
+ { "td", "th" },
+ { "td", "tr" },
+ { "tfoot", "tbody" },
+ { "th", "tbody" },
+ { "th", "td" },
+ { "th", "tfoot" },
+ { "th", "th" },
+ { "th", "tr" },
+ { "thead", "tbody" },
+ { "thead", "tfoot" },
+ { "title", "body" },
+ { "title", "frameset" },
+ { "tr", "tbody" },
+ { "tr", "tfoot" },
+ { "tr", "tr" },
+ { "tt", "p" },
+ { "u", "p" },
+ { "u", "td" },
+ { "u", "th" },
+ { "ul", "address" },
+ { "ul", "form" },
+ { "ul", "menu" },
+ { "ul", "ol" },
+ { "ul", "pre" },
+ { "xmp", "dd" },
+ { "xmp", "dl" },
+ { "xmp", "dt" },
+ { "xmp", "fieldset" },
+ { "xmp", "form" },
+ { "xmp", "li" },
+ { "xmp", "table" },
+ { "xmp", "ul" }
};
/*
{NULL, 100} /* Default priority */
};
-static const char** htmlStartCloseIndex[100];
-static int htmlStartCloseIndexinitialized = 0;
-
/************************************************************************
* *
* functions to handle HTML specific data *
/**
* htmlInitAutoClose:
*
- * Initialize the htmlStartCloseIndex for fast lookup of closing tags names.
- * This is not reentrant. Call xmlInitParser() once before processing in
- * case of use in multithreaded programs.
+ * This is a no-op now.
*/
void
htmlInitAutoClose(void) {
- int indx, i = 0;
+}
- if (htmlStartCloseIndexinitialized) return;
+static int
+htmlCompareTags(const void *key, const void *member) {
+ const xmlChar *tag = (const xmlChar *) key;
+ const htmlElemDesc *desc = (const htmlElemDesc *) member;
- for (indx = 0;indx < 100;indx ++) htmlStartCloseIndex[indx] = NULL;
- indx = 0;
- while ((htmlStartClose[i] != NULL) && (indx < 100 - 1)) {
- htmlStartCloseIndex[indx++] = (const char**) &htmlStartClose[i];
- while (htmlStartClose[i] != NULL) i++;
- i++;
- }
- htmlStartCloseIndexinitialized = 1;
+ return(xmlStrcasecmp(tag, BAD_CAST desc->name));
}
/**
*/
const htmlElemDesc *
htmlTagLookup(const xmlChar *tag) {
- unsigned int i;
+ if (tag == NULL)
+ return(NULL);
- for (i = 0; i < (sizeof(html40ElementTable) /
- sizeof(html40ElementTable[0]));i++) {
- if (!xmlStrcasecmp(tag, BAD_CAST html40ElementTable[i].name))
- return((htmlElemDescPtr) &html40ElementTable[i]);
- }
- return(NULL);
+ return((const htmlElemDesc *) bsearch(tag, html40ElementTable,
+ sizeof(html40ElementTable) / sizeof(htmlElemDesc),
+ sizeof(htmlElemDesc), htmlCompareTags));
}
/**
}
+static int
+htmlCompareStartClose(const void *vkey, const void *member) {
+ const htmlStartCloseEntry *key = (const htmlStartCloseEntry *) vkey;
+ const htmlStartCloseEntry *entry = (const htmlStartCloseEntry *) member;
+ int ret;
+
+ ret = strcmp(key->oldTag, entry->oldTag);
+ if (ret == 0)
+ ret = strcmp(key->newTag, entry->newTag);
+
+ return(ret);
+}
+
/**
* htmlCheckAutoClose:
* @newtag: The new tag name
*
* Checks whether the new tag is one of the registered valid tags for
* closing old.
- * Initialize the htmlStartCloseIndex for fast lookup of closing tags names.
*
* Returns 0 if no, 1 if yes.
*/
static int
htmlCheckAutoClose(const xmlChar * newtag, const xmlChar * oldtag)
{
- int i, indx;
- const char **closed = NULL;
-
- if (htmlStartCloseIndexinitialized == 0)
- htmlInitAutoClose();
-
- /* inefficient, but not a big deal */
- for (indx = 0; indx < 100; indx++) {
- closed = htmlStartCloseIndex[indx];
- if (closed == NULL)
- return (0);
- if (xmlStrEqual(BAD_CAST * closed, newtag))
- break;
- }
-
- i = closed - htmlStartClose;
- i++;
- while (htmlStartClose[i] != NULL) {
- if (xmlStrEqual(BAD_CAST htmlStartClose[i], oldtag)) {
- return (1);
- }
- i++;
- }
- return (0);
+ htmlStartCloseEntry key;
+ void *res;
+
+ key.oldTag = (const char *) oldtag;
+ key.newTag = (const char *) newtag;
+ res = bsearch(&key, htmlStartClose,
+ sizeof(htmlStartClose) / sizeof(htmlStartCloseEntry),
+ sizeof(htmlStartCloseEntry), htmlCompareStartClose);
+ return(res != NULL);
}
/**
count = in - ctxt->input->cur;
ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
ctxt->input->cur = in;
- ctxt->nbChars += count;
ctxt->input->col += count;
return(ret);
}
static xmlChar *
htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
size_t len = 0, startPosition = 0;
+ int err = 0;
+ int quote;
xmlChar *ret = NULL;
- if (CUR == '"') {
- NEXT;
+ if ((CUR != '"') && (CUR != '\'')) {
+ htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
+ "SystemLiteral \" or ' expected\n", NULL, NULL);
+ return(NULL);
+ }
+ quote = CUR;
+ NEXT;
- if (CUR_PTR < BASE_PTR)
- return(ret);
- startPosition = CUR_PTR - BASE_PTR;
+ if (CUR_PTR < BASE_PTR)
+ return(ret);
+ startPosition = CUR_PTR - BASE_PTR;
- while ((IS_CHAR_CH(CUR)) && (CUR != '"')) {
- NEXT;
- len++;
- }
- if (!IS_CHAR_CH(CUR)) {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
- "Unfinished SystemLiteral\n", NULL, NULL);
- } else {
- ret = xmlStrndup((BASE_PTR+startPosition), len);
- NEXT;
+ while ((CUR != 0) && (CUR != quote)) {
+ /* TODO: Handle UTF-8 */
+ if (!IS_CHAR_CH(CUR)) {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in SystemLiteral 0x%X\n", CUR);
+ err = 1;
}
- } else if (CUR == '\'') {
NEXT;
-
- if (CUR_PTR < BASE_PTR)
- return(ret);
- startPosition = CUR_PTR - BASE_PTR;
-
- while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) {
- NEXT;
- len++;
- }
- if (!IS_CHAR_CH(CUR)) {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
- "Unfinished SystemLiteral\n", NULL, NULL);
- } else {
- ret = xmlStrndup((BASE_PTR+startPosition), len);
- NEXT;
- }
+ len++;
+ }
+ if (CUR != quote) {
+ htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
+ "Unfinished SystemLiteral\n", NULL, NULL);
} else {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
- " or ' expected\n", NULL, NULL);
+ NEXT;
+ if (err == 0)
+ ret = xmlStrndup((BASE_PTR+startPosition), len);
}
return(ret);
static xmlChar *
htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
size_t len = 0, startPosition = 0;
+ int err = 0;
+ int quote;
xmlChar *ret = NULL;
+
+ if ((CUR != '"') && (CUR != '\'')) {
+ htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
+ "PubidLiteral \" or ' expected\n", NULL, NULL);
+ return(NULL);
+ }
+ quote = CUR;
+ NEXT;
+
/*
* Name ::= (Letter | '_') (NameChar)*
*/
- if (CUR == '"') {
- NEXT;
-
- if (CUR_PTR < BASE_PTR)
- return(ret);
- startPosition = CUR_PTR - BASE_PTR;
-
- while (IS_PUBIDCHAR_CH(CUR)) {
- len++;
- NEXT;
+ if (CUR_PTR < BASE_PTR)
+ return(ret);
+ startPosition = CUR_PTR - BASE_PTR;
+
+ while ((CUR != 0) && (CUR != quote)) {
+ if (!IS_PUBIDCHAR_CH(CUR)) {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in PubidLiteral 0x%X\n", CUR);
+ err = 1;
}
-
- if (CUR != '"') {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
- "Unfinished PubidLiteral\n", NULL, NULL);
- } else {
- ret = xmlStrndup((BASE_PTR + startPosition), len);
- NEXT;
- }
- } else if (CUR == '\'') {
+ len++;
NEXT;
+ }
- if (CUR_PTR < BASE_PTR)
- return(ret);
- startPosition = CUR_PTR - BASE_PTR;
-
- while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')){
- len++;
- NEXT;
- }
-
- if (CUR != '\'') {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
- "Unfinished PubidLiteral\n", NULL, NULL);
- } else {
- ret = xmlStrndup((BASE_PTR + startPosition), len);
- NEXT;
- }
+ if (CUR != '"') {
+ htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
+ "Unfinished PubidLiteral\n", NULL, NULL);
} else {
- htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
- "PubidLiteral \" or ' expected\n", NULL, NULL);
+ NEXT;
+ if (err == 0)
+ ret = xmlStrndup((BASE_PTR + startPosition), len);
}
return(ret);
SHRINK;
cur = CUR_CHAR(l);
- while (IS_CHAR_CH(cur)) {
+ while (cur != 0) {
if ((cur == '<') && (NXT(1) == '/')) {
/*
* One should break here, the specification is clear:
}
}
}
- COPY_BUF(l,buf,nbchar,cur);
+ if (IS_CHAR(cur)) {
+ COPY_BUF(l,buf,nbchar,cur);
+ } else {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in CDATA 0x%X\n", cur);
+ }
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
cur = CUR_CHAR(l);
}
- if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) {
- htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
- "Invalid char in CDATA 0x%X\n", cur);
- if (ctxt->input->cur < ctxt->input->end) {
- NEXT;
- }
- }
-
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
}
SKIP_BLANKS;
cur = CUR_CHAR(l);
- while (IS_CHAR(cur) && (cur != '>')) {
+ while ((cur != 0) && (cur != '>')) {
if (len + 5 >= size) {
xmlChar *tmp;
GROW;
count = 0;
}
- COPY_BUF(l,buf,len,cur);
+ if (IS_CHAR(cur)) {
+ COPY_BUF(l,buf,len,cur);
+ } else {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in processing instruction "
+ "0x%X\n", cur);
+ }
NEXTL(l);
cur = CUR_CHAR(l);
if (cur == 0) {
int q, ql;
int r, rl;
int cur, l;
+ int next, nl;
xmlParserInputState state;
/*
len = 0;
buf[len] = 0;
q = CUR_CHAR(ql);
- if (!IS_CHAR(q))
+ if (q == 0)
goto unfinished;
NEXTL(ql);
r = CUR_CHAR(rl);
- if (!IS_CHAR(r))
+ if (r == 0)
goto unfinished;
NEXTL(rl);
cur = CUR_CHAR(l);
- while (IS_CHAR(cur) &&
+ while ((cur != 0) &&
((cur != '>') ||
(r != '-') || (q != '-'))) {
+ NEXTL(l);
+ next = CUR_CHAR(nl);
+ if (next == 0) {
+ SHRINK;
+ GROW;
+ next = CUR_CHAR(nl);
+ }
+
+ if ((q == '-') && (r == '-') && (cur == '!') && (next == '>')) {
+ htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
+ "Comment incorrectly closed by '--!>'", NULL, NULL);
+ cur = '>';
+ break;
+ }
+
if (len + 5 >= size) {
xmlChar *tmp;
}
buf = tmp;
}
- COPY_BUF(ql,buf,len,q);
+ if (IS_CHAR(q)) {
+ COPY_BUF(ql,buf,len,q);
+ } else {
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in comment 0x%X\n", q);
+ }
+
q = r;
ql = rl;
r = cur;
rl = l;
- NEXTL(l);
- cur = CUR_CHAR(l);
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR_CHAR(l);
- }
+ cur = next;
+ l = nl;
}
buf[len] = 0;
- if (IS_CHAR(cur)) {
+ if (cur == '>') {
NEXT;
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
(!ctxt->disableSAX))
((NXT(2) == 'x') || NXT(2) == 'X')) {
SKIP(3);
while (CUR != ';') {
- if ((CUR >= '0') && (CUR <= '9'))
- val = val * 16 + (CUR - '0');
- else if ((CUR >= 'a') && (CUR <= 'f'))
- val = val * 16 + (CUR - 'a') + 10;
- else if ((CUR >= 'A') && (CUR <= 'F'))
- val = val * 16 + (CUR - 'A') + 10;
- else {
+ if ((CUR >= '0') && (CUR <= '9')) {
+ if (val < 0x110000)
+ val = val * 16 + (CUR - '0');
+ } else if ((CUR >= 'a') && (CUR <= 'f')) {
+ if (val < 0x110000)
+ val = val * 16 + (CUR - 'a') + 10;
+ } else if ((CUR >= 'A') && (CUR <= 'F')) {
+ if (val < 0x110000)
+ val = val * 16 + (CUR - 'A') + 10;
+ } else {
htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF,
"htmlParseCharRef: missing semicolon\n",
NULL, NULL);
} else if ((CUR == '&') && (NXT(1) == '#')) {
SKIP(2);
while (CUR != ';') {
- if ((CUR >= '0') && (CUR <= '9'))
- val = val * 10 + (CUR - '0');
- else {
+ if ((CUR >= '0') && (CUR <= '9')) {
+ if (val < 0x110000)
+ val = val * 10 + (CUR - '0');
+ } else {
htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF,
"htmlParseCharRef: missing semicolon\n",
NULL, NULL);
*/
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",
if (CUR != '>') {
htmlParseErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED,
"DOCTYPE improperly terminated\n", NULL, NULL);
- /* We shouldn't try to resynchronize ... */
+ /* Ignore bogus content */
+ while ((CUR != 0) && (CUR != '>'))
+ NEXT;
}
- NEXT;
+ if (CUR == '>')
+ NEXT;
/*
* Create or update the document accordingly to the DOCTYPE
/* Dump the bogus tag like browsers do */
- while ((IS_CHAR_CH(CUR)) && (CUR != '>') &&
+ while ((CUR != 0) && (CUR != '>') &&
(ctxt->instate != XML_PARSER_EOF))
NEXT;
return -1;
* (S Attribute)* S?
*/
SKIP_BLANKS;
- while ((IS_CHAR_CH(CUR)) &&
+ while ((CUR != 0) &&
(CUR != '>') &&
((CUR != '/') || (NXT(1) != '>'))) {
- long cons = ctxt->nbChars;
-
GROW;
attname = htmlParseAttribute(ctxt, &attvalue);
if (attname != NULL) {
xmlFree(attvalue);
/* Dump the bogus attribute string up to the next blank or
* the end of the tag. */
- while ((IS_CHAR_CH(CUR)) &&
+ while ((CUR != 0) &&
!(IS_BLANK_CH(CUR)) && (CUR != '>') &&
((CUR != '/') || (NXT(1) != '>')))
NEXT;
failed:
SKIP_BLANKS;
- if (cons == ctxt->nbChars) {
- htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
- "htmlParseStartTag: problem parsing attributes\n",
- NULL, NULL);
- break;
- }
}
/*
* We should definitely be at the ending "S? '>'" part
*/
SKIP_BLANKS;
- if ((!IS_CHAR_CH(CUR)) || (CUR != '>')) {
+ if (CUR != '>') {
htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
"End tag : expected '>'\n", NULL, NULL);
- if (ctxt->recovery) {
- /*
- * We're not at the ending > !!
- * Error, unless in recover mode where we search forwards
- * until we find a >
- */
- while (CUR != '\0' && CUR != '>') NEXT;
- NEXT;
- }
- } else
+ /* Skip to next '>' */
+ while ((CUR != 0) && (CUR != '>'))
+ NEXT;
+ }
+ if (CUR == '>')
NEXT;
/*
* With the exception that the autoclose may have popped stuff out
* of the stack.
*/
- if (!xmlStrEqual(name, ctxt->name)) {
- if ((ctxt->name != NULL) && (!xmlStrEqual(ctxt->name, name))) {
- htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
- "Opening and ending tag mismatch: %s and %s\n",
- name, ctxt->name);
- }
+ if ((ctxt->name != NULL) && (!xmlStrEqual(ctxt->name, name))) {
+ htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
+ "Opening and ending tag mismatch: %s and %s\n",
+ name, ctxt->name);
}
/*
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
while (1) {
- long cons = ctxt->nbChars;
-
GROW;
if (ctxt->instate == XML_PARSER_EOF)
"htmlParseStartTag: invalid element name\n",
NULL, NULL);
/* Dump the bogus tag like browsers do */
- while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
+ while ((CUR != 0) && (CUR != '>'))
NEXT;
if (currentNode != NULL)
else {
htmlParseCharData(ctxt);
}
-
- if (cons == ctxt->nbChars) {
- if (ctxt->node != NULL) {
- htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
- "detected an error in element content\n",
- NULL, NULL);
- }
- break;
- }
}
GROW;
}
*/
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
- while (IS_CHAR_CH(CUR)) {
+ while (CUR != 0) {
oldptr = ctxt->input->cur;
htmlParseContent(ctxt);
if (oldptr==ctxt->input->cur) break;
node_info.node = ctxt->node;
xmlParserAddNodeInfo(ctxt, &node_info);
}
- if (!IS_CHAR_CH(CUR)) {
+ if (CUR == 0) {
htmlAutoCloseOnEnd(ctxt);
}
xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
htmlNodeInfoPop(ctxt);
}
- if (!IS_CHAR_CH(CUR)) {
+ if (CUR == 0) {
htmlAutoCloseOnEnd(ctxt);
}
}
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
while (1) {
- long cons = ctxt->nbChars;
-
GROW;
if (ctxt->instate == XML_PARSER_EOF)
"htmlParseStartTag: invalid element name\n",
NULL, NULL);
/* Dump the bogus tag like browsers do */
- while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
+ while ((CUR == 0) && (CUR != '>'))
NEXT;
htmlParserFinishElementParsing(ctxt);
else {
htmlParseCharData(ctxt);
}
-
- if (cons == ctxt->nbChars) {
- if (ctxt->node != NULL) {
- htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
- "detected an error in element content\n",
- NULL, NULL);
- }
- break;
- }
}
GROW;
}
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->record_info = 0;
ctxt->validate = 0;
- ctxt->nbChars = 0;
ctxt->checkIndex = 0;
ctxt->catalogs = NULL;
xmlInitNodeInfoSeq(&ctxt->node_seq);
* @first: the first char to lookup
* @next: the next char to lookup or zero
* @third: the next char to lookup or zero
- * @comment: flag to force checking inside comments
+ * @ignoreattrval: skip over attribute values
*
* Try to find if a sequence (first, next, third) or just (first next) or
* (first) is available in the input stream.
*/
static int
htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
- xmlChar next, xmlChar third, int iscomment,
- int ignoreattrval)
+ xmlChar next, xmlChar third, int ignoreattrval)
{
int base, len;
htmlParserInputPtr in;
const xmlChar *buf;
- int incomment = 0;
int invalue = 0;
char valdellim = 0x0;
if (base < 0)
return (-1);
- if (ctxt->checkIndex > base)
+ if (ctxt->checkIndex > base) {
base = ctxt->checkIndex;
+ /* Abuse hasPErefs member to restore current state. */
+ invalue = ctxt->hasPErefs & 1 ? 1 : 0;
+ }
if (in->buf == NULL) {
buf = in->base;
else if (next)
len--;
for (; base < len; base++) {
- if ((!incomment) && (base + 4 < len) && (!iscomment)) {
- if ((buf[base] == '<') && (buf[base + 1] == '!') &&
- (buf[base + 2] == '-') && (buf[base + 3] == '-')) {
- incomment = 1;
- /* do not increment past <! - some people use <!--> */
- base += 2;
- }
- }
if (ignoreattrval) {
if (buf[base] == '"' || buf[base] == '\'') {
if (invalue) {
continue;
}
}
- if (incomment) {
- if (base + 3 > len)
- return (-1);
- if ((buf[base] == '-') && (buf[base + 1] == '-') &&
- (buf[base + 2] == '>')) {
- incomment = 0;
- base += 2;
- }
- continue;
- }
if (buf[base] == first) {
if (third != 0) {
if ((buf[base + 1] != next) || (buf[base + 2] != third))
return (base - (in->cur - in->base));
}
}
- if ((!incomment) && (!invalue))
- ctxt->checkIndex = base;
+ ctxt->checkIndex = base;
+ /* Abuse hasPErefs member to track current state. */
+ if (invalue)
+ ctxt->hasPErefs |= 1;
+ else
+ ctxt->hasPErefs &= ~1;
#ifdef DEBUG_PUSH
if (next == 0)
xmlGenericError(xmlGenericErrorContext,
}
/**
- * htmlParseLookupChars:
+ * htmlParseLookupCommentEnd:
* @ctxt: an HTML parser context
- * @stop: Array of chars, which stop the lookup.
- * @stopLen: Length of stop-Array
*
- * Try to find if any char of the stop-Array is available in the input
- * stream.
+ * Try to find a comment end tag in the input stream
+ * The search includes "-->" as well as WHATWG-recommended incorrectly-closed tags.
+ * (See https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment)
* This function has a side effect of (possibly) incrementing ctxt->checkIndex
* to avoid rescanning sequences of bytes, it DOES change the state of the
* parser, do not use liberally.
+ * This wraps to htmlParseLookupSequence()
*
- * Returns the index to the current parsing point if a stopChar
- * is available, -1 otherwise.
+ * Returns the index to the current parsing point if the full sequence is available, -1 otherwise.
*/
static int
-htmlParseLookupChars(htmlParserCtxtPtr ctxt, const xmlChar * stop,
- int stopLen)
+htmlParseLookupCommentEnd(htmlParserCtxtPtr ctxt)
{
- int base, len;
- htmlParserInputPtr in;
- const xmlChar *buf;
- int incomment = 0;
- int i;
-
- in = ctxt->input;
- if (in == NULL)
- return (-1);
-
- base = in->cur - in->base;
- if (base < 0)
- return (-1);
-
- if (ctxt->checkIndex > base)
- base = ctxt->checkIndex;
-
- if (in->buf == NULL) {
- buf = in->base;
- len = in->length;
- } else {
- buf = xmlBufContent(in->buf->buffer);
- len = xmlBufUse(in->buf->buffer);
- }
-
- for (; base < len; base++) {
- if (!incomment && (base + 4 < len)) {
- if ((buf[base] == '<') && (buf[base + 1] == '!') &&
- (buf[base + 2] == '-') && (buf[base + 3] == '-')) {
- incomment = 1;
- /* do not increment past <! - some people use <!--> */
- base += 2;
- }
- }
- if (incomment) {
- if (base + 3 > len)
- return (-1);
- if ((buf[base] == '-') && (buf[base + 1] == '-') &&
- (buf[base + 2] == '>')) {
- incomment = 0;
- base += 2;
- }
- continue;
- }
- for (i = 0; i < stopLen; ++i) {
- if (buf[base] == stop[i]) {
- ctxt->checkIndex = 0;
- return (base - (in->cur - in->base));
- }
- }
+ int mark = 0;
+ int cur = CUR_PTR - BASE_PTR;
+
+ while (mark >= 0) {
+ mark = htmlParseLookupSequence(ctxt, '-', '-', 0, 0);
+ if ((mark < 0) ||
+ (NXT(mark+2) == '>') ||
+ ((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
+ return mark;
+ }
+ ctxt->checkIndex = cur + mark + 1;
}
- ctxt->checkIndex = base;
- return (-1);
+ return mark;
}
+
/**
* htmlParseTryOrFinish:
* @ctxt: an HTML parser context
htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
int ret = 0;
htmlParserInputPtr in;
- int avail = 0;
+ ptrdiff_t avail = 0;
xmlChar cur, next;
htmlParserNodeInfo node_info;
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
else
- avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+ avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+ (in->cur - in->base);
if ((avail == 0) && (terminate)) {
htmlAutoCloseOnEnd(ctxt);
if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) {
}
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);
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
else
- avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+ avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+ (in->cur - in->base);
}
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
ctxt->sax->setDocumentLocator(ctxt->userData,
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
(UPP(8) == 'E')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
else
- avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+ avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+ (in->cur - in->base);
/*
* no chars in buffer
*/
if (avail < 1)
goto done;
/*
- * not enouth chars in buffer
+ * not enough chars in buffer
*/
if (avail < 2) {
if (!terminate)
cur = in->cur[0];
if ((cur == '<') && (next == '!') &&
(in->cur[2] == '-') && (in->cur[3] == '-')) {
- if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+ if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
ctxt->instate = XML_PARSER_MISC;
} else if ((cur == '<') && (next == '?')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
(UPP(8) == 'E')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
(avail < 9)) {
goto done;
} else {
- ctxt->instate = XML_PARSER_START_TAG;
+ ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
"HPP: entering START_TAG\n");
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
else
- avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+ avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+ (in->cur - in->base);
if (avail < 2)
goto done;
cur = in->cur[0];
next = in->cur[1];
if ((cur == '<') && (next == '!') &&
(in->cur[2] == '-') && (in->cur[3] == '-')) {
- if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+ if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
ctxt->instate = XML_PARSER_PROLOG;
} else if ((cur == '<') && (next == '?')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
(avail < 4)) {
goto done;
} else {
- ctxt->instate = XML_PARSER_START_TAG;
+ ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
"HPP: entering START_TAG\n");
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
else
- avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+ avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+ (in->cur - in->base);
if (avail < 1)
goto done;
cur = in->cur[0];
next = in->cur[1];
if ((cur == '<') && (next == '!') &&
(in->cur[2] == '-') && (in->cur[3] == '-')) {
- if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+ if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
ctxt->instate = XML_PARSER_EPILOG;
} else if ((cur == '<') && (next == '?')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
if (avail < 1)
goto done;
/*
- * not enouth chars in buffer
+ * not enough chars in buffer
*/
if (avail < 2) {
if (!terminate)
break;
}
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
goto done;
/* Capture start position */
}
case XML_PARSER_CONTENT: {
xmlChar chr[2] = { 0, 0 };
- long cons;
/*
* Handle preparsed entities and charRef
goto done;
cur = in->cur[0];
next = in->cur[1];
- cons = ctxt->nbChars;
if ((xmlStrEqual(ctxt->name, BAD_CAST"script")) ||
(xmlStrEqual(ctxt->name, BAD_CAST"style"))) {
/*
int idx;
xmlChar val;
- idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 0);
+ idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0);
if (idx < 0)
goto done;
val = in->cur[idx + 2];
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
(UPP(8) == 'E')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
goto done;
htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
"Misplaced DOCTYPE declaration\n",
htmlParseDocTypeDecl(ctxt);
} else if ((cur == '<') && (next == '!') &&
(in->cur[2] == '-') && (in->cur[3] == '-')) {
- if ((!terminate) &&
- (htmlParseLookupSequence(
- ctxt, '-', '-', '>', 1, 1) < 0))
+ if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
ctxt->instate = XML_PARSER_CONTENT;
} else if ((cur == '<') && (next == '?')) {
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
goto done;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
#endif
break;
} else if (cur == '<') {
- ctxt->instate = XML_PARSER_START_TAG;
- ctxt->checkIndex = 0;
+ if ((!terminate) && (next == 0))
+ goto done;
+ /*
+ * Only switch to START_TAG if the next character
+ * starts a valid name. Otherwise, htmlParseStartTag
+ * might return without consuming all characters
+ * up to the final '>'.
+ */
+ if ((IS_ASCII_LETTER(next)) ||
+ (next == '_') || (next == ':') || (next == '.')) {
+ ctxt->instate = XML_PARSER_START_TAG;
+ ctxt->checkIndex = 0;
#ifdef DEBUG_PUSH
- xmlGenericError(xmlGenericErrorContext,
- "HPP: entering START_TAG\n");
+ xmlGenericError(xmlGenericErrorContext,
+ "HPP: entering START_TAG\n");
#endif
+ } else {
+ htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
+ "htmlParseTryOrFinish: "
+ "invalid element name\n",
+ NULL, NULL);
+ htmlCheckParagraph(ctxt);
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->characters != NULL))
+ ctxt->sax->characters(ctxt->userData,
+ in->cur, 1);
+ NEXT;
+ }
break;
- } else if (cur == '&') {
- if ((!terminate) &&
- (htmlParseLookupChars(ctxt,
- BAD_CAST "; >/", 4) < 0))
- goto done;
-#ifdef DEBUG_PUSH
- xmlGenericError(xmlGenericErrorContext,
- "HPP: Parsing Reference\n");
-#endif
- /* TODO: check generation of subtrees if noent !!! */
- htmlParseReference(ctxt);
} else {
/*
* check that the text sequence is complete
* data detection.
*/
if ((!terminate) &&
- (htmlParseLookupChars(ctxt, BAD_CAST "<&", 2) < 0))
+ (htmlParseLookupSequence(ctxt, '<', 0, 0, 0) < 0))
goto done;
ctxt->checkIndex = 0;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
"HPP: Parsing char data\n");
#endif
- htmlParseCharData(ctxt);
+ while ((ctxt->instate != XML_PARSER_EOF) &&
+ (cur != '<') && (in->cur < in->end)) {
+ if (cur == '&') {
+ htmlParseReference(ctxt);
+ } else {
+ htmlParseCharData(ctxt);
+ }
+ cur = in->cur[0];
+ }
}
}
- if (cons == ctxt->nbChars) {
- if (ctxt->node != NULL) {
- htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
- "detected an error in element content\n",
- NULL, NULL);
- }
- NEXT;
- break;
- }
break;
}
if (avail < 2)
goto done;
if ((!terminate) &&
- (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+ (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
goto done;
htmlParseEndTag(ctxt);
if (ctxt->nameNr == 0) {
int res;
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
+ xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
ctxt->errNo = XML_PARSER_EOF;
ctxt->disableSAX = 1;
return (XML_PARSER_EOF);
}
- xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
#endif
size_t current = ctxt->input->cur - ctxt->input->base;
nbchars = xmlCharEncInput(in, terminate);
+ xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
if (nbchars < 0) {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"encoder error\n", NULL, NULL);
return(XML_ERR_INVALID_ENCODING);
}
- xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
}
}
}
ctxt->vctxt.error = xmlParserValidityError;
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->record_info = 0;
- ctxt->nbChars = 0;
ctxt->checkIndex = 0;
ctxt->inSubset = 0;
ctxt->errNo = XML_ERR_OK;
found_meta:
/*
* Search and update all the remaining the meta elements carrying
- * encoding informations
+ * encoding information
*/
while (cur != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
************************************************************************/
/**
* htmlSaveErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* htmlSaveErr:
* @code: the error number
* @node: the location of the error.
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
buf = xmlOutputBufferCreateFile(out, handler);
if (buf == NULL) return(0);
- htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
+ htmlNodeDumpFormatOutput(buf, doc, cur, NULL, format);
ret = xmlOutputBufferClose(buf);
return(ret);
* @buf: the HTML buffer output
* @doc: the document
* @cur: the attribute pointer
- * @encoding: the encoding string
*
* Dump an HTML attribute
*/
static void
-htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
- const char *encoding ATTRIBUTE_UNUSED) {
+htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
xmlChar *value;
/*
(!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
(!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
+ xmlChar *escaped;
xmlChar *tmp = value;
- /* xmlURIEscapeStr() escapes '"' so it can be safely used. */
- xmlBufCCat(buf->buffer, "\"");
while (IS_BLANK_CH(*tmp)) tmp++;
- /* URI Escape everything, except server side includes. */
- for ( ; ; ) {
- xmlChar *escaped;
- xmlChar endChar;
- xmlChar *end = NULL;
- xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
- if (start != NULL) {
- end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->");
- if (end != NULL) {
- *start = '\0';
- }
- }
-
- /* Escape the whole string, or until start (set to '\0'). */
- escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
- if (escaped != NULL) {
- xmlBufCat(buf->buffer, escaped);
- xmlFree(escaped);
- } else {
- xmlBufCat(buf->buffer, tmp);
- }
-
- if (end == NULL) { /* Everything has been written. */
- break;
- }
-
- /* Do not escape anything within server side includes. */
- *start = '<'; /* Restore the first character of "<!--". */
- end += 3; /* strlen("-->") */
- endChar = *end;
- *end = '\0';
- xmlBufCat(buf->buffer, start);
- *end = endChar;
- tmp = end;
+ /*
+ * the < and > have already been escaped at the entity level
+ * And doing so here breaks server side includes
+ */
+ escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>");
+ if (escaped != NULL) {
+ xmlBufWriteQuotedString(buf->buffer, escaped);
+ xmlFree(escaped);
+ } else {
+ xmlBufWriteQuotedString(buf->buffer, value);
}
-
- xmlBufCCat(buf->buffer, "\"");
} else {
xmlBufWriteQuotedString(buf->buffer, value);
}
}
/**
- * htmlAttrListDumpOutput:
- * @buf: the HTML buffer output
- * @doc: the document
- * @cur: the first attribute pointer
- * @encoding: the encoding string
- *
- * Dump a list of HTML attributes
- */
-static void
-htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
- if (cur == NULL) {
- return;
- }
- while (cur != NULL) {
- htmlAttrDumpOutput(buf, doc, cur, encoding);
- cur = cur->next;
- }
-}
-
-
-
-/**
- * htmlNodeListDumpOutput:
- * @buf: the HTML buffer output
- * @doc: the document
- * @cur: the first node
- * @encoding: the encoding string
- * @format: should formatting spaces been added
- *
- * Dump an HTML node list, recursive behaviour,children are printed too.
- */
-static void
-htmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- xmlNodePtr cur, const char *encoding, int format) {
- if (cur == NULL) {
- return;
- }
- while (cur != NULL) {
- htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
- cur = cur->next;
- }
-}
-
-/**
* htmlNodeDumpFormatOutput:
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
- * @encoding: the encoding string
+ * @encoding: the encoding string (unused)
* @format: should formatting spaces been added
*
* Dump an HTML node, recursive behaviour,children are printed too.
*/
void
htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- xmlNodePtr cur, const char *encoding, int format) {
+ xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+ int format) {
+ xmlNodePtr root;
+ xmlAttrPtr attr;
const htmlElemDesc * info;
xmlInitParser();
if ((cur == NULL) || (buf == NULL)) {
return;
}
- /*
- * Special cases.
- */
- if (cur->type == XML_DTD_NODE)
- return;
- if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
- (cur->type == XML_DOCUMENT_NODE)){
- htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
- return;
- }
- if (cur->type == XML_ATTRIBUTE_NODE) {
- htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
- return;
- }
- if (cur->type == HTML_TEXT_NODE) {
- if (cur->content != NULL) {
- if (((cur->name == (const xmlChar *)xmlStringText) ||
- (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
- ((cur->parent == NULL) ||
- ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
- (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
- xmlChar *buffer;
-
- buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
- if (buffer != NULL) {
- xmlOutputBufferWriteString(buf, (const char *)buffer);
- xmlFree(buffer);
- }
- } else {
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- }
- }
- return;
- }
- if (cur->type == HTML_COMMENT_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWriteString(buf, "<!--");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- xmlOutputBufferWriteString(buf, "-->");
- }
- return;
- }
- if (cur->type == HTML_PI_NODE) {
- if (cur->name == NULL)
- return;
- xmlOutputBufferWriteString(buf, "<?");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->content != NULL) {
- xmlOutputBufferWriteString(buf, " ");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- }
- xmlOutputBufferWriteString(buf, ">");
- return;
- }
- if (cur->type == HTML_ENTITY_REF_NODE) {
- xmlOutputBufferWriteString(buf, "&");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWriteString(buf, ";");
- return;
- }
- if (cur->type == HTML_PRESERVE_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- }
- return;
- }
- /*
- * Get specific HTML info for that node.
- */
- if (cur->ns == NULL)
- info = htmlTagLookup(cur->name);
- else
- info = NULL;
+ root = cur;
+ while (1) {
+ switch (cur->type) {
+ case XML_HTML_DOCUMENT_NODE:
+ case XML_DOCUMENT_NODE:
+ if (((xmlDocPtr) cur)->intSubset != NULL) {
+ htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+ }
+ if (cur->children != NULL) {
+ cur = cur->children;
+ continue;
+ }
+ break;
- xmlOutputBufferWriteString(buf, "<");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWriteString(buf, ":");
- }
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->nsDef)
- xmlNsListDumpOutput(buf, cur->nsDef);
- if (cur->properties != NULL)
- htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);
-
- if ((info != NULL) && (info->empty)) {
- xmlOutputBufferWriteString(buf, ">");
- if ((format) && (!info->isinline) && (cur->next != NULL)) {
- if ((cur->next->type != HTML_TEXT_NODE) &&
- (cur->next->type != HTML_ENTITY_REF_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->name != NULL) &&
- (cur->parent->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- }
- return;
- }
- if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
- (cur->children == NULL)) {
- if ((info != NULL) && (info->saveEndTag != 0) &&
- (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) &&
- (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) {
- xmlOutputBufferWriteString(buf, ">");
- } else {
- xmlOutputBufferWriteString(buf, "></");
+ case XML_ELEMENT_NODE:
+ /*
+ * Get specific HTML info for that node.
+ */
+ if (cur->ns == NULL)
+ info = htmlTagLookup(cur->name);
+ else
+ info = NULL;
+
+ xmlOutputBufferWriteString(buf, "<");
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
xmlOutputBufferWriteString(buf, ":");
}
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWriteString(buf, ">");
- }
- if ((format) && (cur->next != NULL) &&
- (info != NULL) && (!info->isinline)) {
- if ((cur->next->type != HTML_TEXT_NODE) &&
- (cur->next->type != HTML_ENTITY_REF_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->name != NULL) &&
- (cur->parent->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- }
- return;
- }
- xmlOutputBufferWriteString(buf, ">");
- if ((cur->type != XML_ELEMENT_NODE) &&
- (cur->content != NULL)) {
- /*
- * Uses the OutputBuffer property to automatically convert
- * invalids to charrefs
- */
-
- xmlOutputBufferWriteString(buf, (const char *) cur->content);
- }
- if (cur->children != NULL) {
- if ((format) && (info != NULL) && (!info->isinline) &&
- (cur->children->type != HTML_TEXT_NODE) &&
- (cur->children->type != HTML_ENTITY_REF_NODE) &&
- (cur->children != cur->last) &&
- (cur->name != NULL) &&
- (cur->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
- if ((format) && (info != NULL) && (!info->isinline) &&
- (cur->last->type != HTML_TEXT_NODE) &&
- (cur->last->type != HTML_ENTITY_REF_NODE) &&
- (cur->children != cur->last) &&
- (cur->name != NULL) &&
- (cur->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- }
- xmlOutputBufferWriteString(buf, "</");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWriteString(buf, ":");
- }
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWriteString(buf, ">");
- if ((format) && (info != NULL) && (!info->isinline) &&
- (cur->next != NULL)) {
- if ((cur->next->type != HTML_TEXT_NODE) &&
- (cur->next->type != HTML_ENTITY_REF_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->name != NULL) &&
- (cur->parent->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->nsDef)
+ xmlNsListDumpOutput(buf, cur->nsDef);
+ attr = cur->properties;
+ while (attr != NULL) {
+ htmlAttrDumpOutput(buf, doc, attr);
+ attr = attr->next;
+ }
+
+ if ((info != NULL) && (info->empty)) {
+ xmlOutputBufferWriteString(buf, ">");
+ } else if (cur->children == NULL) {
+ if ((info != NULL) && (info->saveEndTag != 0) &&
+ (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) &&
+ (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) {
+ xmlOutputBufferWriteString(buf, ">");
+ } else {
+ xmlOutputBufferWriteString(buf, "></");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->ns->prefix);
+ xmlOutputBufferWriteString(buf, ":");
+ }
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWriteString(buf, ">");
+ }
+ } else {
+ xmlOutputBufferWriteString(buf, ">");
+ if ((format) && (info != NULL) && (!info->isinline) &&
+ (cur->children->type != HTML_TEXT_NODE) &&
+ (cur->children->type != HTML_ENTITY_REF_NODE) &&
+ (cur->children != cur->last) &&
+ (cur->name != NULL) &&
+ (cur->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
+ cur = cur->children;
+ continue;
+ }
+
+ if ((format) && (cur->next != NULL) &&
+ (info != NULL) && (!info->isinline)) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE) &&
+ (cur->parent != NULL) &&
+ (cur->parent->name != NULL) &&
+ (cur->parent->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
+ }
+
+ break;
+
+ case XML_ATTRIBUTE_NODE:
+ htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur);
+ break;
+
+ case HTML_TEXT_NODE:
+ if (cur->content == NULL)
+ break;
+ if (((cur->name == (const xmlChar *)xmlStringText) ||
+ (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+ ((cur->parent == NULL) ||
+ ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
+ (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
+ xmlChar *buffer;
+
+ buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+ if (buffer != NULL) {
+ xmlOutputBufferWriteString(buf, (const char *)buffer);
+ xmlFree(buffer);
+ }
+ } else {
+ xmlOutputBufferWriteString(buf, (const char *)cur->content);
+ }
+ break;
+
+ case HTML_COMMENT_NODE:
+ if (cur->content != NULL) {
+ xmlOutputBufferWriteString(buf, "<!--");
+ xmlOutputBufferWriteString(buf, (const char *)cur->content);
+ xmlOutputBufferWriteString(buf, "-->");
+ }
+ break;
+
+ case HTML_PI_NODE:
+ if (cur->name != NULL) {
+ xmlOutputBufferWriteString(buf, "<?");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->content != NULL) {
+ xmlOutputBufferWriteString(buf, " ");
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->content);
+ }
+ xmlOutputBufferWriteString(buf, ">");
+ }
+ break;
+
+ case HTML_ENTITY_REF_NODE:
+ xmlOutputBufferWriteString(buf, "&");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWriteString(buf, ";");
+ break;
+
+ case HTML_PRESERVE_NODE:
+ if (cur->content != NULL) {
+ xmlOutputBufferWriteString(buf, (const char *)cur->content);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ while (1) {
+ if (cur == root)
+ return;
+ if (cur->next != NULL) {
+ cur = cur->next;
+ break;
+ }
+
+ /*
+ * The parent should never be NULL here but we want to handle
+ * corrupted documents gracefully.
+ */
+ if (cur->parent == NULL)
+ return;
+ cur = cur->parent;
+
+ if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+ (cur->type == XML_DOCUMENT_NODE)) {
+ xmlOutputBufferWriteString(buf, "\n");
+ } else {
+ if ((format) && (cur->ns == NULL))
+ info = htmlTagLookup(cur->name);
+ else
+ info = NULL;
+
+ if ((format) && (info != NULL) && (!info->isinline) &&
+ (cur->last->type != HTML_TEXT_NODE) &&
+ (cur->last->type != HTML_ENTITY_REF_NODE) &&
+ (cur->children != cur->last) &&
+ (cur->name != NULL) &&
+ (cur->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
+
+ xmlOutputBufferWriteString(buf, "</");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+ xmlOutputBufferWriteString(buf, ":");
+ }
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWriteString(buf, ">");
+
+ if ((format) && (info != NULL) && (!info->isinline) &&
+ (cur->next != NULL)) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE) &&
+ (cur->parent != NULL) &&
+ (cur->parent->name != NULL) &&
+ (cur->parent->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
+ }
+ }
+ }
}
}
* @buf: the HTML buffer output
* @doc: the document
* @cur: the current node
- * @encoding: the encoding string
+ * @encoding: the encoding string (unused)
*
* Dump an HTML node, recursive behaviour,children are printed too,
* and formatting returns/spaces are added.
*/
void
htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- xmlNodePtr cur, const char *encoding) {
- htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
+ xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED) {
+ htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1);
}
/**
* htmlDocContentDumpFormatOutput:
* @buf: the HTML buffer output
* @cur: the document
- * @encoding: the encoding string
+ * @encoding: the encoding string (unused)
* @format: should formatting spaces been added
*
* Dump an HTML document.
*/
void
htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
- const char *encoding, int format) {
- int type;
-
- xmlInitParser();
-
- if ((buf == NULL) || (cur == NULL))
- return;
-
- /*
- * force to output the stuff as HTML, especially for entities
- */
- type = cur->type;
- cur->type = XML_HTML_DOCUMENT_NODE;
- if (cur->intSubset != NULL) {
- htmlDtdDumpOutput(buf, cur, NULL);
- }
- if (cur->children != NULL) {
- htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
- }
- xmlOutputBufferWriteString(buf, "\n");
- cur->type = (xmlElementType) type;
+ const char *encoding ATTRIBUTE_UNUSED,
+ int format) {
+ htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, format);
}
/**
* htmlDocContentDumpOutput:
* @buf: the HTML buffer output
* @cur: the document
- * @encoding: the encoding string
+ * @encoding: the encoding string (unused)
*
* Dump an HTML document. Formatting return/spaces are added.
*/
void
htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
- const char *encoding) {
- htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
+ const char *encoding ATTRIBUTE_UNUSED) {
+ htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, 1);
}
/************************************************************************
-Extracted from the documentation:
- http://xmlsoft.org/FAQ.html#Compilatio
-
See also the generic INSTALL file for configure options
Compilation
- 1.What is the process to compile libxml ?
+ 1. What is the process to compile libxml?
As most UNIX libraries libxml follows the "standard":
- gunzip -c xxx.tar.gz | tar xvf -
-
- cd libxml-xxxx
+ gunzip -c xxx.tar.gz | tar xvf -
+ cd libxml-xxxx
- ./configure --help
+ ./configure --help
to see the options, then the compilation/installation proper
- ./configure [possible options]
-
- make
-
- make install
+ ./configure [possible options]
+ make
+ make install
At that point you may have to rerun ldconfig or similar utility to
update your list of installed shared libs.
- At this point you can check that the library is properly functionning
+ At this point you can check that the library is properly functioning
by running
- make tests
+ make check
+
+ Please report test failures to the mailing list or bug tracker.
- 2.What other libraries are needed to compile/install libxml ?
+ 2. What other libraries are needed to compile/install libxml?
- Libxml does not requires any other library, the normal C ANSI API
- should be sufficient (please report any violation to this rule you
- may find).
+ Libxml does not require any other libraries. A platform with somewhat
+ recent POSIX support should be sufficient (please report any violation
+ to this rule you may find).
- However if found at configuration time libxml will detect and use
+ However if found at configuration time, libxml will detect and use
the following libs:
- libz: a highly portable and available widely compression library
- http://www.info-zip.org/pub/infozip/zlib/
+ libz: a highly portable and widely available compression library
+ https://zlib.net/
+ liblzma: another compression library
+ https://tukaani.org/xz/
iconv: a powerful character encoding conversion library. It's
- included by default on recent glibc libraries, so it doesn't
- need to be installed specifically on linux. It seems it's
- now part of the official UNIX specification. Here is one
- implementation of the library which source can be found here.
- http://clisp.cons.org/~haible/packages-libiconv.html
- ftp://ftp.ilog.fr/pub/Users/haible/gnu/
-
- 3.make tests may fail on some platforms
-
- Sometime the regression tests results don't completely match the
- value produced by the parser, and the makefile uses diff to print
- the delta. On some platforms the diff return breaks the compilation
- process, if the diff is small this is probably not a serious problem
+ part of POSIX.1-2001, so it doesn't need to be installed
+ on modern UNIX-like systems, specifically on Linux.
+ https://www.gnu.org/software/libiconv/
+ ICU: Mainly used by Chromium on Windows. Unnecessary on most
+ systems.
Daniel
veillard@redhat.com
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
+SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
-DIST_SUBDIRS = include . doc example python xstc
+DIST_SUBDIRS = include . doc example fuzz python xstc
AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
$(CHECKER) ./runxmlconf$(EXEEXT)
@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
$(MAKE) tests ; fi)
+ @cd fuzz; $(MAKE) tests
check: all runtests
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
echo New test file $$name ; \
- $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
+ $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name 2> $(srcdir)/result/regexp/$$name.err ; \
+ if [ ! -s "$(srcdir)/result/regexp/$$name.err" ] ; then rm $(srcdir)/result/regexp/$$name.err; fi ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
- log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
+ log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i > result.$$name 2> error.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
- diff $(srcdir)/result/regexp/$$name result.$$name` ; \
- if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
- rm result.$$name ; \
+ diff $(srcdir)/result/regexp/$$name result.$$name ; \
+ if [ -s "$(srcdir)/result/regexp/$$name.err" -o -s "error.$$name" ] ; then diff $(srcdir)/result/regexp/$$name.err error.$$name ; fi` ; \
+ if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
+ rm result.$$name error.$$name ; \
fi ; fi ; done)
# Disabled for now
Exptests: testRegexp$(EXEEXT)
- @echo "## Formal expresssions regression tests"
+ @echo "## Formal expressions regression tests"
-@(for i in $(srcdir)/test/expr/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
dbgen.pl dbgenattr.pl regressions.py regressions.xml \
README.tests Makefile.tests libxml2.syms timsort.h \
README.zOS \
+ CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \
$(CVS_EXTRA_DIST)
#
-# You may have to ajust to call the right compiler, or other oprions
+# You may have to adjust to call the right compiler, or other options
# for compiling and linking
#
There is 3 standalone tools runtest.c runsuite.c testapi.c, which
should compile as part of the build or as any application would.
Launch them from this directory to get results, runtest checks
- the proper functionning of libxml2 main APIs while testapi does
+ the proper functioning of libxml2 main APIs while testapi does
a full coverage check. Report failures to the list.
To report bugs, follow the instructions at:
} else {
ret = xmlGetDocEntity(ctxt->myDoc, name);
}
- if ((ret != NULL) &&
- ((ctxt->validate) || (ctxt->replaceEntities)) &&
- (ret->children == NULL) &&
- (ret->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
- int val;
-
- /*
- * for validation purposes we really need to fetch and
- * parse the external entity
- */
- xmlNodePtr children;
- unsigned long oldnbent = ctxt->nbentities;
-
- val = xmlParseCtxtExternalEntity(ctxt, ret->URI,
- ret->ExternalID, &children);
- if (val == 0) {
- xmlAddChildList((xmlNodePtr) ret, children);
- } else {
- xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
- "Failure to process entity %s\n", name, NULL);
- ctxt->validate = 0;
- return(NULL);
- }
- ret->owner = 1;
- if (ret->checked == 0) {
- ret->checked = (ctxt->nbentities - oldnbent + 1) * 2;
- if ((ret->content != NULL) && (xmlStrchr(ret->content, '<')))
- ret->checked |= 1;
- }
- }
return(ret);
}
}
}
- /*
- * Insert all the defaulted attributes from the DTD especially namespaces
- */
- if ((!ctxt->html) &&
- ((ctxt->myDoc->intSubset != NULL) ||
- (ctxt->myDoc->extSubset != NULL))) {
- xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
- }
+ if (!ctxt->html) {
+ /*
+ * Insert all the defaulted attributes from the DTD especially
+ * namespaces
+ */
+ if ((ctxt->myDoc->intSubset != NULL) ||
+ (ctxt->myDoc->extSubset != NULL)) {
+ xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
+ }
- /*
- * process all the attributes whose name start with "xmlns"
- */
- if (atts != NULL) {
- i = 0;
- att = atts[i++];
- value = atts[i++];
- if (!ctxt->html) {
+ /*
+ * process all the attributes whose name start with "xmlns"
+ */
+ if (atts != NULL) {
+ i = 0;
+ att = atts[i++];
+ value = atts[i++];
while ((att != NULL) && (value != NULL)) {
if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
(att[3] == 'n') && (att[4] == 's'))
att = atts[i++];
value = atts[i++];
}
- }
- }
+ }
- /*
- * Search the namespace, note that since the attributes have been
- * processed, the local namespaces are available.
- */
- ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
- if ((ns == NULL) && (parent != NULL))
- ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
- if ((prefix != NULL) && (ns == NULL)) {
- ns = xmlNewNs(ret, NULL, prefix);
- xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
- "Namespace prefix %s is not defined\n",
- prefix, NULL);
- }
+ /*
+ * Search the namespace, note that since the attributes have been
+ * processed, the local namespaces are available.
+ */
+ ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
+ if ((ns == NULL) && (parent != NULL))
+ ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
+ if ((prefix != NULL) && (ns == NULL)) {
+ ns = xmlNewNs(ret, NULL, prefix);
+ xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
+ "Namespace prefix %s is not defined\n",
+ prefix, NULL);
+ }
- /*
- * set the namespace node, making sure that if the default namespace
- * is unbound on a parent we simply keep it NULL
- */
- if ((ns != NULL) && (ns->href != NULL) &&
- ((ns->href[0] != 0) || (ns->prefix != NULL)))
- xmlSetNs(ret, ns);
+ /*
+ * set the namespace node, making sure that if the default namespace
+ * is unbound on a parent we simply keep it NULL
+ */
+ if ((ns != NULL) && (ns->href != NULL) &&
+ ((ns->href[0] != 0) || (ns->prefix != NULL)))
+ xmlSetNs(ret, ns);
+ }
/*
* process all the other attributes
* attribute values.
*
* SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
+ * It provides the namespace information for the element, as well as
* the new namespace declarations on the element.
*/
void
* @URI: the element namespace name if available
*
* SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
+ * It provides the namespace information for the element.
*/
void
xmlSAX2EndElementNs(void *ctx,
}
/**
- * xmlSAX2Characters:
+ * xmlSAX2Text:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
* @len: the number of xmlChar
+ * @type: text or cdata
*
- * receiving some chars from the parser.
+ * Append characters.
*/
-void
-xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
+static void
+xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
+ xmlElementType type)
{
- xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr lastChild;
- if (ctx == NULL) return;
+ if (ctxt == NULL) return;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.xmlSAX2Characters(%.30s, %d)\n", ch, len);
* elements. Use an attribute in the structure !!!
*/
if (lastChild == NULL) {
- lastChild = xmlSAX2TextNode(ctxt, ch, len);
+ if (type == XML_TEXT_NODE)
+ lastChild = xmlSAX2TextNode(ctxt, ch, len);
+ else
+ lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
if (lastChild != NULL) {
ctxt->node->children = lastChild;
ctxt->node->last = lastChild;
}
} else {
int coalesceText = (lastChild != NULL) &&
- (lastChild->type == XML_TEXT_NODE) &&
- (lastChild->name == xmlStringText);
+ (lastChild->type == type) &&
+ ((type != XML_TEXT_NODE) ||
+ (lastChild->name == xmlStringText));
if ((coalesceText) && (ctxt->nodemem != 0)) {
/*
* The whole point of maintaining nodelen and nodemem,
}
} else {
/* Mixed content, first time */
- lastChild = xmlSAX2TextNode(ctxt, ch, len);
+ if (type == XML_TEXT_NODE)
+ lastChild = xmlSAX2TextNode(ctxt, ch, len);
+ else
+ lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
if (lastChild != NULL) {
xmlAddChild(ctxt->node, lastChild);
if (ctxt->node->children != NULL) {
}
/**
+ * xmlSAX2Characters:
+ * @ctx: the user data (XML parser context)
+ * @ch: a xmlChar string
+ * @len: the number of xmlChar
+ *
+ * receiving some chars from the parser.
+ */
+void
+xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
+{
+ xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
+}
+
+/**
* xmlSAX2IgnorableWhitespace:
* @ctx: the user data (XML parser context)
* @ch: a xmlChar string
void
xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
{
- xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
- xmlNodePtr ret, lastChild;
-
- if (ctx == NULL) return;
-#ifdef DEBUG_SAX
- xmlGenericError(xmlGenericErrorContext,
- "SAX.pcdata(%.10s, %d)\n", value, len);
-#endif
- lastChild = xmlGetLastChild(ctxt->node);
-#ifdef DEBUG_SAX_TREE
- xmlGenericError(xmlGenericErrorContext,
- "add chars to %s \n", ctxt->node->name);
-#endif
- if ((lastChild != NULL) &&
- (lastChild->type == XML_CDATA_SECTION_NODE)) {
- xmlTextConcat(lastChild, value, len);
- } else {
- ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
- if (xmlAddChild(ctxt->node, ret) == NULL)
- xmlFreeNode(ret);
- }
+ xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
}
static int xmlSAX2DefaultVersionValue = 2;
by the XML parser, UTF-8 should be checked when there is no "encoding"
declared !
- Support for UTF-8 and UTF-16 encoding
- => added some convertion routines provided by Martin Durst
+ => added some conversion routines provided by Martin Durst
patched them, got fixes from @@@
I plan to keep everything internally as UTF-8 (or ISO-Latin-X)
this is slightly more costly but more compact, and recent processors
is enabled, tested the ISO->UTF-8 stuff
- External entities loading:
- allow override by client code
- - make sure it is alled for all external entities referenced
+ - make sure it is called for all external entities referenced
Done, client code should use xmlSetExternalEntityLoader() to set
the default loading routine. It will be called each time an external
entity entity resolution is triggered.
most cases !
- progressive reading. The entity support is a first step toward
- asbtraction of an input stream. A large part of the context is still
- located on the stack, moving to a state machine and putting everyting
+ abstraction of an input stream. A large part of the context is still
+ located on the stack, moving to a state machine and putting everything
in the parsing context should provide an adequate solution.
=> Rather than progressive parsing, give more power to the SAX-like
interface. Currently the DOM-like representation is built but
The template files used to generate all makefiles are only two:\r
- libxml2.bkl (the main one)\r
- Bakefiles.bkgen\r
- All the other files can be dinamically regenerated.\r
+ All the other files can be dynamically regenerated.\r
\r
\r
\r
/**
* xmlBufMemoryError:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
* To be improved...
/**
* xmlBufOverflowError:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a buffer overflow error
* To be improved...
* Keep the buffer but provide a truncated size value.
*/
xmlBufOverflowError(buf, "Allocated size too big for xmlBuffer");
+ ret->use = (int) buf->use;
ret->size = INT_MAX;
+ } else {
+ ret->use = (int) buf->use;
+ ret->size = (int) buf->size;
}
- ret->use = (int) buf->use;
- ret->size = (int) buf->size;
ret->alloc = buf->alloc;
ret->content = buf->content;
ret->contentIO = buf->contentIO;
int
xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
size_t base, size_t cur) {
- if ((input == NULL) || (buf == NULL) || (buf->error))
+ if (input == NULL)
return(-1);
+ if ((buf == NULL) || (buf->error)) {
+ input->base = input->cur = input->end = BAD_CAST "";
+ return(-1);
+ }
CHECK_COMPAT(buf)
input->base = &buf->content[base];
input->cur = input->base + cur;
/**
* xmlC14NErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of memory error
*/
/**
* xmlC14NErrParam:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of param error
*/
/**
* xmlC14NErrInternal:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of internal error
*/
/**
* xmlC14NErrInvalidNode:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of invalid node error
*/
/**
* xmlC14NErrUnknownNode:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of unknown node error
*/
/**
* xmlC14NErrRelativeNamespace:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of relative namespace error
*/
* @node: the context node
* @error: the error code
* @msg: the message
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
}
ret = xmlBufUse(buf->buffer);
- if (ret > 0) {
+ if (ret >= 0) {
*doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret);
}
(void) xmlOutputBufferClose(buf);
- if ((*doc_txt_ptr == NULL) && (ret > 0)) {
- xmlC14NErrMemory("coping canonicalized document");
+ if ((*doc_txt_ptr == NULL) && (ret >= 0)) {
+ xmlC14NErrMemory("copying canonicalized document");
return (-1);
}
return (ret);
/**
* xmlCatalogErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* @catal: the Catalog entry
* @node: the context node
* @msg: the error message
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a catalog error
*/
xmlBufResetInput(buf->buffer, inputStream);
inputPush(ctxt, inputStream);
- if ((ctxt->directory == NULL) && (directory == NULL))
+ if (ctxt->directory == NULL)
directory = xmlParserGetDirectory(filename);
if ((ctxt->directory == NULL) && (directory != NULL))
ctxt->directory = directory;
ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
if (ret != NULL) {
break;
- } else if ((catal->children != NULL) &&
- (catal->children->depth > MAX_CATAL_DEPTH)) {
+ } else if (catal->children->depth > MAX_CATAL_DEPTH) {
ret = NULL;
break;
}
xmlCatalogEntryType type = XML_CATA_NONE;
cur = xmlParseSGMLCatalogName(cur, &name);
- if (name == NULL) {
+ if (cur == NULL || name == NULL) {
/* error */
break;
}
while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur)))
cur++;
path = xmlStrndup((const xmlChar *)paths, cur - paths);
+ if (path != NULL) {
#ifdef _WIN32
iLen = strlen((const char*)path);
for(i = 0; i < iLen; i++) {
}
}
#endif
- if (path != NULL) {
xmlLoadCatalog((const char *) path);
xmlFree(path);
}
(xmlStrEqual(type, BAD_CAST "catalog"))) {
xmlDefaultCatalog = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
xmlCatalogDefaultPrefer);
- xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
+ if (xmlDefaultCatalog != NULL) {
+ xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
orig, NULL, xmlCatalogDefaultPrefer, NULL);
-
+ }
xmlRMutexUnlock(xmlCatalogMutex);
return(0);
}
--- /dev/null
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if __attribute__((destructor)) is accepted */
+#cmakedefine ATTRIBUTE_DESTRUCTOR 1
+
+/* Type cast for the gethostbyname() argument */
+#cmakedefine GETHOSTBYNAME_ARG_CAST @GETHOSTBYNAME_ARG_CAST@
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#cmakedefine HAVE_ARPA_NAMESER_H 1
+
+/* Whether struct sockaddr::__ss_family exists */
+#cmakedefine HAVE_BROKEN_SS_FAMILY 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#cmakedefine HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#cmakedefine HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H 1
+
+/* Have dlopen based dso */
+#cmakedefine HAVE_DLOPEN 1
+
+/* Define to 1 if you have the <dl.h> header file. */
+#cmakedefine HAVE_DL_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#cmakedefine HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#cmakedefine HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `fprintf' function. */
+#cmakedefine HAVE_FPRINTF 1
+
+/* Define to 1 if you have the `ftime' function. */
+#cmakedefine HAVE_FTIME 1
+
+/* Define if getaddrinfo is there */
+#cmakedefine HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isascii' function. */
+#cmakedefine HAVE_ISASCII 1
+
+/* Define if isinf is there */
+#cmakedefine HAVE_ISINF 1
+
+/* Define if isnan is there */
+#cmakedefine HAVE_ISNAN 1
+
+/* Define if history library is there (-lhistory) */
+#cmakedefine HAVE_LIBHISTORY 1
+
+/* Define if pthread library is there (-lpthread) */
+#cmakedefine HAVE_LIBPTHREAD 1
+
+/* Define if readline library is there (-lreadline) */
+#cmakedefine HAVE_LIBREADLINE 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#cmakedefine HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `localtime' function. */
+#cmakedefine HAVE_LOCALTIME 1
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#cmakedefine HAVE_LZMA_H 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#cmakedefine HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <math.h> header file. */
+#cmakedefine HAVE_MATH_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mmap' function. */
+#cmakedefine HAVE_MMAP 1
+
+/* Define to 1 if you have the `munmap' function. */
+#cmakedefine HAVE_MUNMAP 1
+
+/* mmap() is no good without munmap() */
+#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
+# undef /**/ HAVE_MMAP
+#endif
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#cmakedefine HAVE_NDIR_H 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#cmakedefine HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#cmakedefine HAVE_POLL_H 1
+
+/* Define to 1 if you have the `printf' function. */
+#cmakedefine HAVE_PRINTF 1
+
+/* Define if <pthread.h> is there */
+#cmakedefine HAVE_PTHREAD_H 1
+
+/* Define to 1 if you have the `putenv' function. */
+#cmakedefine HAVE_PUTENV 1
+
+/* Define to 1 if you have the `rand' function. */
+#cmakedefine HAVE_RAND 1
+
+/* Define to 1 if you have the `rand_r' function. */
+#cmakedefine HAVE_RAND_R 1
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#cmakedefine HAVE_RESOLV_H 1
+
+/* Have shl_load based dso */
+#cmakedefine HAVE_SHLLOAD 1
+
+/* Define to 1 if you have the `signal' function. */
+#cmakedefine HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#cmakedefine HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#cmakedefine HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `sprintf' function. */
+#cmakedefine HAVE_SPRINTF 1
+
+/* Define to 1 if you have the `srand' function. */
+#cmakedefine HAVE_SRAND 1
+
+/* Define to 1 if you have the `sscanf' function. */
+#cmakedefine HAVE_SSCANF 1
+
+/* Define to 1 if you have the `stat' function. */
+#cmakedefine HAVE_STAT 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#cmakedefine HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strftime' function. */
+#cmakedefine HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#cmakedefine HAVE_SYS_DIR_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#cmakedefine HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#cmakedefine HAVE_SYS_NDIR_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#cmakedefine HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#cmakedefine HAVE_SYS_TIMEB_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `time' function. */
+#cmakedefine HAVE_TIME 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#cmakedefine HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Whether va_copy() is available */
+#cmakedefine HAVE_VA_COPY 1
+
+/* Define to 1 if you have the `vfprintf' function. */
+#cmakedefine HAVE_VFPRINTF 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#cmakedefine HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `vsprintf' function. */
+#cmakedefine HAVE_VSPRINTF 1
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#cmakedefine HAVE_ZLIB_H 1
+
+/* Whether __va_copy() is available */
+#cmakedefine HAVE___VA_COPY 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST @ICONV_CONST@
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#cmakedefine LT_OBJDIR "@LT_OBJDIR@"
+
+/* Name of package */
+#define PACKAGE "@PACKAGE@"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "@PACKAGE_NAME@"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "@PACKAGE_STRING@"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "@PACKAGE_URL@"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "@PACKAGE_VERSION@"
+
+/* Type cast for the send() function 2nd arg */
+#cmakedefine SEND_ARG2_CAST @SEND_ARG2_CAST@
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine STDC_HEADERS 1
+
+/* Support for IPv6 */
+#cmakedefine SUPPORT_IP6 1
+
+/* Define if va_list is an array type */
+#cmakedefine VA_LIST_IS_ARRAY 1
+
+/* Version number of package */
+#cmakedefine VERSION "@VERSION@"
+
+/* Determine what socket length (socklen_t) data type is */
+#cmakedefine XML_SOCKLEN_T @XML_SOCKLEN_T@
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#cmakedefine _UINT32_T @_UINT32_T@
+
+/* ss_family is not defined here, use __ss_family instead */
+#cmakedefine ss_family @ss_family@
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#cmakedefine uint32_t @uint32_t@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
-AC_INIT
+
+m4_define([MAJOR_VERSION], 2)
+m4_define([MINOR_VERSION], 9)
+m4_define([MICRO_VERSION], 11)
+
+AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
AC_CONFIG_SRCDIR([entities.c])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE([enable])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
-LIBXML_MAJOR_VERSION=2
-LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=10
+LIBXML_MAJOR_VERSION=MAJOR_VERSION
+LIBXML_MINOR_VERSION=MINOR_VERSION
+LIBXML_MICRO_VERSION=MICRO_VERSION
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
VERSION=${LIBXML_VERSION}
-AM_INIT_AUTOMAKE(libxml2, $VERSION)
+AM_INIT_AUTOMAKE([foreign])
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
[Type cast for the send() function 2nd arg])
fi
+dnl Checking whether __attribute__((destructor)) is accepted by the compiler
+AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
+AC_TRY_COMPILE2([
+void __attribute__((destructor))
+f(void) {}], [], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
+ AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
+ AC_MSG_RESULT(no)])
+
+
dnl ***********************Checking for availability of IPv6*******************
AC_MSG_CHECKING([whether to enable IPv6])
# warnings we'd like to see
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
- # warnings we'd like to supress
+ # warnings we'd like to suppress
EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long -Wno-format-extra-args"
case "${host}" in
alpha*-*-linux* )
AC_CHECK_HEADER(unicode/ucnv.h,
AC_MSG_CHECKING(for icu)
- AC_TRY_LINK([#include <unicode/ucnv.h>],[
- UConverter *utf = ucnv_open("UTF-8", NULL);],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
+ UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
AC_MSG_RESULT(yes)
have_libicu=yes],[
AC_MSG_RESULT(no)
LDFLAGS="${LDFLAGS} ${ICU_LIBS}"
LIBS="${LIBS} -licucore"
- AC_TRY_LINK([#include <unicode/ucnv.h>],[
- UConverter *utf = ucnv_open("UTF-8", NULL);],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
+ UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
AC_MSG_RESULT(yes)
have_libicu=yes
ICU_LIBS="${ICU_LIBS} -licucore"
dnl
dnl Also *win32*config.h files redefine them for various MSC compilers.
dnl
-dnl So do not redefine {v}snprintf to _{v}snprintf like follwing:
+dnl So do not redefine {v}snprintf to _{v}snprintf like following:
dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
dnl and do not redefine those functions is C-source files.
ln -s $srcdir/Copyright COPYING
# keep on one line for cygwin c.f. #130896
-AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
+AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
AC_OUTPUT
* @output: the FILE * for the output
* @str: the string
*
- * Dumps informations about the string, shorten it if necessary
+ * Dumps information about the string, shorten it if necessary
*/
void
xmlDebugDumpString(FILE * output, const xmlChar * str)
* @node2: unused
*
* Implements the XML shell function "grep"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
*
* Returns 0
*/
* @node2: unused
*
* Implements the XML shell function "dir"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
*
* Returns 0
*/
* @node2: unused
*
* Implements the XML shell function "dir"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
*
* Returns 0
*/
fprintf(ctxt->output, "\tbye leave shell\n");
fprintf(ctxt->output, "\tcat [node] display node or current node\n");
fprintf(ctxt->output, "\tcd [path] change directory to path or to root\n");
- fprintf(ctxt->output, "\tdir [path] dumps informations about the node (namespace, attributes, content)\n");
+ fprintf(ctxt->output, "\tdir [path] dumps information about the node (namespace, attributes, content)\n");
fprintf(ctxt->output, "\tdu [path] show the structure of the subtree under path or the current node\n");
fprintf(ctxt->output, "\texit leave shell\n");
fprintf(ctxt->output, "\thelp display this help\n");
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
* Author: daniel@veillard.com
unsigned long value = seed;
if (name == NULL) return(0);
- value = *name;
+ value += *name;
value <<= 5;
if (namelen > 10) {
value += name[namelen - 1];
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
</dd><dt>CVS</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a><br />
</dd><dt>CWD</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPCwd">xmlNanoFTPCwd</a><br />
</dd><dt>Cache</dt><dd><a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
-</dd><dt>Call</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
+</dd><dt>Call</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
<a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
</dd><dt>Callback</dt><dd><a href="html/libxml-SAX.html#externalSubset">externalSubset</a><br />
<a href="html/libxml-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a><br />
<a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
<a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
<a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
<a href="html/libxml-parserInternals.html#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a><br />
</dd><dt>bad</dt><dd><a href="html/libxml-parserInternals.html#XML_MAX_LOOKUP_LIMIT">XML_MAX_LOOKUP_LIMIT</a><br />
</dd><dt>badly</dt><dd><a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
-</dd><dt>bahaviour</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
</dd><dt>balanced</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
<a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
</dd><dt>basis</dt><dd><a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</dd><dt>bear</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
</dd><dt>becomes</dt><dd><a href="html/libxml-valid.html#xmlAddAttributeDecl">xmlAddAttributeDecl</a><br />
-</dd><dt>before</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
+</dd><dt>before</dt><dd><a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
<a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
<a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
<a href="html/libxml-tree.html#xmlNodeGetSpacePreserve">xmlNodeGetSpacePreserve</a><br />
<a href="html/libxml-tree.html#xmlNodeSetSpacePreserve">xmlNodeSetSpacePreserve</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2ResolveEntity">xmlSAX2ResolveEntity</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strsize">xmlUTF8Strsize</a><br />
</dd><dt>below</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
</dd><dt>bits</dt><dd><a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br />
</dd><dt>blanks</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
<a href="html/libxml-parserInternals.html#xmlSkipBlankChars">xmlSkipBlankChars</a><br />
-</dd><dt>bloc</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
-<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
-<a href="html/libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a><br />
</dd><dt>blockDefault</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION">XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION">XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION">XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION</a><br />
</dd><dt>caching:</dt><dd><a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
</dd><dt>calculated</dt><dd><a href="html/libxml-xmlstring.html#xmlStrncatNew">xmlStrncatNew</a><br />
</dd><dt>calculates</dt><dd><a href="html/libxml-xmlstring.html#xmlUTF8Size">xmlUTF8Size</a><br />
-</dd><dt>calling</dt><dd><a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
+</dd><dt>calling</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
<a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
<a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
<a href="html/libxml-xmlIO.html#xmlCheckFilename">xmlCheckFilename</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathCeilingFunction">xmlXPathCeilingFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathFloorFunction">xmlXPathFloorFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathRoundFunction">xmlXPathRoundFunction</a><br />
-</dd><dt>closing</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a><br />
+</dd><dt>closing</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
</dd><dt>codes</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
</dd><dt>compiled-in</dt><dd><a href="html/libxml-xmlIO.html#xmlCleanupInputCallbacks">xmlCleanupInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlCleanupOutputCallbacks">xmlCleanupOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a><br />
</dd><dt>compiling</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNodeSetContains">xmlXPathNodeSetContains</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
<a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
-</dd><dt>content:</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathEqualValues">xmlXPathEqualValues</a><br />
+</dd><dt>content:</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathEqualValues">xmlXPathEqualValues</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNotEqualValues">xmlXPathNotEqualValues</a><br />
</dd><dt>contentType</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a><br />
<a href="html/libxml-nanoftp.html#xmlNanoFTPConnectTo">xmlNanoFTPConnectTo</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2ResolveEntity">xmlSAX2ResolveEntity</a><br />
</dd><dt>conveniently</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
+</dd><dt>convention</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
</dd><dt>conversion</dt><dd><a href="html/libxml-encoding.html#_uconv_t">_uconv_t</a><br />
<a href="html/libxml-xpath.html#_xmlXPathType">_xmlXPathType</a><br />
<a href="html/libxml-encoding.html#xmlCharEncOutFunc">xmlCharEncOutFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderStandalone">xmlTextReaderStandalone</a><br />
<a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
+</dd><dt>declares</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
</dd><dt>declaring</dt><dd><a href="html/libxml-valid.html#xmlGetID">xmlGetID</a><br />
</dd><dt>decode</dt><dd><a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
</dd><dt>def</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeListDecl">xmlParseAttributeListDecl</a><br />
<a href="html/libxml-tree.html#xmlLastElementChild">xmlLastElementChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNextElementSibling">xmlNextElementSibling</a><br />
<a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
<a href="html/libxml-tree.html#xmlPreviousElementSibling">xmlPreviousElementSibling</a><br />
</dd><dt>escaped</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
<a href="html/libxml-pattern.html#xmlStreamPushNode">xmlStreamPushNode</a><br />
</dd><dt>explicitly</dt><dd><a href="html/libxml-SAX2.html#xmlSAXDefaultVersion">xmlSAXDefaultVersion</a><br />
</dd><dt>explored</dt><dd><a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
+</dd><dt>exportable</dt><dd><a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
+</dd><dt>exported</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
</dd><dt>exposing</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a><br />
</dd><dt>express</dt><dd><a href="html/libxml-tree.html#LIBXML2_NEW_BUFFER">LIBXML2_NEW_BUFFER</a><br />
</dd><dt>expressing</dt><dd><a href="html/libxml-uri.html#xmlPathToURI">xmlPathToURI</a><br />
<a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaIsValid">xmlSchemaIsValid</a><br />
</dd><dt>fashion</dt><dd><a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
-</dd><dt>fast</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
</dd><dt>faster</dt><dd><a href="html/libxml-HTMLparser.html#htmlNodeStatus">htmlNodeStatus</a><br />
<a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
</dd><dt>fatal</dt><dd><a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputMatchCallback">xmlOutputMatchCallback</a><br />
<a href="html/libxml-xpath.html#xmlXPathNodeSetGetLength">xmlXPathNodeSetGetLength</a><br />
<a href="html/libxml-xpath.html#xmlXPathNodeSetItem">xmlXPathNodeSetItem</a><br />
-</dd><dt>functions</dt><dd><a href="html/libxml-HTMLparser.html#htmlCtxtReadIO">htmlCtxtReadIO</a><br />
+</dd><dt>functions</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-HTMLparser.html#htmlCtxtReadIO">htmlCtxtReadIO</a><br />
<a href="html/libxml-HTMLparser.html#htmlReadIO">htmlReadIO</a><br />
<a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
<a href="html/libxml-parser.html#xmlCtxtReadIO">xmlCtxtReadIO</a><br />
<a href="html/libxml-HTMLparser.html#htmlReadMemory">htmlReadMemory</a><br />
</dd><dt>htmlStartClose</dt><dd><a href="html/libxml-HTMLparser.html#htmlAutoCloseTag">htmlAutoCloseTag</a><br />
<a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
-</dd><dt>htmlStartCloseIndex</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
</dd><dt>http:</dt><dd><a href="html/libxml-xinclude.html#XINCLUDE_NS">XINCLUDE_NS</a><br />
<a href="html/libxml-xinclude.html#XINCLUDE_OLD_NS">XINCLUDE_OLD_NS</a><br />
<a href="html/libxml-SAX.html#getSystemId">getSystemId</a><br />
<a href="html/libxml-parser.html#xmlSAXParseMemory">xmlSAXParseMemory</a><br />
<a href="html/libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a><br />
<a href="html/libxml-parser.html#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a><br />
-</dd><dt>incase</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPClose">xmlNanoFTPClose</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCloseConnection">xmlNanoFTPCloseConnection</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCwd">xmlNanoFTPCwd</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPDele">xmlNanoFTPDele</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPGet">xmlNanoFTPGet</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPGetConnection">xmlNanoFTPGetConnection</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPList">xmlNanoFTPList</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPSave">xmlNanoHTTPSave</a><br />
</dd><dt>incl</dt><dd><a href="html/libxml-schemasInternals.html#_xmlSchemaType">_xmlSchemaType</a><br />
</dd><dt>include</dt><dd><a href="html/libxml-xinclude.html#XINCLUDE_NODE">XINCLUDE_NODE</a><br />
<a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
<a href="html/libxml-xmlIO.html#xmlCleanupInputCallbacks">xmlCleanupInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlCleanupOutputCallbacks">xmlCleanupOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessFlags">xmlXIncludeProcessFlags</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessFlagsData">xmlXIncludeProcessFlagsData</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessTreeFlags">xmlXIncludeProcessTreeFlags</a><br />
<a href="html/libxml-parser.html#xmlParserFindNodeInfo">xmlParserFindNodeInfo</a><br />
<a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
<a href="html/libxml-xmlmemory.html#xmlReallocLoc">xmlReallocLoc</a><br />
-</dd><dt>information</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a><br />
-<a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpAttr">xmlDebugDumpAttr</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpAttrList">xmlDebugDumpAttrList</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDTD">xmlDebugDumpDTD</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDocument">xmlDebugDumpDocument</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDocumentHead">xmlDebugDumpDocumentHead</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpEntities">xmlDebugDumpEntities</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpNode">xmlDebugDumpNode</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpNodeList">xmlDebugDumpNodeList</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpOneNode">xmlDebugDumpOneNode</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPUpdateURL">xmlNanoFTPUpdateURL</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethodRedir">xmlNanoHTTPMethodRedir</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPOpen">xmlNanoHTTPOpen</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPOpenRedir">xmlNanoHTTPOpenRedir</a><br />
-<a href="html/libxml-xmlreader.html#xmlNewTextReader">xmlNewTextReader</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaGetParserErrors">xmlSchemaGetParserErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateSetFilename">xmlSchemaValidateSetFilename</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateSetLocator">xmlSchemaValidateSetLocator</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a><br />
-<a href="html/libxml-xmlreader.html#xmlTextReaderByteConsumed">xmlTextReaderByteConsumed</a><br />
-<a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
-</dd><dt>informations</dt><dd><a href="html/libxml-tree.html#_xmlAttr">_xmlAttr</a><br />
-<a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
-<a href="html/libxml-tree.html#_xmlNode">_xmlNode</a><br />
-<a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
-<a href="html/libxml-parser.html#endElementNsSAX2Func">endElementNsSAX2Func</a><br />
-<a href="html/libxml-parser.html#startElementNsSAX2Func">startElementNsSAX2Func</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpString">xmlDebugDumpString</a><br />
-<a href="html/libxml-parserInternals.html#xmlErrMemory">xmlErrMemory</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPInit">xmlNanoFTPInit</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPProxy">xmlNanoFTPProxy</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPScanProxy">xmlNanoFTPScanProxy</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPInit">xmlNanoHTTPInit</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPScanProxy">xmlNanoHTTPScanProxy</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserPrintFileInfo">xmlParserPrintFileInfo</a><br />
-<a href="html/libxml-xmlregexp.html#xmlRegExecErrInfo">xmlRegExecErrInfo</a><br />
-<a href="html/libxml-xmlregexp.html#xmlRegExecNextValues">xmlRegExecNextValues</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxParserSetFlag">xmlRelaxParserSetFlag</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2EndElementNs">xmlSAX2EndElementNs</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2StartElementNs">xmlSAX2StartElementNs</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a><br />
-<a href="html/libxml-debugXML.html#xmlShellDir">xmlShellDir</a><br />
-<a href="html/libxml-xinclude.html#xmlXIncludeProcessNode">xmlXIncludeProcessNode</a><br />
</dd><dt>informative</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
</dd><dt>infos</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
</dd><dt>inherited</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
</dd><dt>multiple</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
<a href="html/libxml-parserInternals.html#xmlStringCurrentChar">xmlStringCurrentChar</a><br />
</dd><dt>multiply</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathMultValues">xmlXPathMultValues</a><br />
-</dd><dt>multithreaded</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
+</dd><dt>multithreaded</dt><dd><a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
<a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
</dd><dt>mutex</dt><dd><a href="html/libxml-dict.html#xmlDictCleanup">xmlDictCleanup</a><br />
<a href="html/libxml-tree.html#xmlNodeListGetString">xmlNodeListGetString</a><br />
<a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
<a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
+</dd><dt>EOF</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
</dd><dt>ETag</dt><dd><a href="html/libxml-HTMLparser.html#htmlParseElement">htmlParseElement</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElement">xmlParseElement</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEndTag">xmlParseEndTag</a><br />
</dd><dt>names</dt><dd><a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
<a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-schemasInternals.html#_xmlSchema">_xmlSchema</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
<a href="html/libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a><br />
<a href="html/libxml-hash.html#xmlHashAddEntry">xmlHashAddEntry</a><br />
<a href="html/libxml-hash.html#xmlHashScan3">xmlHashScan3</a><br />
</dd><dt>nice</dt><dd><a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
</dd><dt>nillable</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_NILLABLE">XML_SCHEMAS_ELEM_NILLABLE</a><br />
<a href="html/libxml-xmlregexp.html#xmlExpIsNillable">xmlExpIsNillable</a><br />
+</dd><dt>no-op</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
</dd><dt>nod</dt><dd><a href="html/libxml-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a><br />
</dd><dt>node-</dt><dd><a href="html/libxml-tree.html#_xmlDOMWrapCtxt">_xmlDOMWrapCtxt</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
<a href="html/libxml-hash.html#XML_CAST_FPTR">XML_CAST_FPTR</a><br />
<a href="html/libxml-schemasInternals.html#_xmlSchema">_xmlSchema</a><br />
<a href="html/libxml-schemasInternals.html#_xmlSchemaElement">_xmlSchemaElement</a><br />
+<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
<a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
<a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNormalizeFunction">xmlXPathNormalizeFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathStringLengthFunction">xmlXPathStringLengthFunction</a><br />
-</dd><dt>once</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
+</dd><dt>once</dt><dd><a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans2">xmlAutomataNewOnceTrans2</a><br />
<a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
<a href="html/libxml-entities.html#xmlEncodeEntities">xmlEncodeEntities</a><br />
</dd><dt>piece</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
</dd><dt>pieces</dt><dd><a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
<a href="html/libxml-parserInternals.html#xmlStringLenDecodeEntities">xmlStringLenDecodeEntities</a><br />
<a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
-</dd><dt>processed</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
-<a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
+</dd><dt>processed</dt><dd><a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
<a href="html/libxml-parser.html#startDocumentSAXFunc">startDocumentSAXFunc</a><br />
<a href="html/libxml-SAX.html#startElement">startElement</a><br />
<a href="html/libxml-parser.html#startElementSAXFunc">startElementSAXFunc</a><br />
</dd><dt>produce</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
<a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
<a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
-</dd><dt>produced</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
+</dd><dt>produced</dt><dd><a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
+<a href="html/libxml-encoding.html#isolat1ToUTF8">isolat1ToUTF8</a><br />
+<a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
<a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
</dd><dt>producing</dt><dd><a href="html/libxml-xmlstring.html#xmlCheckUTF8">xmlCheckUTF8</a><br />
</dd><dt>production:</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
</dd><dt>productions</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
</dd><dt>program</dt><dd><a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
-</dd><dt>programs</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
+</dd><dt>programs</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
</dd><dt>progressed</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
</dd><dt>progresses</dt><dd><a href="html/libxml-xmlregexp.html#xmlRegNewExecCtxt">xmlRegNewExecCtxt</a><br />
</dd><dt>progressive</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPRedir">xmlNanoHTTPRedir</a><br />
</dd><dt>redirection</dt><dd><a href="html/libxml-xmlIO.html#xmlCheckHTTPInput">xmlCheckHTTPInput</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPRedir">xmlNanoHTTPRedir</a><br />
-</dd><dt>reentrant</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-entities.html#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a><br />
+</dd><dt>reentrant</dt><dd><a href="html/libxml-entities.html#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a><br />
<a href="html/libxml-entities.html#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a><br />
<a href="html/libxml-threads.html#xmlFreeRMutex">xmlFreeRMutex</a><br />
<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
<a href="html/libxml-encoding.html#xmlGetCharEncodingHandler">xmlGetCharEncodingHandler</a><br />
<a href="html/libxml-xmlerror.html#xmlGetLastError">xmlGetLastError</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
<a href="html/libxml-xmlerror.html#xmlResetLastError">xmlResetLastError</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
<a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
<a href="html/libxml-debugXML.html#xmlShellSave">xmlShellSave</a><br />
</dd><dt>saved</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
+<a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
<a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
<a href="html/libxml-parser.html#xmlParserAddNodeInfo">xmlParserAddNodeInfo</a><br />
<a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeAddContent">xmlNodeAddContent</a><br />
<a href="html/libxml-tree.html#xmlNodeAddContentLen">xmlNodeAddContentLen</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeAddContent">xmlNodeAddContent</a><br />
<a href="html/libxml-tree.html#xmlNodeAddContentLen">xmlNodeAddContentLen</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
</dd><dt>switch</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
<a href="html/libxml-parserInternals.html#xmlParseReference">xmlParseReference</a><br />
<a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
-</dd><dt>symbol</dt><dd><a href="html/libxml-xmlmodule.html#xmlModuleSymbol">xmlModuleSymbol</a><br />
+</dd><dt>symbol</dt><dd><a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
+<a href="html/libxml-xmlmodule.html#xmlModuleSymbol">xmlModuleSymbol</a><br />
</dd><dt>synchronizing</dt><dd><a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
<a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
</dd><dt>syntax</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
</dd><dt>tags</dt><dd><a href="html/libxml-HTMLparser.html#htmlAutoCloseTag">htmlAutoCloseTag</a><br />
<a href="html/libxml-HTMLtree.html#htmlGetMetaEncoding">htmlGetMetaEncoding</a><br />
<a href="html/libxml-HTMLparser.html#htmlHandleOmittedElem">htmlHandleOmittedElem</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
<a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
<a href="html/libxml-HTMLtree.html#htmlSetMetaEncoding">htmlSetMetaEncoding</a><br />
</dd><dt>take</dt><dd><a href="html/libxml-threads.html#xmlLockLibrary">xmlLockLibrary</a><br />
<a href="html/libxml-parserInternals.html#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a><br />
<a href="html/libxml-parserInternals.html#xmlNamespaceParseQName">xmlNamespaceParseQName</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
-<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
<a href="html/libxml-tree.html#xmlSetTreeDoc">xmlSetTreeDoc</a><br />
</dd><dt>total</dt><dd><a href="html/libxml-xmlIO.html#_xmlOutputBuffer">_xmlOutputBuffer</a><br />
<a href="html/libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a><br />
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
</dd><dt>xmlEncodeSpecialChars</dt><dd><a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br />
-</dd><dt>xmlInitParser</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
+</dd><dt>xmlInitParser</dt><dd><a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
</dd><dt>xmlInitThreads</dt><dd><a href="html/libxml-threads.html#xmlInitThreads">xmlInitThreads</a><br />
</dd><dt>xmlInitializeCatalog</dt><dd><a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
</dd><dt>xmlInitializeGlobalState</dt><dd><a href="html/libxml-globals.html#xmlInitializeGlobalState">xmlInitializeGlobalState</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
</dd><dt>xmlNewMutex</dt><dd><a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
</dd><dt>xmlNewNode</dt><dd><a href="html/libxml-tree.html#xmlNewNodeEatName">xmlNewNodeEatName</a><br />
+</dd><dt>xmlNewProp</dt><dd><a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
</dd><dt>xmlNewTextChild</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
</dd><dt>xmlNewTextWriter</dt><dd><a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapCloneNode">xmlDOMWrapCloneNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaGetBuiltInType">xmlSchemaGetBuiltInType</a><br />
<a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
</dd><dt>Initialization</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
</dd><dt>Initialize</dt><dd><a href="html/libxml-SAX2.html#docbDefaultSAXHandlerInit">docbDefaultSAXHandlerInit</a><br />
<a href="html/libxml-SAX2.html#htmlDefaultSAXHandlerInit">htmlDefaultSAXHandlerInit</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
<a href="html/libxml-SAX.html#initdocbDefaultSAXHandler">initdocbDefaultSAXHandler</a><br />
<a href="html/libxml-SAX.html#inithtmlDefaultSAXHandler">inithtmlDefaultSAXHandler</a><br />
<a href="html/libxml-SAX.html#initxmlDefaultSAXHandler">initxmlDefaultSAXHandler</a><br />
<a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
<a href="html/libxml-list.html#xmlListRemoveFirst">xmlListRemoveFirst</a><br />
<a href="html/libxml-list.html#xmlListRemoveLast">xmlListRemoveLast</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-valid.html#xmlRemoveID">xmlRemoveID</a><br />
<a href="html/libxml-valid.html#xmlRemoveRef">xmlRemoveRef</a><br />
<a href="html/libxml-tree.html#xmlUnsetNsProp">xmlUnsetNsProp</a><br />
<a href="html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a><br />
<a href="html/libxml-xmlwriter.html#xmlTextWriterStartElementNS">xmlTextWriterStartElementNS</a><br />
<a href="html/libxml-xmlwriter.html#xmlTextWriterStartPI">xmlTextWriterStartPI</a><br />
+</dd><dt>Stops</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
</dd><dt>StringType</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
</dd><dt>Strings</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathStringLengthFunction">xmlXPathStringLengthFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
<a href="html/libxml-chvalid.html#xmlIsPubidChar">xmlIsPubidChar</a><br />
<a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
<a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
<a href="html/libxml-tree.html#xmlNewNodeEatName">xmlNewNodeEatName</a><br />
<a href="html/libxml-tree.html#xmlNewPI">xmlNewPI</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
<a href="html/libxml-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a><br />
<a href="html/libxml-parser.html#xmlSetFeature">xmlSetFeature</a><br />
<a href="html/libxml-parser.html#xmlSetupParserForBuffer">xmlSetupParserForBuffer</a><br />
+<a href="html/libxml-parser.html#xmlStartTag">xmlStartTag</a><br />
<a href="html/libxml-parser.html#xmlStopParser">xmlStopParser</a><br />
<a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</p><h2><a name="parserInternals" id="parserInternals">Module parserInternals</a>:</h2><p><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferPush">xmlParserInputBufferPush</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a><br />
<a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
<a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
</p><h2><a name="xmlmemory" id="xmlmemory">Module xmlmemory</a>:</h2><p><a href="html/libxml-xmlmemory.html#DEBUG_MEMORY">DEBUG_MEMORY</a><br />
<a href="html/libxml-xmlmemory.html#xmlCleanupMemory">xmlCleanupMemory</a><br />
<a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
<a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
<a href="html/libxml-tree.html#XML_ATTRIBUTE_CDATA">XML_ATTRIBUTE_CDATA</a><br />
<a href="html/libxml-tree.html#XML_ATTRIBUTE_DECL">XML_ATTRIBUTE_DECL</a><br />
<a href="html/libxml-globals.html#xmlPedanticParserDefaultValue">xmlPedanticParserDefaultValue</a><br />
<a href="html/libxml-parserInternals.html#xmlPopInput">xmlPopInput</a><br />
<a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
<a href="html/libxml-tree.html#xmlPreviousElementSibling">xmlPreviousElementSibling</a><br />
<a href="html/libxml-uri.html#xmlPrintURI">xmlPrintURI</a><br />
<a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
<a href="html/libxml-tree.html#xmlSplitQName2">xmlSplitQName2</a><br />
<a href="html/libxml-tree.html#xmlSplitQName3">xmlSplitQName3</a><br />
<a href="html/libxml-valid.html#xmlSprintfElementContent">xmlSprintfElementContent</a><br />
+<a href="html/libxml-parser.html#xmlStartTag">xmlStartTag</a><br />
<a href="html/libxml-parser.html#xmlStopParser">xmlStopParser</a><br />
<a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
<a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
"__declspec": (3, "Windows keyword"),
"__stdcall": (0, "Windows keyword"),
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
+ "ATTRIBUTE_DESTRUCTOR": (0, "macro keyword"),
"LIBEXSLT_PUBLIC": (0, "macro keyword"),
"X_IN_Y": (5, "macro function builder"),
"ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc checking extension"),
return((args, desc))
#
- # Parse a comment block and merge the informations found in the
+ # Parse a comment block and merge the information found in the
# parameters descriptions, finally returns a block as complete
# as possible
#
<h2>
<span class="refentrytitle">libxml2 API Modules</span>
</h2>
- <p><a href="libxml2-DOCBparser.html">DOCBparser</a> - old DocBook SGML parser<br/><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br/><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br/><a href="libxml2-SAX.html">SAX</a> - Old SAX version 1 handler, deprecated<br/><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br/><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br/><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br/><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br/><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br/><a href="libxml2-dict.html">dict</a> - string dictionary<br/><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br/><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br/><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br/><a href="libxml2-hash.html">hash</a> - Chained hash tables<br/><a href="libxml2-list.html">list</a> - lists interfaces<br/><a href="libxml2-nanoftp.html">nanoftp</a> - minimal FTP implementation<br/><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br/><a href="libxml2-parser.html">parser</a> - the core parser module<br/><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br/><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br/><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br/><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br/><a href="libxml2-schematron.html">schematron</a> - XML Schemastron implementation<br/><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br/><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br/><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br/><a href="libxml2-valid.html">valid</a> - The DTD validation<br/><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br/><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br/><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br/><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br/><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br/><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br/><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br/><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br/><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br/><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br/><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br/><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br/><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br/><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br/><a href="libxml2-xmlunicode.html">xmlunicode</a> - Unicode character APIs<br/><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version informations<br/><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br/><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br/><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br/><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br/></p>
+ <p><a href="libxml2-DOCBparser.html">DOCBparser</a> - old DocBook SGML parser<br/><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br/><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br/><a href="libxml2-SAX.html">SAX</a> - Old SAX version 1 handler, deprecated<br/><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br/><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br/><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br/><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br/><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br/><a href="libxml2-dict.html">dict</a> - string dictionary<br/><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br/><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br/><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br/><a href="libxml2-hash.html">hash</a> - Chained hash tables<br/><a href="libxml2-list.html">list</a> - lists interfaces<br/><a href="libxml2-nanoftp.html">nanoftp</a> - minimal FTP implementation<br/><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br/><a href="libxml2-parser.html">parser</a> - the core parser module<br/><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br/><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br/><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br/><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br/><a href="libxml2-schematron.html">schematron</a> - XML Schemastron implementation<br/><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br/><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br/><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br/><a href="libxml2-valid.html">valid</a> - The DTD validation<br/><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br/><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br/><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br/><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br/><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br/><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br/><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br/><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br/><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br/><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br/><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br/><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br/><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br/><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br/><a href="libxml2-xmlunicode.html">xmlunicode</a> - Unicode character APIs<br/><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version information<br/><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br/><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br/><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br/><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br/></p>
</body>
</html>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlDocContentDumpFormatOutput"/>htmlDocContentDumpFormatOutput ()</h3><pre class="programlisting">void htmlDocContentDumpFormatOutput (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br/> const char * encoding, <br/> int format)<br/>
</pre><p>Dump an HTML document.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlDocContentDumpOutput"/>htmlDocContentDumpOutput ()</h3><pre class="programlisting">void htmlDocContentDumpOutput (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br/> const char * encoding)<br/>
</pre><p>Dump an HTML document. Formatting return/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlDocDump"/>htmlDocDump ()</h3><pre class="programlisting">int htmlDocDump (FILE * f, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br/>
</pre><p>Dump an HTML document to an open FILE.</p>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlNodeDumpFormatOutput"/>htmlNodeDumpFormatOutput ()</h3><pre class="programlisting">void htmlNodeDumpFormatOutput (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br/> const char * encoding, <br/> int format)<br/>
</pre><p>Dump an HTML node, recursive behaviour,children are printed too.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlNodeDumpOutput"/>htmlNodeDumpOutput ()</h3><pre class="programlisting">void htmlNodeDumpOutput (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br/> const char * encoding)<br/>
</pre><p>Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlSaveFile"/>htmlSaveFile ()</h3><pre class="programlisting">int htmlSaveFile (const char * filename, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br/>
</pre><p>Dump an HTML document to a file. If @filename is "-" the stdout file is used.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSAX2EndElementNs"/>xmlSAX2EndElementNs ()</h3><pre class="programlisting">void xmlSAX2EndElementNs (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI)<br/>
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSAX2EntityDecl"/>xmlSAX2EntityDecl ()</h3><pre class="programlisting">void xmlSAX2EntityDecl (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> int type, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSAX2StartElementNs"/>xmlSAX2StartElementNs ()</h3><pre class="programlisting">void xmlSAX2StartElementNs (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br/> int nb_namespaces, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br/> int nb_attributes, <br/> int nb_defaulted, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br/>
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes.</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSAX2UnparsedEntityDecl"/>xmlSAX2UnparsedEntityDecl ()</h3><pre class="programlisting">void xmlSAX2UnparsedEntityDecl (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * notationName)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlDebugDumpString"/>xmlDebugDumpString ()</h3><pre class="programlisting">void xmlDebugDumpString (FILE * output, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str)<br/>
-</pre><p>Dumps informations about the string, shorten it if necessary</p>
+</pre><p>Dumps information about the string, shorten it if necessary</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlLsCountNode"/>xmlLsCountNode ()</h3><pre class="programlisting">int xmlLsCountNode (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlShellDir"/>xmlShellDir ()</h3><pre class="programlisting">int xmlShellDir (<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br/> char * arg, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br/>
-</pre><p>Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).</p>
+</pre><p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlShellDu"/>xmlShellDu ()</h3><pre class="programlisting">int xmlShellDu (<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br/> char * arg, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br/>
<hr/>
<div class="refsect2" lang="en"><h3><a name="UTF8Toisolat1"/>UTF8Toisolat1 ()</h3><pre class="programlisting">int UTF8Toisolat1 (unsigned char * out, <br/> int * outlen, <br/> const unsigned char * in, <br/> int * inlen)<br/>
</pre><p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="isolat1ToUTF8"/>isolat1ToUTF8 ()</h3><pre class="programlisting">int isolat1ToUTF8 (unsigned char * out, <br/> int * outlen, <br/> const unsigned char * in, <br/> int * inlen)<br/>
</pre><p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlAddEncodingAlias"/>xmlAddEncodingAlias ()</h3><pre class="programlisting">int xmlAddEncodingAlias (const char * name, <br/> const char * alias)<br/>
</pre><p>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number, or 0</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCleanup"/>xmlNanoFTPCleanup ()</h3><pre class="programlisting">void xmlNanoFTPCleanup (void)<br/>
-</pre><p>Cleanup the FTP protocol layer. This cleanup proxy informations.</p>
+</pre><p>Cleanup the FTP protocol layer. This cleanup proxy information.</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPClose"/>xmlNanoFTPClose ()</h3><pre class="programlisting">int xmlNanoFTPClose (void * ctx)<br/>
</pre><p>Close the connection and both control and transport</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCloseConnection"/>xmlNanoFTPCloseConnection ()</h3><pre class="programlisting">int xmlNanoFTPCloseConnection (void * ctx)<br/>
</pre><p>Close the data connection from the server</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnect"/>xmlNanoFTPConnect ()</h3><pre class="programlisting">int xmlNanoFTPConnect (void * ctx)<br/>
</pre><p>Tries to open a control connection</p>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCwd"/>xmlNanoFTPCwd ()</h3><pre class="programlisting">int xmlNanoFTPCwd (void * ctx, <br/> const char * directory)<br/>
</pre><p>Tries to change the remote directory</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPDele"/>xmlNanoFTPDele ()</h3><pre class="programlisting">int xmlNanoFTPDele (void * ctx, <br/> const char * file)<br/>
</pre><p>Tries to delete an item (file or directory) from server</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPFreeCtxt"/>xmlNanoFTPFreeCtxt ()</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt (void * ctx)<br/>
</pre><p>Frees the context after closing the connection.</p>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGet"/>xmlNanoFTPGet ()</h3><pre class="programlisting">int xmlNanoFTPGet (void * ctx, <br/> <a href="libxml2-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br/> void * userData, <br/> const char * filename)<br/>
</pre><p>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetConnection"/>xmlNanoFTPGetConnection ()</h3><pre class="programlisting"><a href="libxml2-nanoftp.html#SOCKET">SOCKET</a> xmlNanoFTPGetConnection (void * ctx)<br/>
</pre><p>Try to open a data connection to the server. Currently only passive mode is supported.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetResponse"/>xmlNanoFTPGetResponse ()</h3><pre class="programlisting">int xmlNanoFTPGetResponse (void * ctx)<br/>
</pre><p>Get the response from the FTP server after a command.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve (or NULL if path is in context).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or <0 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPInit"/>xmlNanoFTPInit ()</h3><pre class="programlisting">void xmlNanoFTPInit (void)<br/>
-</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p>
+</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPList"/>xmlNanoFTPList ()</h3><pre class="programlisting">int xmlNanoFTPList (void * ctx, <br/> <a href="libxml2-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br/> void * userData, <br/> const char * filename)<br/>
</pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPNewCtxt"/>xmlNanoFTPNewCtxt ()</h3><pre class="programlisting">void * xmlNanoFTPNewCtxt (const char * URL)<br/>
</pre><p>Allocate and initialize a new FTP context.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL to the resource</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context, or NULL</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPProxy"/>xmlNanoFTPProxy ()</h3><pre class="programlisting">void xmlNanoFTPProxy (const char * host, <br/> int port, <br/> const char * user, <br/> const char * passwd, <br/> int type)<br/>
-</pre><p>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
+</pre><p>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>host</tt></i>:</span></td><td>the proxy host name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the proxy port</td></tr><tr><td><span class="term"><i><tt>user</tt></i>:</span></td><td>the proxy user name</td></tr><tr><td><span class="term"><i><tt>passwd</tt></i>:</span></td><td>the proxy password</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the type of proxy 1 for using SITE, 2 for USER a@b</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPQuit"/>xmlNanoFTPQuit ()</h3><pre class="programlisting">int xmlNanoFTPQuit (void * ctx)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the FTP context</td></tr><tr><td><span class="term"><i><tt>dest</tt></i>:</span></td><td>a buffer</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the buffer length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPScanProxy"/>xmlNanoFTPScanProxy ()</h3><pre class="programlisting">void xmlNanoFTPScanProxy (const char * URL)<br/>
-</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoFTPUpdateURL"/>xmlNanoFTPUpdateURL ()</h3><pre class="programlisting">int xmlNanoFTPUpdateURL (void * ctx, <br/> const char * URL)<br/>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPFetch"/>xmlNanoHTTPFetch ()</h3><pre class="programlisting">int xmlNanoHTTPFetch (const char * URL, <br/> const char * filename, <br/> char ** contentType)<br/>
</pre><p>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPInit"/>xmlNanoHTTPInit ()</h3><pre class="programlisting">void xmlNanoHTTPInit (void)<br/>
-</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</p>
+</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy information</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPMethod"/>xmlNanoHTTPMethod ()</h3><pre class="programlisting">void * xmlNanoHTTPMethod (const char * URL, <br/> const char * method, <br/> const char * input, <br/> char ** contentType, <br/> const char * headers, <br/> int ilen)<br/>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPSave"/>xmlNanoHTTPSave ()</h3><pre class="programlisting">int xmlNanoHTTPSave (void * ctxt, <br/> const char * filename)<br/>
</pre><p>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPScanProxy"/>xmlNanoHTTPScanProxy ()</h3><pre class="programlisting">void xmlNanoHTTPScanProxy (const char * URL)<br/>
-</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div></div>
<hr/>
</div>
typedef struct _xmlParserNodeInfoSeq <a href="#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>;
typedef enum <a href="#xmlFeature">xmlFeature</a>;
typedef enum <a href="#xmlParserMode">xmlParserMode</a>;
+typedef struct _xmlStartTag <a href="#xmlStartTag">xmlStartTag</a>;
typedef enum <a href="#xmlParserOption">xmlParserOption</a>;
typedef <a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> * <a href="#xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>;
typedef struct _xmlParserNodeInfo <a href="#xmlParserNodeInfo">xmlParserNodeInfo</a>;
</pre><p/>
</div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlStartTag">Structure </a>xmlStartTag</h3><pre class="programlisting">struct _xmlStartTag {
+The content of this structure is not made public by the API.
+} xmlStartTag;
+</pre><p/>
+</div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a name="attributeDeclSAXFunc"/>Function type attributeDeclSAXFunc</h3><pre class="programlisting">void attributeDeclSAXFunc (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br/> int type, <br/> int def, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br/> <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)<br/>
</pre><p>An <a href="libxml2-SAX.html#attribute">attribute</a> definition has been parsed.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the name of the element</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td>the type of default value</td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> default value</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>the tree of enumerated value set</td></tr></tbody></table></div></div>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="endElementNsSAX2Func"/>Function type endElementNsSAX2Func</h3><pre class="programlisting">void endElementNsSAX2Func (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI)<br/>
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="endElementSAXFunc"/>Function type endElementSAXFunc</h3><pre class="programlisting">void endElementSAXFunc (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="startElementNsSAX2Func"/>Function type startElementNsSAX2Func</h3><pre class="programlisting">void startElementNsSAX2Func (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br/> int nb_namespaces, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br/> int nb_attributes, <br/> int nb_defaulted, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br/>
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="startElementSAXFunc"/>Function type startElementSAXFunc</h3><pre class="programlisting">void startElementSAXFunc (void * ctx, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** atts)<br/>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemory"/>xmlParseBalancedChunkMemory ()</h3><pre class="programlisting">int xmlParseBalancedChunkMemory (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/> void * user_data, <br/> int depth, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br/>
</pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemoryRecover"/>xmlParseBalancedChunkMemoryRecover ()</h3><pre class="programlisting">int xmlParseBalancedChunkMemoryRecover (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/> void * user_data, <br/> int depth, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br/> int recover)<br/>
</pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseChunk"/>xmlParseChunk ()</h3><pre class="programlisting">int xmlParseChunk (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> const char * chunk, <br/> int size, <br/> int terminate)<br/>
</pre><p>Parse a Chunk of memory</p>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseExternalEntity"/>xmlParseExternalEntity ()</h3><pre class="programlisting">int xmlParseExternalEntity (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/> void * user_data, <br/> int depth, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URL, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ID, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br/>
</pre><p>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseFile"/>xmlParseFile ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseFile (const char * filename)<br/>
</pre><p>parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>a free form C string describing the HTML document encoding, or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new parser context or NULL</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="htmlInitAutoClose"/>htmlInitAutoClose ()</h3><pre class="programlisting">void htmlInitAutoClose (void)<br/>
-</pre><p>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</p>
+</pre><p>This is a no-op now.</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="inputPop"/>inputPop ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> inputPop (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlErrMemory"/>xmlErrMemory ()</h3><pre class="programlisting">void xmlErrMemory (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> const char * extra)<br/>
</pre><p>Handle a redefinition of <a href="libxml2-SAX.html#attribute">attribute</a> error</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra informations</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra information</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlFreeInputStream"/>xmlFreeInputStream ()</h3><pre class="programlisting">void xmlFreeInputStream (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
</pre><p>Free up an input stream.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseContent"/>xmlParseContent ()</h3><pre class="programlisting">void xmlParseContent (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
-</pre><p>Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
+</pre><p>Parse a content sequence. Stops at EOF or '</'. [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseDefaultDecl"/>xmlParseDefaultDecl ()</h3><pre class="programlisting">int xmlParseDefaultDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** value)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGGetValidErrors"/>xmlRelaxNGGetValidErrors ()</h3><pre class="programlisting">int xmlRelaxNGGetValidErrors (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br/> <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br/> void ** ctx)<br/>
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGInitTypes"/>xmlRelaxNGInitTypes ()</h3><pre class="programlisting">int xmlRelaxNGInitTypes (void)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGSetValidErrors"/>xmlRelaxNGSetValidErrors ()</h3><pre class="programlisting">void xmlRelaxNGSetValidErrors (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br/> <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br/> void * ctx)<br/>
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGSetValidStructuredErrors"/>xmlRelaxNGSetValidStructuredErrors ()</h3><pre class="programlisting">void xmlRelaxNGSetValidStructuredErrors (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/> void * ctx)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a document instance</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>an element instance</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if no validation problem was found or 0 if validating the element requires a full node, and -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxParserSetFlag"/>xmlRelaxParserSetFlag ()</h3><pre class="programlisting">int xmlRelaxParserSetFlag (<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br/> int flags)<br/>
-</pre><p>Semi private function used to pass informations to a parser context which are a combination of <a href="libxml2-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
+</pre><p>Semi private function used to pass information to a parser context which are a combination of <a href="libxml2-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a RelaxNG parser context</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of flags values</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if success and -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
</div>
struct _xmlDoc * doc : the containing document
<a href="libxml2-tree.html#xmlNs">xmlNs</a> * ns : pointer to the associated namespace
<a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> atype : the <a href="libxml2-SAX.html#attribute">attribute</a> type if validating
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
} xmlAttr;
</pre><p/>
</div>
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URL : The URI for that document
int charset : Internal flag for charset handling, actually an <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a>
struct _xmlDict * dict : dict used to allocate names or NULL
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
int parseFlags : set of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> used to parse the document
int properties : set of <a href="libxml2-tree.html#xmlDocProperties">xmlDocProperties</a> for this document set at the end of parsing
} xmlDoc;
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content : the content
struct _xmlAttr * properties : properties list
<a href="libxml2-tree.html#xmlNs">xmlNs</a> * nsDef : namespace definitions on this node
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
unsigned short line : line number
unsigned short extra : extra data for XPath/XSLT
} xmlNode;
int nameNr : Depth of the parsing stack
int nameMax : Max depth of the parsing stack
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * * nameTab : array of nodes
- long nbChars : number of <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> processed
+ long nbChars : unused
long checkIndex : used by progressive parsing lookup
int keepBlanks : ugly but ...
int disableSAX : SAX callbacks are disabled
int nsMax : the size of the arrays
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * * nsTab : the array of prefix/namespace name
int * attallocs : which <a href="libxml2-SAX.html#attribute">attribute</a> were allocated
- void * * pushTab : array of data for push
+ <a href="libxml2-parser.html#xmlStartTag">xmlStartTag</a> * pushTab : array of data for push
<a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> attsDefault : defaulted attributes if any
<a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> attsSpecial : non-CDATA attributes if any
int nsWellFormed : is the document XML Namespace okay
int freeElemsNr : number of freed element nodes
<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> freeElems : List of freed element nodes
int freeAttrsNr : number of freed attributes nodes
- <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error informations for the last error. *
+ <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error information for the last error. *
<a href="libxml2-xmlerror.html#xmlError">xmlError</a> lastError
<a href="libxml2-parser.html#xmlParserMode">xmlParserMode</a> parseMode : the parser mode
unsigned long nbentities : number of entities references
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the target document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the processing instruction name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the PI content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNewDocProp"/>xmlNewDocProp ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> xmlNewDocProp (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br/>
-</pre><p>Create a new property carried by a document.</p>
+</pre><p>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need entities support.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the value of the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlNewDocRawNode"/>xmlNewDocRawNode ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> xmlNewDocRawNode (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>application data that will be passed to the parser context in the _private field of the parser context(s)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlXIncludeProcessNode"/>xmlXIncludeProcessNode ()</h3><pre class="programlisting">int xmlXIncludeProcessNode (<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</p>
+</pre><p>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an existing XInclude context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlXIncludeProcessTree"/>xmlXIncludeProcessTree ()</h3><pre class="programlisting">int xmlXIncludeProcessTree (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree)<br/>
typedef int <a href="#xmlInputMatchCallback">xmlInputMatchCallback</a> (char const * filename);
void <a href="#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a> (void);
int <a href="#xmlFileClose">xmlFileClose</a> (void * context);
+int <a href="#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a> (void);
typedef int <a href="#xmlOutputMatchCallback">xmlOutputMatchCallback</a> (char const * filename);
int <a href="#xmlParserInputBufferPush">xmlParserInputBufferPush</a> (<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br/> int len, <br/> const char * buf);
int <a href="#xmlIOFTPRead">xmlIOFTPRead</a> (void * context, <br/> char * buffer, <br/> int len);
</pre><p>Clear the top input callback from the input stack. this includes the compiled-in I/O.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlPopOutputCallbacks"/>xmlPopOutputCallbacks ()</h3><pre class="programlisting">int xmlPopOutputCallbacks (void)<br/>
+</pre><p>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of output callback registered or -1 in case of error.</td></tr></tbody></table></div></div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegisterDefaultInputCallbacks"/>xmlRegisterDefaultInputCallbacks ()</h3><pre class="programlisting">void xmlRegisterDefaultInputCallbacks (void)<br/>
</pre><p>Registers the default compiled-in I/O handlers.</p>
</div>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParserPrintFileInfo"/>xmlParserPrintFileInfo ()</h3><pre class="programlisting">void xmlParserPrintFileInfo (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
-</pre><p>Displays the associated file and line informations for the current input</p>
+</pre><p>Displays the associated file and line information for the current input</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParserValidityError"/>xmlParserValidityError ()</h3><pre class="programlisting">void xmlParserValidityError (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
</h2>
<p>xmlexports - macros for marking symbols as exportable/importable.</p>
<p>macros for marking symbols as exportable/importable. </p>
- <p>Author(s): Igor Zlatovic <igor@zlatkovic.com> </p>
+ <p>Author(s): </p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
- <pre class="synopsis">#define <a href="#XMLCALL">XMLCALL</a>;
+ <pre class="synopsis">#define <a href="#XMLCDECL">XMLCDECL</a>;
+#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
#define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
-#define <a href="#XMLCDECL">XMLCDECL</a>;
-#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
#define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a>;
+#define <a href="#XMLCALL">XMLCALL</a>;
+#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
</pre>
</div>
<div class="refsect1" lang="en">
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XMLCALL">Macro </a>XMLCALL</h3><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a>;
-</pre><p/>
+</pre><p>Macro which declares the calling convention for exported functions</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XMLCDECL">Macro </a>XMLCDECL</h3><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a>;
-</pre><p/>
+</pre><p>Macro which declares the calling convention for exported functions that use '...'.</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XMLPUBFUN">Macro </a>XMLPUBFUN</h3><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
-</pre><p/>
+</pre><p>Macro which declares an exportable function</p>
+</div>
+ <hr/>
+ <div class="refsect2" lang="en"><h3><a name="XMLPUBLIC">Macro </a>XMLPUBLIC</h3><pre class="programlisting">#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
+</pre><p>Macro which declares a public symbol</p>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="XMLPUBVAR">Macro </a>XMLPUBVAR</h3><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
-</pre><p/>
+</pre><p>Macro which declares an exportable variable</p>
</div>
<hr/>
</div>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlReaderTypes">xmlReaderTypes</a> of the current node or -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlTextReaderNormalization"/>xmlTextReaderNormalization ()</h3><pre class="programlisting">int xmlTextReaderNormalization (<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
-</pre><p>The value indicating whether to normalize white space and <a href="libxml2-SAX.html#attribute">attribute</a> values. Since <a href="libxml2-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &#0; is of course not supported either.</p>
+</pre><p>The value indicating whether to normalize white space and <a href="libxml2-SAX.html#attribute">attribute</a> values. Since <a href="libxml2-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &#0; is of course not supported either.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 or -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlTextReaderPrefix"/>xmlTextReaderPrefix ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlTextReaderPrefix (<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the expressions context</td></tr><tr><td><span class="term"><i><tt>exp</tt></i>:</span></td><td>the englobing expression</td></tr><tr><td><span class="term"><i><tt>sub</tt></i>:</span></td><td>the subexpression</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if true 0 if false and -1 in case of failure.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegExecErrInfo"/>xmlRegExecErrInfo ()</h3><pre class="programlisting">int xmlRegExecErrInfo (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br/> int * nbval, <br/> int * nbneg, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br/> int * terminal)<br/>
-</pre><p>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context generating an error</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>return value for the error string</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegExecNextValues"/>xmlRegExecNextValues ()</h3><pre class="programlisting">int xmlRegExecNextValues (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/> int * nbval, <br/> int * nbneg, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br/> int * terminal)<br/>
-</pre><p>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegExecPushString"/>xmlRegExecPushString ()</h3><pre class="programlisting">int xmlRegExecPushString (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br/> void * data)<br/>
int <a href="#xmlSaveFlush">xmlSaveFlush</a> (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
long <a href="#xmlSaveDoc">xmlSaveDoc</a> (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
int <a href="#xmlSaveSetEscape">xmlSaveSetEscape</a> (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape);
-long <a href="#xmlSaveTree">xmlSaveTree</a> (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
+long <a href="#xmlSaveTree">xmlSaveTree</a> (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur);
</pre>
</div>
<div class="refsect1" lang="en">
</pre><p>Create a document saving context serializing to a file descriptor with the encoding and the options given</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div></div>
<hr/>
- <div class="refsect2" lang="en"><h3><a name="xmlSaveTree"/>xmlSaveTree ()</h3><pre class="programlisting">long xmlSaveTree (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
+ <div class="refsect2" lang="en"><h3><a name="xmlSaveTree"/>xmlSaveTree ()</h3><pre class="programlisting">long xmlSaveTree (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br/>
</pre><p>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the top node of the subtree to save</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
</div>
</div>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityLocatorFunc"/>Function type xmlSchemaValidityLocatorFunc</h3><pre class="programlisting">int xmlSchemaValidityLocatorFunc (void * ctx, <br/> const char ** file, <br/> unsigned long * line)<br/>
-</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</p>
+</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityWarningFunc"/>Function type xmlSchemaValidityWarningFunc</h3><pre class="programlisting">void xmlSchemaValidityWarningFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XMl-Schema parser context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaGetValidErrors"/>xmlSchemaGetValidErrors ()</h3><pre class="programlisting">int xmlSchemaGetValidErrors (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br/> void ** ctx)<br/>
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XML-Schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaIsValid"/>xmlSchemaIsValid ()</h3><pre class="programlisting">int xmlSchemaIsValid (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidErrors"/>xmlSchemaSetValidErrors ()</h3><pre class="programlisting">void xmlSchemaSetValidErrors (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br/> void * ctx)<br/>
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidOptions"/>xmlSchemaSetValidOptions ()</h3><pre class="programlisting">int xmlSchemaSetValidOptions (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> int options)<br/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <title>xmlversion: compile-time version informations</title>
+ <title>xmlversion: compile-time version information</title>
<meta name="generator" content="Libxml2 devhelp stylesheet"/>
<link rel="start" href="index.html" title="libxml2 Reference Manual"/>
<link rel="up" href="general.html" title="API"/>
<h2>
<span class="refentrytitle">xmlversion</span>
</h2>
- <p>xmlversion - compile-time version informations</p>
- <p>compile-time version informations for the XML library </p>
+ <p>xmlversion - compile-time version information</p>
+ <p>compile-time version information for the XML library </p>
<p>Author(s): Daniel Veillard </p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
unsigned long opLimit
unsigned long opCount
int depth
- int maxDepth
- int maxParserDepth
} xmlXPathContext;
</pre><p/>
</div>
<function name="XMLCALL" link="libxml2-xmlexports.html#XMLCALL"/>
<function name="XMLCDECL" link="libxml2-xmlexports.html#XMLCDECL"/>
<function name="XMLPUBFUN" link="libxml2-xmlexports.html#XMLPUBFUN"/>
+ <function name="XMLPUBLIC" link="libxml2-xmlexports.html#XMLPUBLIC"/>
<function name="XMLPUBVAR" link="libxml2-xmlexports.html#XMLPUBVAR"/>
<function name="XML_CAST_FPTR" link="libxml2-hash.html#XML_CAST_FPTR"/>
<function name="XML_CATALOGS_NAMESPACE" link="libxml2-catalog.html#XML_CATALOGS_NAMESPACE"/>
<function name="xmlSchematronParserCtxt" link="libxml2-schematron.html#xmlSchematronParserCtxt"/>
<function name="xmlSchematronValidCtxt" link="libxml2-schematron.html#xmlSchematronValidCtxt"/>
<function name="xmlShellCtxt" link="libxml2-debugXML.html#xmlShellCtxt"/>
+ <function name="xmlStartTag" link="libxml2-parser.html#xmlStartTag"/>
<function name="xmlStreamCtxt" link="libxml2-pattern.html#xmlStreamCtxt"/>
<function name="xmlTextReader" link="libxml2-xmlreader.html#xmlTextReader"/>
<function name="xmlTextWriter" link="libxml2-xmlwriter.html#xmlTextWriter"/>
<function name="xmlPedanticParserDefault ()" link="libxml2-parser.html#xmlPedanticParserDefault"/>
<function name="xmlPopInput ()" link="libxml2-parserInternals.html#xmlPopInput"/>
<function name="xmlPopInputCallbacks ()" link="libxml2-xmlIO.html#xmlPopInputCallbacks"/>
+ <function name="xmlPopOutputCallbacks ()" link="libxml2-xmlIO.html#xmlPopOutputCallbacks"/>
<function name="xmlPreviousElementSibling ()" link="libxml2-tree.html#xmlPreviousElementSibling"/>
<function name="xmlPrintURI ()" link="libxml2-uri.html#xmlPrintURI"/>
<function name="xmlPushInput ()" link="libxml2-parserInternals.html#xmlPushInput"/>
</example>
<example filename='reader1.c'>
<synopsis>Parse an XML file with an xmlReader</synopsis>
- <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
+ <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the information about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
<usage>reader1 <filename></usage>
<test>reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res</test>
<author>Daniel Veillard</author>
of the example:</p><ul><li><p><a href="#xmlWriter">xmlWriter</a> :</p><ul><li><a href="#testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</li></ul></li><li><p><a href="#InputOutput">InputOutput</a> :</p><ul><li><a href="#io1.c">io1.c</a>: Example of custom Input/Output</li><li><a href="#io2.c">io2.c</a>: Output to char buffer</li></ul></li><li><p><a href="#Tree">Tree</a> :</p><ul><li><a href="#tree1.c">tree1.c</a>: Navigates a tree to print element names</li><li><a href="#tree2.c">tree2.c</a>: Creates a tree</li></ul></li><li><p><a href="#XPath">XPath</a> :</p><ul><li><a href="#xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</li><li><a href="#xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</li></ul></li><li><p><a href="#Parsing">Parsing</a> :</p><ul><li><a href="#parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</li><li><a href="#parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</li><li><a href="#parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</li><li><a href="#parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</li></ul></li><li><p><a href="#xmlReader">xmlReader</a> :</p><ul><li><a href="#reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</li><li><a href="#reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</li><li><a href="#reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</li><li><a href="#reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</li></ul></li></ul><p> Getting the compilation options and libraries dependencies needed
to generate binaries from the examples is best done on Linux/Unix by using
the xml2-config script which should have been installed as part of <i>make
-install</i> step or when installing the libxml2 development package:</p><pre>gcc -o example `xml2-config --cflags` example.c `xml2-config --libs`</pre><h2><a name="InputOutput" id="InputOutput"></a>InputOutput Examples</h2><h3><a name="io1.c" href="io1.c" id="io1.c">io1.c</a>: Example of custom Input/Output</h3><p>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xmlIO.html"><libxml/xmlIO.h></a></li><li><a href="../html/libxml-xinclude.html"><libxml/xinclude.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 105: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 117: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 117: Function <a href="../html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> from xmlIO.h</li><li> line 124: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 134: Function <a href="../html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li><li> line 143: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 149: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 154: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 158: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>io1</p><p>Author: Daniel Veillard</p><h3><a name="io2.c" href="io2.c" id="io2.c">io2.c</a>: Output to char buffer</h3><p>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 19: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 20: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 27: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 28: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li><li> line 30: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 36: Function <a href="../html/libxml-tree.html#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> from tree.h</li><li> line 43: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li></ul><p>Usage:</p><p>io2</p><p>Author: John Fleck</p><h2><a name="Parsing" id="Parsing"></a>Parsing Examples</h2><h3><a name="parse1.c" href="parse1.c" id="parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</h3><p>Demonstrate the use of xmlReadFile() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 24: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 26: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 31: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 45: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 50: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 54: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse1 test1.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse2.c" href="parse2.c" id="parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</h3><p>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 25: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 26: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a> from parser.h</li><li> line 35: Function <a href="../html/libxml-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> from parser.h</li><li> line 44: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 47: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 61: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 66: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 70: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse2 test2.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse3.c" href="parse3.c" id="parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</h3><p>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 27: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 33: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 38: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 49: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 54: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 58: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse3</p><p>Author: Daniel Veillard</p><h3><a name="parse4.c" href="parse4.c" id="parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</h3><p>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 45: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 47: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 67: Function <a href="../html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> from parser.h</li><li> line 86: Function <a href="../html/libxml-parser.html#xmlParseChunk">xmlParseChunk</a> from parser.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 103: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 120: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 131: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 135: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse4 test3.xml</p><p>Author: Daniel Veillard</p><h2><a name="Tree" id="Tree"></a>Tree Examples</h2><h3><a name="tree1.c" href="tree1.c" id="tree1.c">tree1.c</a>: Navigates a tree to print element names</h3><p>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 67: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a> from tree.h</li></ul><p>Usage:</p><p>tree1 filename_or_URL</p><p>Author: Dodji Seketeli</p><h3><a name="tree2.c" href="tree2.c" id="tree2.c">tree2.c</a>: Creates a tree</h3><p>Shows how to create document, nodes and dump it to stdout or file.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 38: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 40: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 45: Function <a href="../html/libxml-tree.html#xmlCreateIntSubset">xmlCreateIntSubset</a> from tree.h</li><li> line 73: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlNewText">xmlNewText</a> from tree.h</li><li> line 77: Function <a href="../html/libxml-tree.html#xmlAddChild">xmlAddChild</a> from tree.h</li><li> line 87: Function <a href="../html/libxml-tree.html#xmlNewChild">xmlNewChild</a> from tree.h</li><li> line 88: Function <a href="../html/libxml-tree.html#xmlNewProp">xmlNewProp</a> from tree.h</li><li> line 95: Function <a href="../html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a> from tree.h</li></ul><p>Usage:</p><p>tree2 <filename> -Default output: stdout</p><p>Author: Lucas Brasilino <brasilino@recife.pe.gov.br></p><h2><a name="XPath" id="XPath"></a>XPath Examples</h2><h3><a name="xpath1.c" href="xpath1.c" id="xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</h3><p>Shows how to evaluate XPath expression and register known namespaces in XPath context.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 39: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 101: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 117: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 129: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 130: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 156: Function <a href="../html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li><li> line 180: Function <a href="../html/libxml-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li><li> line 186: Function <a href="../html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li><li> line 206: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 218: Type <a href="../html/libxml-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li></ul><p>Usage:</p><p>xpath1 <xml-file> <xpath-expr> [<known-ns-list>]</p><p>Author: Aleksey Sanin</p><h3><a name="xpath2.c" href="xpath2.c" id="xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</h3><p>Shows how to make a full round-trip from a load/edit/save</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 41: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 95: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 102: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 110: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 123: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 124: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 127: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 162: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li></ul><p>Usage:</p><p>xpath2 <xml-file> <xpath-expr> <new-value></p><p>Author: Aleksey Sanin and Daniel Veillard</p><h2><a name="xmlReader" id="xmlReader"></a>xmlReader Examples</h2><h3><a name="reader1.c" href="reader1.c" id="reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 29: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 33: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 36: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 39: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 44: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 59: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 67: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 69: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 89: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 98: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>reader1 <filename></p><p>Author: Daniel Veillard</p><h3><a name="reader2.c" href="reader2.c" id="reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 30: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 34: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 41: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 45: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 60: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 68: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 76: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 81: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a> from xmlreader.h</li><li> line 84: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader2 <valid_xml_filename></p><p>Author: Daniel Veillard</p><h3><a name="reader3.c" href="reader3.c" id="reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</h3><p>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 32: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 43: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a> from xmlreader.h</li><li> line 52: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 66: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li></ul><p>Usage:</p><p>reader3</p><p>Author: Daniel Veillard</p><h3><a name="reader4.c" href="reader4.c" id="reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 54: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 72: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 83: Function <a href="../html/libxml-xmlreader.html#xmlReaderNewFile">xmlReaderNewFile</a> from xmlreader.h</li><li> line 97: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 104: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader4 <filename> [ filename ... ]</p><p>Author: Graham Bennett</p><h2><a name="xmlWriter" id="xmlWriter"></a>xmlWriter Examples</h2><h3><a name="testWriter.c" href="testWriter.c" id="testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</h3><p>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</p><p>Includes:</p><ul><li><a href="../html/libxml-encoding.html"><libxml/encoding.h></a></li><li><a href="../html/libxml-xmlwriter.html"><libxml/xmlwriter.h></a></li></ul><p>Uses:</p><ul><li> line 76: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li><li> line 341: Type <a href="../html/libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li><li> line 347: Function <a href="../html/libxml-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li><li> line 355: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li><li> line 613: Function <a href="../html/libxml-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li><li> line 632: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li><li> line 878: Type <a href="../html/libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li><li> line 880: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 885: Macro <a href="../html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li><li> line 885: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 894: Function <a href="../html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li><li> line 901: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 904: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li><li> line 913: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li><li> line 925: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li><li> line 949: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li><li> line 959: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li><li> line 1073: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li><li> line 1096: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li><li> line 1103: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li><li> line 1111: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li><li> line 1121: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li><li> line 1127: Function <a href="../html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li><li> line 1129: Function <a href="../html/libxml-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li><li> line 1151: Type <a href="../html/libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li><li> line 1156: Function <a href="../html/libxml-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li></ul><p>Usage:</p><p>testWriter</p><p>Author: Alfred Mickautsch</p><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+install</i> step or when installing the libxml2 development package:</p><pre>gcc -o example `xml2-config --cflags` example.c `xml2-config --libs`</pre><h2><a name="InputOutput" id="InputOutput"></a>InputOutput Examples</h2><h3><a name="io1.c" href="io1.c" id="io1.c">io1.c</a>: Example of custom Input/Output</h3><p>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xmlIO.html"><libxml/xmlIO.h></a></li><li><a href="../html/libxml-xinclude.html"><libxml/xinclude.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 105: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 117: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 117: Function <a href="../html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> from xmlIO.h</li><li> line 124: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 134: Function <a href="../html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li><li> line 143: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 149: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 154: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 158: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>io1</p><p>Author: Daniel Veillard</p><h3><a name="io2.c" href="io2.c" id="io2.c">io2.c</a>: Output to char buffer</h3><p>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 19: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 20: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 27: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 28: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li><li> line 30: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 36: Function <a href="../html/libxml-tree.html#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> from tree.h</li><li> line 43: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li></ul><p>Usage:</p><p>io2</p><p>Author: John Fleck</p><h2><a name="Parsing" id="Parsing"></a>Parsing Examples</h2><h3><a name="parse1.c" href="parse1.c" id="parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</h3><p>Demonstrate the use of xmlReadFile() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 24: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 26: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 31: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 45: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 50: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 54: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse1 test1.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse2.c" href="parse2.c" id="parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</h3><p>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 25: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 26: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a> from parser.h</li><li> line 35: Function <a href="../html/libxml-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> from parser.h</li><li> line 44: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 47: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 61: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 66: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 70: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse2 test2.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse3.c" href="parse3.c" id="parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</h3><p>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 27: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 33: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 38: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 49: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 54: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 58: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse3</p><p>Author: Daniel Veillard</p><h3><a name="parse4.c" href="parse4.c" id="parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</h3><p>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 45: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 47: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 67: Function <a href="../html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> from parser.h</li><li> line 86: Function <a href="../html/libxml-parser.html#xmlParseChunk">xmlParseChunk</a> from parser.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 103: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 120: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 131: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 135: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse4 test3.xml</p><p>Author: Daniel Veillard</p><h2><a name="Tree" id="Tree"></a>Tree Examples</h2><h3><a name="tree1.c" href="tree1.c" id="tree1.c">tree1.c</a>: Navigates a tree to print element names</h3><p>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 67: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a> from tree.h</li></ul><p>Usage:</p><p>tree1 filename_or_URL</p><p>Author: Dodji Seketeli</p><h3><a name="tree2.c" href="tree2.c" id="tree2.c">tree2.c</a>: Creates a tree</h3><p>Shows how to create document, nodes and dump it to stdout or file.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 38: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 40: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 45: Function <a href="../html/libxml-tree.html#xmlCreateIntSubset">xmlCreateIntSubset</a> from tree.h</li><li> line 73: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlNewText">xmlNewText</a> from tree.h</li><li> line 77: Function <a href="../html/libxml-tree.html#xmlAddChild">xmlAddChild</a> from tree.h</li><li> line 87: Function <a href="../html/libxml-tree.html#xmlNewChild">xmlNewChild</a> from tree.h</li><li> line 88: Function <a href="../html/libxml-tree.html#xmlNewProp">xmlNewProp</a> from tree.h</li><li> line 95: Function <a href="../html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a> from tree.h</li></ul><p>Usage:</p><p>tree2 <filename> -Default output: stdout</p><p>Author: Lucas Brasilino <brasilino@recife.pe.gov.br></p><h2><a name="XPath" id="XPath"></a>XPath Examples</h2><h3><a name="xpath1.c" href="xpath1.c" id="xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</h3><p>Shows how to evaluate XPath expression and register known namespaces in XPath context.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 39: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 101: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 117: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 129: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 130: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 156: Function <a href="../html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li><li> line 180: Function <a href="../html/libxml-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li><li> line 186: Function <a href="../html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li><li> line 206: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 218: Type <a href="../html/libxml-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li></ul><p>Usage:</p><p>xpath1 <xml-file> <xpath-expr> [<known-ns-list>]</p><p>Author: Aleksey Sanin</p><h3><a name="xpath2.c" href="xpath2.c" id="xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</h3><p>Shows how to make a full round-trip from a load/edit/save</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 41: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 95: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 102: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 110: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 123: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 124: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 127: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 162: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li></ul><p>Usage:</p><p>xpath2 <xml-file> <xpath-expr> <new-value></p><p>Author: Aleksey Sanin and Daniel Veillard</p><h2><a name="xmlReader" id="xmlReader"></a>xmlReader Examples</h2><h3><a name="reader1.c" href="reader1.c" id="reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the information about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 29: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 33: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 36: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 39: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 44: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 59: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 67: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 69: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 89: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 98: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>reader1 <filename></p><p>Author: Daniel Veillard</p><h3><a name="reader2.c" href="reader2.c" id="reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 30: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 34: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 41: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 45: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 60: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 68: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 76: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 81: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a> from xmlreader.h</li><li> line 84: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader2 <valid_xml_filename></p><p>Author: Daniel Veillard</p><h3><a name="reader3.c" href="reader3.c" id="reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</h3><p>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 32: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 43: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a> from xmlreader.h</li><li> line 52: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 66: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li></ul><p>Usage:</p><p>reader3</p><p>Author: Daniel Veillard</p><h3><a name="reader4.c" href="reader4.c" id="reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 54: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 72: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 83: Function <a href="../html/libxml-xmlreader.html#xmlReaderNewFile">xmlReaderNewFile</a> from xmlreader.h</li><li> line 97: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 104: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader4 <filename> [ filename ... ]</p><p>Author: Graham Bennett</p><h2><a name="xmlWriter" id="xmlWriter"></a>xmlWriter Examples</h2><h3><a name="testWriter.c" href="testWriter.c" id="testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</h3><p>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</p><p>Includes:</p><ul><li><a href="../html/libxml-encoding.html"><libxml/encoding.h></a></li><li><a href="../html/libxml-xmlwriter.html"><libxml/xmlwriter.h></a></li></ul><p>Uses:</p><ul><li> line 76: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li><li> line 341: Type <a href="../html/libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li><li> line 347: Function <a href="../html/libxml-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li><li> line 355: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li><li> line 613: Function <a href="../html/libxml-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li><li> line 632: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li><li> line 878: Type <a href="../html/libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li><li> line 880: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 885: Macro <a href="../html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li><li> line 885: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 894: Function <a href="../html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li><li> line 901: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 904: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li><li> line 913: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li><li> line 925: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li><li> line 949: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li><li> line 959: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li><li> line 1073: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li><li> line 1096: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li><li> line 1103: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li><li> line 1111: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li><li> line 1121: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li><li> line 1127: Function <a href="../html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li><li> line 1129: Function <a href="../html/libxml-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li><li> line 1151: Type <a href="../html/libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li><li> line 1156: Function <a href="../html/libxml-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li></ul><p>Usage:</p><p>testWriter</p><p>Author: Alfred Mickautsch</p><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
* section: xmlReader
* synopsis: Parse an XML file with an xmlReader
* purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
- * and dump the informations about the nodes found in the process.
+ * and dump the information about the nodes found in the process.
* (Note that the XMLReader functions require libxml2 version later
* than 2.6.)
* usage: reader1 <filename>
return;
}
- /* Start an element named "EXAMPLE". Since thist is the first
+ /* Start an element named "EXAMPLE". Since this is the first
* element, this will be the root element of the document. */
rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
if (rc < 0) {
return;
}
- /* Start an element named "EXAMPLE". Since thist is the first
+ /* Start an element named "EXAMPLE". Since this is the first
* element, this will be the root element of the document. */
rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
if (rc < 0) {
return;
}
- /* Start an element named "EXAMPLE". Since thist is the first
+ /* Start an element named "EXAMPLE". Since this is the first
* element, this will be the root element of the document. */
rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
if (rc < 0) {
<li>use significant words for the element and attributes names.</li>
<li>do not use attributes for general textual content, attributes
will be modified by the parser before reaching the application,
- spaces and line informations will be modified.</li>
+ spaces and line information will be modified.</li>
<li>use single elements for every string that might be subject to
localization. The canonical way to localize XML content is to use
siblings element carrying different xml:lang attributes like in the
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+ </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+ </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
<h3><a name="HTML_TEXT_NODE" id="HTML_TEXT_NODE"></a>Macro: HTML_TEXT_NODE</h3><pre>#define HTML_TEXT_NODE</pre><p>Macro. A text node in a HTML document is really implemented the same way as a text node in an XML document.</p>
<h3><a name="htmlDocContentDumpFormatOutput" id="htmlDocContentDumpFormatOutput"></a>Function: htmlDocContentDumpFormatOutput</h3><pre class="programlisting">void htmlDocContentDumpFormatOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding, <br /> int format)<br />
</pre><p>Dump an HTML document.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlDocContentDumpOutput" id="htmlDocContentDumpOutput"></a>Function: htmlDocContentDumpOutput</h3><pre class="programlisting">void htmlDocContentDumpOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlDocContentDumpOutput" id="htmlDocContentDumpOutput"></a>Function: htmlDocContentDumpOutput</h3><pre class="programlisting">void htmlDocContentDumpOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding)<br />
</pre><p>Dump an HTML document. Formatting return/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div><h3><a name="htmlDocDump" id="htmlDocDump"></a>Function: htmlDocDump</h3><pre class="programlisting">int htmlDocDump (FILE * f, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div><h3><a name="htmlDocDump" id="htmlDocDump"></a>Function: htmlDocDump</h3><pre class="programlisting">int htmlDocDump (FILE * f, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
</pre><p>Dump an HTML document to an open FILE.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>f</tt></i>:</span></td><td>the FILE*</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlDocDumpMemory" id="htmlDocDumpMemory"></a>Function: htmlDocDumpMemory</h3><pre class="programlisting">void htmlDocDumpMemory (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** mem, <br /> int * size)<br />
</pre><p>Dump an HTML document in memory and return the <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * and it's size. It's up to the caller to free the memory.</p>
</pre><p>Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == NULL try to save in the doc encoding</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>the FILE pointer</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the document encoding</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlNodeDumpFormatOutput" id="htmlNodeDumpFormatOutput"></a>Function: htmlNodeDumpFormatOutput</h3><pre class="programlisting">void htmlNodeDumpFormatOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br /> const char * encoding, <br /> int format)<br />
</pre><p>Dump an HTML node, recursive behaviour,children are printed too.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlNodeDumpOutput" id="htmlNodeDumpOutput"></a>Function: htmlNodeDumpOutput</h3><pre class="programlisting">void htmlNodeDumpOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br /> const char * encoding)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlNodeDumpOutput" id="htmlNodeDumpOutput"></a>Function: htmlNodeDumpOutput</h3><pre class="programlisting">void htmlNodeDumpOutput (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br /> const char * encoding)<br />
</pre><p>Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div><h3><a name="htmlSaveFile" id="htmlSaveFile"></a>Function: htmlSaveFile</h3><pre class="programlisting">int htmlSaveFile (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div><h3><a name="htmlSaveFile" id="htmlSaveFile"></a>Function: htmlSaveFile</h3><pre class="programlisting">int htmlSaveFile (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
</pre><p>Dump an HTML document to a file. If @filename is "-" the stdout file is used.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlSaveFileEnc" id="htmlSaveFileEnc"></a>Function: htmlSaveFileEnc</h3><pre class="programlisting">int htmlSaveFileEnc (const char * filename, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br /> const char * encoding)<br />
</pre><p>Dump an HTML document to a file using a given encoding and formatting returns/spaces are added.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><h3><a name="xmlSAX2EndElement" id="xmlSAX2EndElement"></a>Function: xmlSAX2EndElement</h3><pre class="programlisting">void xmlSAX2EndElement (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)<br />
</pre><p>called when the end of an element has been detected.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div><h3><a name="xmlSAX2EndElementNs" id="xmlSAX2EndElementNs"></a>Function: xmlSAX2EndElementNs</h3><pre class="programlisting">void xmlSAX2EndElementNs (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI)<br />
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><h3><a name="xmlSAX2EntityDecl" id="xmlSAX2EntityDecl"></a>Function: xmlSAX2EntityDecl</h3><pre class="programlisting">void xmlSAX2EntityDecl (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> int type, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
</pre><p>An entity definition has been parsed</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the entity name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the entity type</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the entity value (without processing).</td></tr></tbody></table></div><h3><a name="xmlSAX2ExternalSubset" id="xmlSAX2ExternalSubset"></a>Function: xmlSAX2ExternalSubset</h3><pre class="programlisting">void xmlSAX2ExternalSubset (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><h3><a name="xmlSAX2StartElement" id="xmlSAX2StartElement"></a>Function: xmlSAX2StartElement</h3><pre class="programlisting">void xmlSAX2StartElement (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** atts)<br />
</pre><p>called when an opening tag has been processed.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div><h3><a name="xmlSAX2StartElementNs" id="xmlSAX2StartElementNs"></a>Function: xmlSAX2StartElementNs</h3><pre class="programlisting">void xmlSAX2StartElementNs (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br /> int nb_namespaces, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br /> int nb_attributes, <br /> int nb_defaulted, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br />
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes.</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><h3><a name="xmlSAX2UnparsedEntityDecl" id="xmlSAX2UnparsedEntityDecl"></a>Function: xmlSAX2UnparsedEntityDecl</h3><pre class="programlisting">void xmlSAX2UnparsedEntityDecl (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * notationName)<br />
</pre><p>What to do when an unparsed entity declaration is parsed</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The name of the entity</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><span class="term"><i><tt>notationName</tt></i>:</span></td><td>the name of the notation</td></tr></tbody></table></div><h3><a name="xmlSAXDefaultVersion" id="xmlSAXDefaultVersion"></a>Function: xmlSAXDefaultVersion</h3><pre class="programlisting">int xmlSAXDefaultVersion (int version)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node list</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div><h3><a name="xmlDebugDumpOneNode" id="xmlDebugDumpOneNode"></a>Function: xmlDebugDumpOneNode</h3><pre class="programlisting">void xmlDebugDumpOneNode (FILE * output, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> int depth)<br />
</pre><p>Dumps debug information for the element node, it is not recursive</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div><h3><a name="xmlDebugDumpString" id="xmlDebugDumpString"></a>Function: xmlDebugDumpString</h3><pre class="programlisting">void xmlDebugDumpString (FILE * output, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str)<br />
-</pre><p>Dumps informations about the string, shorten it if necessary</p>
+</pre><p>Dumps information about the string, shorten it if necessary</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string</td></tr></tbody></table></div><h3><a name="xmlLsCountNode" id="xmlLsCountNode"></a>Function: xmlLsCountNode</h3><pre class="programlisting">int xmlLsCountNode (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
</pre><p>Count the children of @node.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node to count</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of children of @node.</td></tr></tbody></table></div><h3><a name="xmlLsOneNode" id="xmlLsOneNode"></a>Function: xmlLsOneNode</h3><pre class="programlisting">void xmlLsOneNode (FILE * output, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
int xmlShellCmd (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br /> char * arg, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)
</pre><p>This is a generic signature for the XML shell functions.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>a string argument</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a first node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>a second node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int, negative returns indicating errors.</td></tr></tbody></table></div><br />
<h3><a name="xmlShellDir" id="xmlShellDir"></a>Function: xmlShellDir</h3><pre class="programlisting">int xmlShellDir (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br /> char * arg, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
-</pre><p>Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).</p>
+</pre><p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div><h3><a name="xmlShellDu" id="xmlShellDu"></a>Function: xmlShellDu</h3><pre class="programlisting">int xmlShellDu (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br /> char * arg, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
</pre><p>Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>a node defining a subtree</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlShellList" id="xmlShellList"></a>Function: xmlShellList</h3><pre class="programlisting">int xmlShellList (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br /> char * arg, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
<a href="libxml-encoding.html#uconv_t">uconv_t</a> * uconv_out
}</pre><h3><a name="UTF8Toisolat1" id="UTF8Toisolat1"></a>Function: UTF8Toisolat1</h3><pre class="programlisting">int UTF8Toisolat1 (unsigned char * out, <br /> int * outlen, <br /> const unsigned char * in, <br /> int * inlen)<br />
</pre><p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div><h3><a name="isolat1ToUTF8" id="isolat1ToUTF8"></a>Function: isolat1ToUTF8</h3><pre class="programlisting">int isolat1ToUTF8 (unsigned char * out, <br /> int * outlen, <br /> const unsigned char * in, <br /> int * inlen)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div><h3><a name="isolat1ToUTF8" id="isolat1ToUTF8"></a>Function: isolat1ToUTF8</h3><pre class="programlisting">int isolat1ToUTF8 (unsigned char * out, <br /> int * outlen, <br /> const unsigned char * in, <br /> int * inlen)<br />
</pre><p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div><h3><a name="xmlAddEncodingAlias" id="xmlAddEncodingAlias"></a>Function: xmlAddEncodingAlias</h3><pre class="programlisting">int xmlAddEncodingAlias (const char * name, <br /> const char * alias)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div><h3><a name="xmlAddEncodingAlias" id="xmlAddEncodingAlias"></a>Function: xmlAddEncodingAlias</h3><pre class="programlisting">int xmlAddEncodingAlias (const char * name, <br /> const char * alias)<br />
</pre><p>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the encoding name as parsed, in UTF-8 format (ASCII actually)</td></tr><tr><td><span class="term"><i><tt>alias</tt></i>:</span></td><td>the alias name as parsed, in UTF-8 format (ASCII actually)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlCharEncCloseFunc" id="xmlCharEncCloseFunc"></a>Function: xmlCharEncCloseFunc</h3><pre class="programlisting">int xmlCharEncCloseFunc (<a href="libxml-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * handler)<br />
</pre><p>Generic front-end for encoding handler close function</p>
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+ </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
<h3><a name="xmlNanoFTPCheckResponse" id="xmlNanoFTPCheckResponse"></a>Function: xmlNanoFTPCheckResponse</h3><pre class="programlisting">int xmlNanoFTPCheckResponse (void * ctx)<br />
</pre><p>Check if there is a response from the FTP server after a command.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number, or 0</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCleanup" id="xmlNanoFTPCleanup"></a>Function: xmlNanoFTPCleanup</h3><pre class="programlisting">void xmlNanoFTPCleanup (void)<br />
-</pre><p>Cleanup the FTP protocol layer. This cleanup proxy informations.</p>
+</pre><p>Cleanup the FTP protocol layer. This cleanup proxy information.</p>
<h3><a name="xmlNanoFTPClose" id="xmlNanoFTPClose"></a>Function: xmlNanoFTPClose</h3><pre class="programlisting">int xmlNanoFTPClose (void * ctx)<br />
</pre><p>Close the connection and both control and transport</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCloseConnection" id="xmlNanoFTPCloseConnection"></a>Function: xmlNanoFTPCloseConnection</h3><pre class="programlisting">int xmlNanoFTPCloseConnection (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCloseConnection" id="xmlNanoFTPCloseConnection"></a>Function: xmlNanoFTPCloseConnection</h3><pre class="programlisting">int xmlNanoFTPCloseConnection (void * ctx)<br />
</pre><p>Close the data connection from the server</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnect" id="xmlNanoFTPConnect"></a>Function: xmlNanoFTPConnect</h3><pre class="programlisting">int xmlNanoFTPConnect (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnect" id="xmlNanoFTPConnect"></a>Function: xmlNanoFTPConnect</h3><pre class="programlisting">int xmlNanoFTPConnect (void * ctx)<br />
</pre><p>Tries to open a control connection</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnectTo" id="xmlNanoFTPConnectTo"></a>Function: xmlNanoFTPConnectTo</h3><pre class="programlisting">void * xmlNanoFTPConnectTo (const char * server, <br /> int port)<br />
</pre><p>Tries to open a control connection to the given server/port</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>server</tt></i>:</span></td><td>an FTP server name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the port (use 21 if 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an fTP context or NULL if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCwd" id="xmlNanoFTPCwd"></a>Function: xmlNanoFTPCwd</h3><pre class="programlisting">int xmlNanoFTPCwd (void * ctx, <br /> const char * directory)<br />
</pre><p>Tries to change the remote directory</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int xmlNanoFTPDele (void * ctx, <br /> const char * file)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int xmlNanoFTPDele (void * ctx, <br /> const char * file)<br />
</pre><p>Tries to delete an item (file or directory) from server</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPFreeCtxt" id="xmlNanoFTPFreeCtxt"></a>Function: xmlNanoFTPFreeCtxt</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPFreeCtxt" id="xmlNanoFTPFreeCtxt"></a>Function: xmlNanoFTPFreeCtxt</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt (void * ctx)<br />
</pre><p>Frees the context after closing the connection.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGet" id="xmlNanoFTPGet"></a>Function: xmlNanoFTPGet</h3><pre class="programlisting">int xmlNanoFTPGet (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br /> void * userData, <br /> const char * filename)<br />
</pre><p>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetConnection" id="xmlNanoFTPGetConnection"></a>Function: xmlNanoFTPGetConnection</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a> xmlNanoFTPGetConnection (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetConnection" id="xmlNanoFTPGetConnection"></a>Function: xmlNanoFTPGetConnection</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a> xmlNanoFTPGetConnection (void * ctx)<br />
</pre><p>Try to open a data connection to the server. Currently only passive mode is supported.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetResponse" id="xmlNanoFTPGetResponse"></a>Function: xmlNanoFTPGetResponse</h3><pre class="programlisting">int xmlNanoFTPGetResponse (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetResponse" id="xmlNanoFTPGetResponse"></a>Function: xmlNanoFTPGetResponse</h3><pre class="programlisting">int xmlNanoFTPGetResponse (void * ctx)<br />
</pre><p>Get the response from the FTP server after a command.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetSocket" id="xmlNanoFTPGetSocket"></a>Function: xmlNanoFTPGetSocket</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a> xmlNanoFTPGetSocket (void * ctx, <br /> const char * filename)<br />
</pre><p>Initiate fetch of the given file from the server.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve (or NULL if path is in context).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or <0 in case of error</td></tr></tbody></table></div><h3><a name="xmlNanoFTPInit" id="xmlNanoFTPInit"></a>Function: xmlNanoFTPInit</h3><pre class="programlisting">void xmlNanoFTPInit (void)<br />
-</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p>
+</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</p>
<h3><a name="xmlNanoFTPList" id="xmlNanoFTPList"></a>Function: xmlNanoFTPList</h3><pre class="programlisting">int xmlNanoFTPList (void * ctx, <br /> <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br /> void * userData, <br /> const char * filename)<br />
</pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPNewCtxt" id="xmlNanoFTPNewCtxt"></a>Function: xmlNanoFTPNewCtxt</h3><pre class="programlisting">void * xmlNanoFTPNewCtxt (const char * URL)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPNewCtxt" id="xmlNanoFTPNewCtxt"></a>Function: xmlNanoFTPNewCtxt</h3><pre class="programlisting">void * xmlNanoFTPNewCtxt (const char * URL)<br />
</pre><p>Allocate and initialize a new FTP context.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL used to initialize the context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlNanoFTPOpen" id="xmlNanoFTPOpen"></a>Function: xmlNanoFTPOpen</h3><pre class="programlisting">void * xmlNanoFTPOpen (const char * URL)<br />
</pre><p>Start to fetch the given ftp:// resource</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL to the resource</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context, or NULL</td></tr></tbody></table></div><h3><a name="xmlNanoFTPProxy" id="xmlNanoFTPProxy"></a>Function: xmlNanoFTPProxy</h3><pre class="programlisting">void xmlNanoFTPProxy (const char * host, <br /> int port, <br /> const char * user, <br /> const char * passwd, <br /> int type)<br />
-</pre><p>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
+</pre><p>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>host</tt></i>:</span></td><td>the proxy host name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the proxy port</td></tr><tr><td><span class="term"><i><tt>user</tt></i>:</span></td><td>the proxy user name</td></tr><tr><td><span class="term"><i><tt>passwd</tt></i>:</span></td><td>the proxy password</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the type of proxy 1 for using SITE, 2 for USER a@b</td></tr></tbody></table></div><h3><a name="xmlNanoFTPQuit" id="xmlNanoFTPQuit"></a>Function: xmlNanoFTPQuit</h3><pre class="programlisting">int xmlNanoFTPQuit (void * ctx)<br />
</pre><p>Send a QUIT command to the server</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPRead" id="xmlNanoFTPRead"></a>Function: xmlNanoFTPRead</h3><pre class="programlisting">int xmlNanoFTPRead (void * ctx, <br /> void * dest, <br /> int len)<br />
</pre><p>This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the FTP context</td></tr><tr><td><span class="term"><i><tt>dest</tt></i>:</span></td><td>a buffer</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the buffer length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.</td></tr></tbody></table></div><h3><a name="xmlNanoFTPScanProxy" id="xmlNanoFTPScanProxy"></a>Function: xmlNanoFTPScanProxy</h3><pre class="programlisting">void xmlNanoFTPScanProxy (const char * URL)<br />
-</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div><h3><a name="xmlNanoFTPUpdateURL" id="xmlNanoFTPUpdateURL"></a>Function: xmlNanoFTPUpdateURL</h3><pre class="programlisting">int xmlNanoFTPUpdateURL (void * ctx, <br /> const char * URL)<br />
</pre><p>Update an FTP context by parsing the URL and finding new path it indicates. If there is an error in the protocol, hostname, port or other information, the error is raised. It indicates a new connection has to be established.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL used to update the context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if Ok, -1 in case of error (other host).</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
</pre><p>Provides the specified encoding if specified in the HTTP headers.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the specified encoding or NULL if not available</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPFetch" id="xmlNanoHTTPFetch"></a>Function: xmlNanoHTTPFetch</h3><pre class="programlisting">int xmlNanoHTTPFetch (const char * URL, <br /> const char * filename, <br /> char ** contentType)<br />
</pre><p>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPInit" id="xmlNanoHTTPInit"></a>Function: xmlNanoHTTPInit</h3><pre class="programlisting">void xmlNanoHTTPInit (void)<br />
-</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPInit" id="xmlNanoHTTPInit"></a>Function: xmlNanoHTTPInit</h3><pre class="programlisting">void xmlNanoHTTPInit (void)<br />
+</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy information</p>
<h3><a name="xmlNanoHTTPMethod" id="xmlNanoHTTPMethod"></a>Function: xmlNanoHTTPMethod</h3><pre class="programlisting">void * xmlNanoHTTPMethod (const char * URL, <br /> const char * method, <br /> const char * input, <br /> char ** contentType, <br /> const char * headers, <br /> int ilen)<br />
</pre><p>This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>method</tt></i>:</span></td><td>the HTTP method to use</td></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>the input string if any</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>the Content-Type information IN and OUT</td></tr><tr><td><span class="term"><i><tt>headers</tt></i>:</span></td><td>the extra headers</td></tr><tr><td><span class="term"><i><tt>ilen</tt></i>:</span></td><td>input length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPMethodRedir" id="xmlNanoHTTPMethodRedir"></a>Function: xmlNanoHTTPMethodRedir</h3><pre class="programlisting">void * xmlNanoHTTPMethodRedir (const char * URL, <br /> const char * method, <br /> const char * input, <br /> char ** contentType, <br /> char ** redir, <br /> const char * headers, <br /> int ilen)<br />
</pre><p>Get the latest HTTP return code received</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the HTTP return code for the request.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPSave" id="xmlNanoHTTPSave"></a>Function: xmlNanoHTTPSave</h3><pre class="programlisting">int xmlNanoHTTPSave (void * ctxt, <br /> const char * filename)<br />
</pre><p>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPScanProxy" id="xmlNanoHTTPScanProxy"></a>Function: xmlNanoHTTPScanProxy</h3><pre class="programlisting">void xmlNanoHTTPScanProxy (const char * URL)<br />
-</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPScanProxy" id="xmlNanoHTTPScanProxy"></a>Function: xmlNanoHTTPScanProxy</h3><pre class="programlisting">void xmlNanoHTTPScanProxy (const char * URL)<br />
+</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
</pre><pre class="programlisting">Enum <a href="#xmlParserOption">xmlParserOption</a>
</pre><pre class="programlisting">Structure <a href="#xmlSAXHandlerV1">xmlSAXHandlerV1</a><br />struct _xmlSAXHandlerV1
</pre><pre class="programlisting">Typedef <a href="libxml-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> * <a name="xmlSAXHandlerV1Ptr" id="xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>
+</pre><pre class="programlisting">Structure <a href="#xmlStartTag">xmlStartTag</a><br />struct _xmlStartTag
+The content of this structure is not made public by the API.
</pre><pre class="programlisting">Function type: <a href="#attributeDeclSAXFunc">attributeDeclSAXFunc</a>
void <a href="#attributeDeclSAXFunc">attributeDeclSAXFunc</a> (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * elem, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br /> int type, <br /> int def, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br /> <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)
</pre>
<a href="libxml-parser.html#cdataBlockSAXFunc">cdataBlockSAXFunc</a> cdataBlock
<a href="libxml-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a> externalSubset
unsigned int initialized
+}</pre><h3><a name="xmlStartTag" id="xmlStartTag">Structure xmlStartTag</a></h3><pre class="programlisting">Structure xmlStartTag<br />struct _xmlStartTag {
+The content of this structure is not made public by the API.
}</pre><h3><a name="attributeDeclSAXFunc" id="attributeDeclSAXFunc"></a>Function type: attributeDeclSAXFunc</h3><pre class="programlisting">Function type: attributeDeclSAXFunc
void attributeDeclSAXFunc (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * elem, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br /> int type, <br /> int def, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br /> <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)
</pre><p>An <a href="libxml-SAX.html#attribute">attribute</a> definition has been parsed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the name of the element</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td>the type of default value</td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> default value</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>the tree of enumerated value set</td></tr></tbody></table></div><br />
</pre><p>Called when the document end has been detected.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><br />
<h3><a name="endElementNsSAX2Func" id="endElementNsSAX2Func"></a>Function type: endElementNsSAX2Func</h3><pre class="programlisting">Function type: endElementNsSAX2Func
void endElementNsSAX2Func (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI)
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><br />
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><br />
<h3><a name="endElementSAXFunc" id="endElementSAXFunc"></a>Function type: endElementSAXFunc</h3><pre class="programlisting">Function type: endElementSAXFunc
void endElementSAXFunc (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)
</pre><p>Called when the end of an element has been detected.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div><br />
</pre><p>Called when the document start being processed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><br />
<h3><a name="startElementNsSAX2Func" id="startElementNsSAX2Func"></a>Function type: startElementNsSAX2Func</h3><pre class="programlisting">Function type: startElementNsSAX2Func
void startElementNsSAX2Func (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br /> int nb_namespaces, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br /> int nb_attributes, <br /> int nb_defaulted, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** attributes)
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><br />
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><br />
<h3><a name="startElementSAXFunc" id="startElementSAXFunc"></a>Function type: startElementSAXFunc</h3><pre class="programlisting">Function type: startElementSAXFunc
void startElementSAXFunc (void * ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** atts)
</pre><p>Called when an opening tag has been processed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div><br />
</pre><p>Allocate and initialize a new parser context.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> or NULL</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemory" id="xmlParseBalancedChunkMemory"></a>Function: xmlParseBalancedChunkMemory</h3><pre class="programlisting">int xmlParseBalancedChunkMemory (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data, <br /> int depth, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
</pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemoryRecover" id="xmlParseBalancedChunkMemoryRecover"></a>Function: xmlParseBalancedChunkMemoryRecover</h3><pre class="programlisting">int xmlParseBalancedChunkMemoryRecover (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data, <br /> int depth, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br /> int recover)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemoryRecover" id="xmlParseBalancedChunkMemoryRecover"></a>Function: xmlParseBalancedChunkMemoryRecover</h3><pre class="programlisting">int xmlParseBalancedChunkMemoryRecover (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data, <br /> int depth, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br /> int recover)<br />
</pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div><h3><a name="xmlParseChunk" id="xmlParseChunk"></a>Function: xmlParseChunk</h3><pre class="programlisting">int xmlParseChunk (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> const char * chunk, <br /> int size, <br /> int terminate)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div><h3><a name="xmlParseChunk" id="xmlParseChunk"></a>Function: xmlParseChunk</h3><pre class="programlisting">int xmlParseChunk (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> const char * chunk, <br /> int size, <br /> int terminate)<br />
</pre><p>Parse a Chunk of memory</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>chunk</tt></i>:</span></td><td>an char array</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the size in byte of the chunk</td></tr><tr><td><span class="term"><i><tt>terminate</tt></i>:</span></td><td>last chunk indicator</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>zero if no error, the <a href="libxml-xmlerror.html#xmlParserErrors">xmlParserErrors</a> otherwise.</td></tr></tbody></table></div><h3><a name="xmlParseCtxtExternalEntity" id="xmlParseCtxtExternalEntity"></a>Function: xmlParseCtxtExternalEntity</h3><pre class="programlisting">int xmlParseCtxtExternalEntity (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctx, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URL, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ID, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
</pre><p>Parse an external general entity within an existing parsing context An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
</pre><p>parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, -1 in case of error. the parser context is augmented as a result of the parsing.</td></tr></tbody></table></div><h3><a name="xmlParseExternalEntity" id="xmlParseExternalEntity"></a>Function: xmlParseExternalEntity</h3><pre class="programlisting">int xmlParseExternalEntity (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data, <br /> int depth, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URL, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ID, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
</pre><p>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseFile" id="xmlParseFile"></a>Function: xmlParseFile</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseFile (const char * filename)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseFile" id="xmlParseFile"></a>Function: xmlParseFile</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseFile (const char * filename)<br />
</pre><p>parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the resulting document tree if the file was wellformed, NULL otherwise.</td></tr></tbody></table></div><h3><a name="xmlParseInNodeContext" id="xmlParseInNodeContext"></a>Function: xmlParseInNodeContext</h3><pre class="programlisting"><a href="libxml-xmlerror.html#xmlParserErrors">xmlParserErrors</a> xmlParseInNodeContext (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> const char * data, <br /> int datalen, <br /> int options, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
</pre><p>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node. The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
<h3><a name="htmlCreateFileParserCtxt" id="htmlCreateFileParserCtxt"></a>Function: htmlCreateFileParserCtxt</h3><pre class="programlisting"><a href="libxml-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlCreateFileParserCtxt (const char * filename, <br /> const char * encoding)<br />
</pre><p>Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>a free form C string describing the HTML document encoding, or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new parser context or NULL</td></tr></tbody></table></div><h3><a name="htmlInitAutoClose" id="htmlInitAutoClose"></a>Function: htmlInitAutoClose</h3><pre class="programlisting">void htmlInitAutoClose (void)<br />
-</pre><p>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</p>
+</pre><p>This is a no-op now.</p>
<h3><a name="inputPop" id="inputPop"></a>Function: inputPop</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> inputPop (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>Pops the top parser input from the input stack</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the input just removed</td></tr></tbody></table></div><h3><a name="inputPush" id="inputPush"></a>Function: inputPush</h3><pre class="programlisting">int inputPush (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)<br />
</pre><p>Callback function used when one needs to be able to track back the provenance of a chunk of nodes inherited from an entity replacement.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ent</tt></i>:</span></td><td>the entity</td></tr><tr><td><span class="term"><i><tt>firstNode</tt></i>:</span></td><td>the fist node in the chunk</td></tr><tr><td><span class="term"><i><tt>lastNode</tt></i>:</span></td><td>the last nod in the chunk</td></tr></tbody></table></div><br />
<h3><a name="xmlErrMemory" id="xmlErrMemory"></a>Function: xmlErrMemory</h3><pre class="programlisting">void xmlErrMemory (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> const char * extra)<br />
</pre><p>Handle a redefinition of <a href="libxml-SAX.html#attribute">attribute</a> error</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra informations</td></tr></tbody></table></div><h3><a name="xmlFreeInputStream" id="xmlFreeInputStream"></a>Function: xmlFreeInputStream</h3><pre class="programlisting">void xmlFreeInputStream (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra information</td></tr></tbody></table></div><h3><a name="xmlFreeInputStream" id="xmlFreeInputStream"></a>Function: xmlFreeInputStream</h3><pre class="programlisting">void xmlFreeInputStream (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
</pre><p>Free up an input stream.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a></td></tr></tbody></table></div><h3><a name="xmlHandleEntity" id="xmlHandleEntity"></a>Function: xmlHandleEntity</h3><pre class="programlisting">void xmlHandleEntity (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity)<br />
</pre><p>Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the value parsed (as an int), 0 in case of error</td></tr></tbody></table></div><h3><a name="xmlParseComment" id="xmlParseComment"></a>Function: xmlParseComment</h3><pre class="programlisting">void xmlParseComment (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>Skip an XML (SGML) <a href="libxml-SAX.html#comment">comment</a> <!-- .... --> The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div><h3><a name="xmlParseContent" id="xmlParseContent"></a>Function: xmlParseContent</h3><pre class="programlisting">void xmlParseContent (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
-</pre><p>Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
+</pre><p>Parse a content sequence. Stops at EOF or '</'. [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div><h3><a name="xmlParseDefaultDecl" id="xmlParseDefaultDecl"></a>Function: xmlParseDefaultDecl</h3><pre class="programlisting">int xmlParseDefaultDecl (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** value)<br />
</pre><p>Parse an <a href="libxml-SAX.html#attribute">attribute</a> default declaration [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the <a href="libxml-SAX.html#attribute">attribute</a> must be specified for all elements of the type in the attribute-list declaration. [ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared <a href="libxml-SAX.html#attribute">attribute</a> type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an <a href="libxml-SAX.html#attribute">attribute</a> has a default value declared with the #FIXED keyword, instances of that <a href="libxml-SAX.html#attribute">attribute</a> must match the default value. [ WFC: No < in Attribute Values ] handled in xmlParseAttValue()</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>Receive a possible fixed default value for the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, <a href="libxml-tree.html#XML_ATTRIBUTE_IMPLIED">XML_ATTRIBUTE_IMPLIED</a> or XML_ATTRIBUTE_FIXED.</td></tr></tbody></table></div><h3><a name="xmlParseDocTypeDecl" id="xmlParseDocTypeDecl"></a>Function: xmlParseDocTypeDecl</h3><pre class="programlisting">void xmlParseDocTypeDecl (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGGetParserErrors" id="xmlRelaxNGGetParserErrors"></a>Function: xmlRelaxNGGetParserErrors</h3><pre class="programlisting">int xmlRelaxNGGetParserErrors (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br /> void ** ctx)<br />
</pre><p>Get the callback information used to handle errors for a validation context</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGGetValidErrors" id="xmlRelaxNGGetValidErrors"></a>Function: xmlRelaxNGGetValidErrors</h3><pre class="programlisting">int xmlRelaxNGGetValidErrors (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br /> void ** ctx)<br />
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlRelaxNGInitTypes" id="xmlRelaxNGInitTypes"></a>Function: xmlRelaxNGInitTypes</h3><pre class="programlisting">int xmlRelaxNGInitTypes (void)<br />
</pre><p>Initialize the default type libraries.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGNewDocParserCtxt" id="xmlRelaxNGNewDocParserCtxt"></a>Function: xmlRelaxNGNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> xmlRelaxNGNewDocParserCtxt (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetParserStructuredErrors" id="xmlRelaxNGSetParserStructuredErrors"></a>Function: xmlRelaxNGSetParserStructuredErrors</h3><pre class="programlisting">void xmlRelaxNGSetParserStructuredErrors (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br /> void * ctx)<br />
</pre><p>Set the callback functions used to handle errors for a parsing context</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetValidErrors" id="xmlRelaxNGSetValidErrors"></a>Function: xmlRelaxNGSetValidErrors</h3><pre class="programlisting">void xmlRelaxNGSetValidErrors (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br /> <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br /> void * ctx)<br />
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetValidStructuredErrors" id="xmlRelaxNGSetValidStructuredErrors"></a>Function: xmlRelaxNGSetValidStructuredErrors</h3><pre class="programlisting">void xmlRelaxNGSetValidStructuredErrors (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br /> void * ctx)<br />
</pre><p>Set the structured error callback</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGValidateDoc" id="xmlRelaxNGValidateDoc"></a>Function: xmlRelaxNGValidateDoc</h3><pre class="programlisting">int xmlRelaxNGValidateDoc (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
void xmlRelaxNGValidityWarningFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
</pre><p>Signature of a warning callback from a Relax-NG validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
<h3><a name="xmlRelaxParserSetFlag" id="xmlRelaxParserSetFlag"></a>Function: xmlRelaxParserSetFlag</h3><pre class="programlisting">int xmlRelaxParserSetFlag (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br /> int flags)<br />
-</pre><p>Semi private function used to pass informations to a parser context which are a combination of <a href="libxml-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
+</pre><p>Semi private function used to pass information to a parser context which are a combination of <a href="libxml-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a RelaxNG parser context</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of flags values</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if success and -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
struct _xmlDoc * doc : the containing document
<a href="libxml-tree.html#xmlNs">xmlNs</a> * ns : pointer to the associated namespace
<a href="libxml-tree.html#xmlAttributeType">xmlAttributeType</a> atype : the <a href="libxml-SAX.html#attribute">attribute</a> type if validating
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
}</pre><h3><a name="xmlAttribute" id="xmlAttribute">Structure xmlAttribute</a></h3><pre class="programlisting">Structure xmlAttribute<br />struct _xmlAttribute {
void * _private : application data
<a href="libxml-tree.html#xmlElementType">xmlElementType</a> type : XML_ATTRIBUTE_DECL, must be second !
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URL : The URI for that document
int charset : Internal flag for charset handling, act
struct _xmlDict * dict : dict used to allocate names or NULL
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
int parseFlags : set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used to parse th
int properties : set of <a href="libxml-tree.html#xmlDocProperties">xmlDocProperties</a> for this docume
}</pre><h3>Enum <a name="xmlDocProperties" id="xmlDocProperties">xmlDocProperties</a></h3><pre class="programlisting">Enum xmlDocProperties {
<a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content : the content
struct _xmlAttr * properties : properties list
<a href="libxml-tree.html#xmlNs">xmlNs</a> * nsDef : namespace definitions on this node
- void * psvi : for type/PSVI informations
+ void * psvi : for type/PSVI information
unsigned short line : line number
unsigned short extra : extra data for XPath/XSLT
}</pre><h3><a name="xmlNotation" id="xmlNotation">Structure xmlNotation</a></h3><pre class="programlisting">Structure xmlNotation<br />struct _xmlNotation {
int nameNr : Depth of the parsing stack
int nameMax : Max depth of the parsing stack
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * * nameTab : array of nodes
- long nbChars : number of <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> processed
+ long nbChars : unused
long checkIndex : used by progressive parsing lookup
int keepBlanks : ugly but ...
int disableSAX : SAX callbacks are disabled
int nsMax : the size of the arrays
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * * nsTab : the array of prefix/namespace name
int * attallocs : which <a href="libxml-SAX.html#attribute">attribute</a> were allocated
- void * * pushTab : array of data for push
+ <a href="libxml-parser.html#xmlStartTag">xmlStartTag</a> * pushTab : array of data for push
<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> attsDefault : defaulted attributes if any
<a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a> attsSpecial : non-CDATA attributes if any
int nsWellFormed : is the document XML Namespace okay
int freeElemsNr : number of freed element nodes
<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> freeElems : List of freed element nodes
int freeAttrsNr : number of freed attributes nodes
- <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error informations for th
+ <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error information for the
<a href="libxml-xmlerror.html#xmlError">xmlError</a> lastError
<a href="libxml-parser.html#xmlParserMode">xmlParserMode</a> parseMode : the parser mode
unsigned long nbentities : number of entities references
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td>namespace if any</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the node name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the XML text content if any</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocPI" id="xmlNewDocPI"></a>Function: xmlNewDocPI</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlNewDocPI (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
</pre><p>Creation of a processing instruction element.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the target document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the processing instruction name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the PI content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocProp" id="xmlNewDocProp"></a>Function: xmlNewDocProp</h3><pre class="programlisting"><a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> xmlNewDocProp (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value)<br />
-</pre><p>Create a new property carried by a document.</p>
+</pre><p>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need entities support.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the value of the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the <a href="libxml-SAX.html#attribute">attribute</a></td></tr></tbody></table></div><h3><a name="xmlNewDocRawNode" id="xmlNewDocRawNode"></a>Function: xmlNewDocRawNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlNewDocRawNode (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
</pre><p>Creation of a new node element within a document. @ns and @content are optional (NULL).</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td>namespace if any</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the node name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the text content if any</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocText" id="xmlNewDocText"></a>Function: xmlNewDocText</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlNewDocText (const <a href="libxml-tree.html#xmlDoc">xmlDoc</a> * doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessFlagsData" id="xmlXIncludeProcessFlagsData"></a>Function: xmlXIncludeProcessFlagsData</h3><pre class="programlisting">int xmlXIncludeProcessFlagsData (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> int flags, <br /> void * data)<br />
</pre><p>Implement the XInclude substitution on the XML document @doc</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>application data that will be passed to the parser context in the _private field of the parser context(s)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessNode" id="xmlXIncludeProcessNode"></a>Function: xmlXIncludeProcessNode</h3><pre class="programlisting">int xmlXIncludeProcessNode (<a href="libxml-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
-</pre><p>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</p>
+</pre><p>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an existing XInclude context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessTree" id="xmlXIncludeProcessTree"></a>Function: xmlXIncludeProcessTree</h3><pre class="programlisting">int xmlXIncludeProcessTree (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree)<br />
</pre><p>Implement the XInclude substitution for the given subtree</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessTreeFlags" id="xmlXIncludeProcessTreeFlags"></a>Function: xmlXIncludeProcessTreeFlags</h3><pre class="programlisting">int xmlXIncludeProcessTreeFlags (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br /> int flags)<br />
<pre class="programlisting">int <a href="#xmlParserInputBufferPush">xmlParserInputBufferPush</a> (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br /> int len, <br /> const char * buf)</pre>
<pre class="programlisting">int <a href="#xmlParserInputBufferRead">xmlParserInputBufferRead</a> (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br /> int len)</pre>
<pre class="programlisting">int <a href="#xmlPopInputCallbacks">xmlPopInputCallbacks</a> (void)</pre>
+<pre class="programlisting">int <a href="#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a> (void)</pre>
<pre class="programlisting">void <a href="#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a> (void)</pre>
<pre class="programlisting">void <a href="#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a> (void)</pre>
<pre class="programlisting">void <a href="#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a> (void)</pre>
</pre><p>Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a buffered parser input</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>indicative value of the amount of chars to read</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of chars read and stored in the buffer, or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlPopInputCallbacks" id="xmlPopInputCallbacks"></a>Function: xmlPopInputCallbacks</h3><pre class="programlisting">int xmlPopInputCallbacks (void)<br />
</pre><p>Clear the top input callback from the input stack. this includes the compiled-in I/O.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegisterDefaultInputCallbacks" id="xmlRegisterDefaultInputCallbacks"></a>Function: xmlRegisterDefaultInputCallbacks</h3><pre class="programlisting">void xmlRegisterDefaultInputCallbacks (void)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlPopOutputCallbacks" id="xmlPopOutputCallbacks"></a>Function: xmlPopOutputCallbacks</h3><pre class="programlisting">int xmlPopOutputCallbacks (void)<br />
+</pre><p>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of output callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegisterDefaultInputCallbacks" id="xmlRegisterDefaultInputCallbacks"></a>Function: xmlRegisterDefaultInputCallbacks</h3><pre class="programlisting">void xmlRegisterDefaultInputCallbacks (void)<br />
</pre><p>Registers the default compiled-in I/O handlers.</p>
<h3><a name="xmlRegisterDefaultOutputCallbacks" id="xmlRegisterDefaultOutputCallbacks"></a>Function: xmlRegisterDefaultOutputCallbacks</h3><pre class="programlisting">void xmlRegisterDefaultOutputCallbacks (void)<br />
</pre><p>Registers the default compiled-in I/O handlers.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message to display/transmit</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message display</td></tr></tbody></table></div><h3><a name="xmlParserPrintFileContext" id="xmlParserPrintFileContext"></a>Function: xmlParserPrintFileContext</h3><pre class="programlisting">void xmlParserPrintFileContext (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
</pre><p>Displays current context within the input content for error tracking</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div><h3><a name="xmlParserPrintFileInfo" id="xmlParserPrintFileInfo"></a>Function: xmlParserPrintFileInfo</h3><pre class="programlisting">void xmlParserPrintFileInfo (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
-</pre><p>Displays the associated file and line informations for the current input</p>
+</pre><p>Displays the associated file and line information for the current input</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div><h3><a name="xmlParserValidityError" id="xmlParserValidityError"></a>Function: xmlParserValidityError</h3><pre class="programlisting">void xmlParserValidityError (void * ctx, <br /> const char * msg, <br /> ... ...)<br />
</pre><p>Display and format an validity error messages, gives file, line, position and extra parameters.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message to display/transmit</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message display</td></tr></tbody></table></div><h3><a name="xmlParserValidityWarning" id="xmlParserValidityWarning"></a>Function: xmlParserValidityWarning</h3><pre class="programlisting">void xmlParserValidityWarning (void * ctx, <br /> const char * msg, <br /> ... ...)<br />
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Module xmlexports from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlexports from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlerror.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlerror.html">xmlerror</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlmemory.html">xmlmemory</a></th><td><a accesskey="n" href="libxml-xmlmemory.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>macros for marking symbols as exportable/importable. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a></pre><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a></pre><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a></pre><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a></pre><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a></pre><h2>Description</h2>
+ </style><title>Module xmlexports from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlexports from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlerror.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlerror.html">xmlerror</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlmemory.html">xmlmemory</a></th><td><a accesskey="n" href="libxml-xmlmemory.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>macros for marking symbols as exportable/importable. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a></pre><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a></pre><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a></pre><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a></pre><pre class="programlisting">#define <a href="#XMLPUBLIC">XMLPUBLIC</a></pre><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a></pre><h2>Description</h2>
<h3><a name="LIBXML_DLL_IMPORT" id="LIBXML_DLL_IMPORT"></a>Macro: LIBXML_DLL_IMPORT</h3><pre>#define LIBXML_DLL_IMPORT</pre><p></p>
-<h3><a name="XMLCALL" id="XMLCALL"></a>Macro: XMLCALL</h3><pre>#define XMLCALL</pre><p></p>
-<h3><a name="XMLCDECL" id="XMLCDECL"></a>Macro: XMLCDECL</h3><pre>#define XMLCDECL</pre><p></p>
-<h3><a name="XMLPUBFUN" id="XMLPUBFUN"></a>Macro: XMLPUBFUN</h3><pre>#define XMLPUBFUN</pre><p></p>
-<h3><a name="XMLPUBVAR" id="XMLPUBVAR"></a>Macro: XMLPUBVAR</h3><pre>#define XMLPUBVAR</pre><p></p>
+<h3><a name="XMLCALL" id="XMLCALL"></a>Macro: XMLCALL</h3><pre>#define XMLCALL</pre><p>Macro which declares the calling convention for exported functions</p>
+<h3><a name="XMLCDECL" id="XMLCDECL"></a>Macro: XMLCDECL</h3><pre>#define XMLCDECL</pre><p>Macro which declares the calling convention for exported functions that use '...'.</p>
+<h3><a name="XMLPUBFUN" id="XMLPUBFUN"></a>Macro: XMLPUBFUN</h3><pre>#define XMLPUBFUN</pre><p>Macro which declares an exportable function</p>
+<h3><a name="XMLPUBLIC" id="XMLPUBLIC"></a>Macro: XMLPUBLIC</h3><pre>#define XMLPUBLIC</pre><p>Macro which declares a public symbol</p>
+<h3><a name="XMLPUBVAR" id="XMLPUBVAR"></a>Macro: XMLPUBVAR</h3><pre>#define XMLPUBVAR</pre><p>Macro which declares an exportable variable</p>
<p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node was read successfully, 0 if there is no more nodes to read, or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderNodeType" id="xmlTextReaderNodeType"></a>Function: xmlTextReaderNodeType</h3><pre class="programlisting">int xmlTextReaderNodeType (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
</pre><p>Get the node type of the current node Reference: http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlReaderTypes">xmlReaderTypes</a> of the current node or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderNormalization" id="xmlTextReaderNormalization"></a>Function: xmlTextReaderNormalization</h3><pre class="programlisting">int xmlTextReaderNormalization (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
-</pre><p>The value indicating whether to normalize white space and <a href="libxml-SAX.html#attribute">attribute</a> values. Since <a href="libxml-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &#0; is of course not supported either.</p>
+</pre><p>The value indicating whether to normalize white space and <a href="libxml-SAX.html#attribute">attribute</a> values. Since <a href="libxml-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &#0; is of course not supported either.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlTextReaderPrefix" id="xmlTextReaderPrefix"></a>Function: xmlTextReaderPrefix</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlTextReaderPrefix (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
</pre><p>A shorthand <a href="libxml-SAX.html#reference">reference</a> to the namespace associated with the node.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the prefix or NULL if not available, if non NULL it need to be freed by the caller.</td></tr></tbody></table></div><h3><a name="xmlTextReaderPreserve" id="xmlTextReaderPreserve"></a>Function: xmlTextReaderPreserve</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlTextReaderPreserve (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
void xmlRegExecCallbacks (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * token, <br /> void * transdata, <br /> void * inputdata)
</pre><p>Callback function when doing a transition in the automata</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>the regular expression context</td></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td>the current token string</td></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td>transition data</td></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td>input data</td></tr></tbody></table></div><br />
<h3><a name="xmlRegExecErrInfo" id="xmlRegExecErrInfo"></a>Function: xmlRegExecErrInfo</h3><pre class="programlisting">int xmlRegExecErrInfo (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** string, <br /> int * nbval, <br /> int * nbneg, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** values, <br /> int * terminal)<br />
-</pre><p>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context generating an error</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>return value for the error string</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecNextValues" id="xmlRegExecNextValues"></a>Function: xmlRegExecNextValues</h3><pre class="programlisting">int xmlRegExecNextValues (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br /> int * nbval, <br /> int * nbneg, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** values, <br /> int * terminal)<br />
-</pre><p>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecPushString" id="xmlRegExecPushString"></a>Function: xmlRegExecPushString</h3><pre class="programlisting">int xmlRegExecPushString (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value, <br /> void * data)<br />
</pre><p>Push one input token in the execution context</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context or NULL to indicate the end</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>a string token input</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>data associated to the token to reuse in callbacks</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecPushString2" id="xmlRegExecPushString2"></a>Function: xmlRegExecPushString2</h3><pre class="programlisting">int xmlRegExecPushString2 (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value2, <br /> void * data)<br />
<pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> <a href="#xmlSaveToFd">xmlSaveToFd</a> (int fd, <br /> const char * encoding, <br /> int options)</pre>
<pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> <a href="#xmlSaveToFilename">xmlSaveToFilename</a> (const char * filename, <br /> const char * encoding, <br /> int options)</pre>
<pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> <a href="#xmlSaveToIO">xmlSaveToIO</a> (<a href="libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a> iowrite, <br /> <a href="libxml-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a> ioclose, <br /> void * ioctx, <br /> const char * encoding, <br /> int options)</pre>
-<pre class="programlisting">long <a href="#xmlSaveTree">xmlSaveTree</a> (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)</pre>
+<pre class="programlisting">long <a href="#xmlSaveTree">xmlSaveTree</a> (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur)</pre>
<h2>Description</h2>
<h3><a name="xmlSaveCtxt" id="xmlSaveCtxt">Structure xmlSaveCtxt</a></h3><pre class="programlisting">Structure xmlSaveCtxt<br />struct _xmlSaveCtxt {
The content of this structure is not made public by the API.
</pre><p>Create a document saving context serializing to a filename or possibly to an URL (but this is less reliable) with the encoding and the options given.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>a file name or an URL</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveToIO" id="xmlSaveToIO"></a>Function: xmlSaveToIO</h3><pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> xmlSaveToIO (<a href="libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a> iowrite, <br /> <a href="libxml-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a> ioclose, <br /> void * ioctx, <br /> const char * encoding, <br /> int options)<br />
</pre><p>Create a document saving context serializing to a file descriptor with the encoding and the options given</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveTree" id="xmlSaveTree"></a>Function: xmlSaveTree</h3><pre class="programlisting">long xmlSaveTree (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveTree" id="xmlSaveTree"></a>Function: xmlSaveTree</h3><pre class="programlisting">long xmlSaveTree (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br />
</pre><p>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the top node of the subtree to save</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr></tbody></table></div><h3><a name="xmlSchemaGetParserErrors" id="xmlSchemaGetParserErrors"></a>Function: xmlSchemaGetParserErrors</h3><pre class="programlisting">int xmlSchemaGetParserErrors (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br /> void ** ctx)<br />
</pre><p>Get the callback information used to handle errors for a parser context</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XMl-Schema parser context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlSchemaGetValidErrors" id="xmlSchemaGetValidErrors"></a>Function: xmlSchemaGetValidErrors</h3><pre class="programlisting">int xmlSchemaGetValidErrors (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br /> void ** ctx)<br />
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XML-Schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlSchemaIsValid" id="xmlSchemaIsValid"></a>Function: xmlSchemaIsValid</h3><pre class="programlisting">int xmlSchemaIsValid (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
</pre><p>Check if any error was detected during validation.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid so far, 0 if errors were detected, and -1 in case of internal error.</td></tr></tbody></table></div><h3><a name="xmlSchemaNewDocParserCtxt" id="xmlSchemaNewDocParserCtxt"></a>Function: xmlSchemaNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> xmlSchemaNewDocParserCtxt (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlSchemaSetParserStructuredErrors" id="xmlSchemaSetParserStructuredErrors"></a>Function: xmlSchemaSetParserStructuredErrors</h3><pre class="programlisting">void xmlSchemaSetParserStructuredErrors (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br /> void * ctx)<br />
</pre><p>Set the structured error callback</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidErrors" id="xmlSchemaSetValidErrors"></a>Function: xmlSchemaSetValidErrors</h3><pre class="programlisting">void xmlSchemaSetValidErrors (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br /> <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br /> void * ctx)<br />
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidOptions" id="xmlSchemaSetValidOptions"></a>Function: xmlSchemaSetValidOptions</h3><pre class="programlisting">int xmlSchemaSetValidOptions (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> int options)<br />
</pre><p>Sets the options to be used during the validation.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a combination of <a href="libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of an API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidStructuredErrors" id="xmlSchemaSetValidStructuredErrors"></a>Function: xmlSchemaSetValidStructuredErrors</h3><pre class="programlisting">void xmlSchemaSetValidStructuredErrors (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br /> void * ctx)<br />
</pre><p>Signature of an error callback from an XSD validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
<h3><a name="xmlSchemaValidityLocatorFunc" id="xmlSchemaValidityLocatorFunc"></a>Function type: xmlSchemaValidityLocatorFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityLocatorFunc
int xmlSchemaValidityLocatorFunc (void * ctx, <br /> const char ** file, <br /> unsigned long * line)
-</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div><br />
+</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div><br />
<h3><a name="xmlSchemaValidityWarningFunc" id="xmlSchemaValidityWarningFunc"></a>Function type: xmlSchemaValidityWarningFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityWarningFunc
void xmlSchemaValidityWarningFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
</pre><p>Signature of a warning callback from an XSD validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double;background: #EECFA1}
- </style><title>Module xmlversion from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlversion from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlunicode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlunicode.html">xmlunicode</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlwriter.html">xmlwriter</a></th><td><a accesskey="n" href="libxml-xmlwriter.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>compile-time version informations for the XML library </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a></pre><pre class="programlisting">#define <a href="#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_ALLOC_SIZE">LIBXML_ATTR_ALLOC_SIZE</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_FORMAT">LIBXML_ATTR_FORMAT</a></pre><pre class="programlisting">#define <a href="#LIBXML_AUTOMATA_ENABLED">LIBXML_AUTOMATA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_C14N_ENABLED">LIBXML_C14N_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_CATALOG_ENABLED">LIBXML_CATALOG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOTTED_VERSION">LIBXML_DOTTED_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_EXPR_ENABLED">LIBXML_EXPR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTTP_ENABLED">LIBXML_HTTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICU_ENABLED">LIBXML_ICU_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_OUTPUT_ENABLED">LIBXML_OUTPUT_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PATTERN_ENABLED">LIBXML_PATTERN_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ALLOC_ENABLED">LIBXML_THREAD_ALLOC_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VALID_ENABLED">LIBXML_VALID_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION">LIBXML_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_STRING">LIBXML_VERSION_STRING</a></pre><pre class="programlisting">#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPATH_ENABLED">LIBXML_XPATH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPTR_ENABLED">LIBXML_XPTR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a></pre><pre class="programlisting">#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a></pre><pre class="programlisting">#define <a href="#WITH_TRIO">WITH_TRIO</a></pre><pre class="programlisting">void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version)</pre>
+ </style><title>Module xmlversion from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlversion from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlunicode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlunicode.html">xmlunicode</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlwriter.html">xmlwriter</a></th><td><a accesskey="n" href="libxml-xmlwriter.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>compile-time version information for the XML library </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a></pre><pre class="programlisting">#define <a href="#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_ALLOC_SIZE">LIBXML_ATTR_ALLOC_SIZE</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_FORMAT">LIBXML_ATTR_FORMAT</a></pre><pre class="programlisting">#define <a href="#LIBXML_AUTOMATA_ENABLED">LIBXML_AUTOMATA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_C14N_ENABLED">LIBXML_C14N_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_CATALOG_ENABLED">LIBXML_CATALOG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOTTED_VERSION">LIBXML_DOTTED_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_EXPR_ENABLED">LIBXML_EXPR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTTP_ENABLED">LIBXML_HTTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICU_ENABLED">LIBXML_ICU_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_OUTPUT_ENABLED">LIBXML_OUTPUT_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PATTERN_ENABLED">LIBXML_PATTERN_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ALLOC_ENABLED">LIBXML_THREAD_ALLOC_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VALID_ENABLED">LIBXML_VALID_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION">LIBXML_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_STRING">LIBXML_VERSION_STRING</a></pre><pre class="programlisting">#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPATH_ENABLED">LIBXML_XPATH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPTR_ENABLED">LIBXML_XPTR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a></pre><pre class="programlisting">#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a></pre><pre class="programlisting">#define <a href="#WITH_TRIO">WITH_TRIO</a></pre><pre class="programlisting">void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version)</pre>
<h2>Description</h2>
<h3><a name="ATTRIBUTE_UNUSED" id="ATTRIBUTE_UNUSED"></a>Macro: ATTRIBUTE_UNUSED</h3><pre>#define ATTRIBUTE_UNUSED</pre><p>Macro used to signal to GCC unused function parameters</p>
<h3><a name="DEBUG_MEMORY_LOCATION" id="DEBUG_MEMORY_LOCATION"></a>Macro: DEBUG_MEMORY_LOCATION</h3><pre>#define DEBUG_MEMORY_LOCATION</pre><p>Whether the memory debugging is configured in</p>
unsigned long opLimit
unsigned long opCount
int depth
- int maxDepth
- int maxParserDepth
}</pre><h3>Enum <a name="xmlXPathError" id="xmlXPathError">xmlXPathError</a></h3><pre class="programlisting">Enum xmlXPathError {
<a name="XPATH_EXPRESSION_OK" id="XPATH_EXPRESSION_OK">XPATH_EXPRESSION_OK</a> = 0
<a name="XPATH_NUMBER_ERROR" id="XPATH_NUMBER_ERROR">XPATH_NUMBER_ERROR</a> = 1
<?xml version="1.0" encoding="utf-8"?>
-<book xmlns="http://www.devhelp.net/book" title="Gnome XML Library Reference Manual " link="index.html" author="" name="libxml">
+<book xmlns="http://www.devhelp.net/book" title="Gnome XML Library Reference Manual " link="index.html" version="2" author="" name="libxml">
<chapters>
<sub name="Libxml Programming Notes" link="ch01.html">
<sub name="testOOMlib" link="libxml-testOOMlib.html"/>
# Bye
#
# Then run the script in the doc subdir, it will create the symbols and
-# word tables and populate them with informations extracted from
+# word tables and populate them with information extracted from
# the libxml2-api.xml API description, and make them accessible read-only
# by nobody@loaclhost the user expected to be Apache's one
#
try:
doc = loadAPI(API)
ret = analyzeAPI(doc)
- print "Analyzed %d blocs" % (ret)
+ print "Analyzed %d blocks" % (ret)
doc.freeDoc()
except:
print "Failed to parse and analyze %s" % (API)
<exports symbol='xmlParserNodeInfoSeq' type='typedef'/>
<exports symbol='xmlFeature' type='typedef'/>
<exports symbol='xmlParserMode' type='typedef'/>
+ <exports symbol='xmlStartTag' type='typedef'/>
<exports symbol='xmlParserOption' type='typedef'/>
<exports symbol='xmlSAXHandlerV1Ptr' type='typedef'/>
<exports symbol='xmlParserNodeInfo' type='typedef'/>
<exports symbol='xmlInputMatchCallback' type='function'/>
<exports symbol='xmlRegisterDefaultOutputCallbacks' type='function'/>
<exports symbol='xmlFileClose' type='function'/>
+ <exports symbol='xmlPopOutputCallbacks' type='function'/>
<exports symbol='xmlOutputMatchCallback' type='function'/>
<exports symbol='xmlParserInputBufferPush' type='function'/>
<exports symbol='xmlIOFTPRead' type='function'/>
<file name='xmlexports'>
<summary>macros for marking symbols as exportable/importable.</summary>
<description>macros for marking symbols as exportable/importable. </description>
- <author>Igor Zlatovic <igor@zlatkovic.com> </author>
- <exports symbol='XMLCALL' type='macro'/>
- <exports symbol='XMLPUBVAR' type='macro'/>
<exports symbol='XMLCDECL' type='macro'/>
- <exports symbol='XMLPUBFUN' type='macro'/>
+ <exports symbol='XMLPUBLIC' type='macro'/>
+ <exports symbol='XMLPUBVAR' type='macro'/>
<exports symbol='LIBXML_DLL_IMPORT' type='macro'/>
+ <exports symbol='XMLCALL' type='macro'/>
+ <exports symbol='XMLPUBFUN' type='macro'/>
</file>
<file name='xmlmemory'>
<summary>interface for the memory allocator</summary>
<exports symbol='xmlUCSIsCatMe' type='function'/>
</file>
<file name='xmlversion'>
- <summary>compile-time version informations</summary>
- <description>compile-time version informations for the XML library </description>
+ <summary>compile-time version information</summary>
+ <description>compile-time version information for the XML library </description>
<author>Daniel Veillard </author>
<exports symbol='LIBXML_VERSION_EXTRA' type='macro'/>
<exports symbol='LIBXML_MODULES_ENABLED' type='macro'/>
<info>Macro defining "xpointer"</info>
</macro>
<macro name='XMLCALL' file='xmlexports'>
+ <info>Macro which declares the calling convention for exported functions</info>
</macro>
<macro name='XMLCDECL' file='xmlexports'>
+ <info>Macro which declares the calling convention for exported functions that use '...'.</info>
</macro>
<macro name='XMLPUBFUN' file='xmlexports'>
+ <info>Macro which declares an exportable function</info>
+ </macro>
+ <macro name='XMLPUBLIC' file='xmlexports'>
+ <info>Macro which declares a public symbol</info>
</macro>
<macro name='XMLPUBVAR' file='xmlexports'>
+ <info>Macro which declares an exportable variable</info>
</macro>
<macro name='XML_CAST_FPTR' file='hash'>
<info>Macro to do a casting from an object pointer to a function pointer without encountering a warning from gcc #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) This macro violated ISO C aliasing rules (gcc4 on s390 broke) so it is disabled now</info>
<field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
<field name='ns' type='xmlNs *' info=' pointer to the associated namespace'/>
<field name='atype' type='xmlAttributeType' info=' the attribute type if validating'/>
- <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+ <field name='psvi' type='void *' info=' for type/PSVI information'/>
</struct>
<typedef name='xmlAttrPtr' file='tree' type='xmlAttr *'/>
<struct name='xmlAttribute' file='tree' type='struct _xmlAttribute'>
<field name='charset' type='int' info=' Internal flag for charset handling,
actually an xmlCharEncoding'/>
<field name='dict' type='struct _xmlDict *' info=' dict used to allocate names or NULL'/>
- <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+ <field name='psvi' type='void *' info=' for type/PSVI information'/>
<field name='parseFlags' type='int' info=' set of xmlParserOption used to parse the
document'/>
<field name='properties' type='int' info=' set of xmlDocProperties for this document
<field name='content' type='xmlChar *' info=' the content'/>
<field name='properties' type='struct _xmlAttr *' info=' properties list'/>
<field name='nsDef' type='xmlNs *' info=' namespace definitions on this node'/>
- <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+ <field name='psvi' type='void *' info=' for type/PSVI information'/>
<field name='line' type='unsigned short' info=' line number'/>
<field name='extra' type='unsigned short' info=' extra data for XPath/XSLT'/>
</struct>
<field name='nameNr' type='int' info=' Depth of the parsing stack'/>
<field name='nameMax' type='int' info=' Max depth of the parsing stack'/>
<field name='nameTab' type='const xmlChar * *' info=' array of nodes'/>
- <field name='nbChars' type='long' info=' number of xmlChar processed'/>
+ <field name='nbChars' type='long' info=' unused'/>
<field name='checkIndex' type='long' info=' used by progressive parsing lookup'/>
<field name='keepBlanks' type='int' info=' ugly but ...'/>
<field name='disableSAX' type='int' info=' SAX callbacks are disabled'/>
<field name='nsMax' type='int' info=' the size of the arrays'/>
<field name='nsTab' type='const xmlChar * *' info=' the array of prefix/namespace name'/>
<field name='attallocs' type='int *' info=' which attribute were allocated'/>
- <field name='pushTab' type='void * *' info=' array of data for push'/>
+ <field name='pushTab' type='xmlStartTag *' info=' array of data for push'/>
<field name='attsDefault' type='xmlHashTablePtr' info=' defaulted attributes if any'/>
<field name='attsSpecial' type='xmlHashTablePtr' info=' non-CDATA attributes if any'/>
<field name='nsWellFormed' type='int' info=' is the document XML Namespace okay'/>
<field name='freeElemsNr' type='int' info=' number of freed element nodes'/>
<field name='freeElems' type='xmlNodePtr' info=' List of freed element nodes'/>
<field name='freeAttrsNr' type='int' info=' number of freed attributes nodes'/>
- <field name='freeAttrs' type='xmlAttrPtr' info='* the complete error informations for the last error.
+ <field name='freeAttrs' type='xmlAttrPtr' info='* the complete error information for the last error.
*'/>
<field name='lastError' type='xmlError' info=''/>
<field name='parseMode' type='xmlParserMode' info=' the parser mode'/>
<field name='input' type='xmlShellReadlineFunc' info=''/>
</struct>
<typedef name='xmlShellCtxtPtr' file='debugXML' type='xmlShellCtxt *'/>
+ <struct name='xmlStartTag' file='parser' type='struct _xmlStartTag'/>
<struct name='xmlStreamCtxt' file='pattern' type='struct _xmlStreamCtxt'/>
<typedef name='xmlStreamCtxtPtr' file='pattern' type='xmlStreamCtxt *'/>
<struct name='xmlTextReader' file='xmlreader' type='struct _xmlTextReader'/>
<field name='opLimit' type='unsigned long' info=''/>
<field name='opCount' type='unsigned long' info=''/>
<field name='depth' type='int' info=''/>
- <field name='maxDepth' type='int' info=''/>
- <field name='maxParserDepth' type='int' info=''/>
</struct>
<typedef name='xmlXPathContextPtr' file='xpath' type='xmlXPathContext *'/>
<typedef name='xmlXPathError' file='xpath' type='enum'/>
<function name='UTF8Toisolat1' file='encoding' module='encoding'>
<cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
<info>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</info>
- <return type='int' info='the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
+ <return type='int' info='the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.'/>
<arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
<arg name='outlen' type='int *' info='the length of @out'/>
<arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
<arg name='name' type='const xmlChar *' info='The element name'/>
</function>
<functype name='endElementNsSAX2Func' file='parser' module='parser'>
- <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</info>
+ <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</info>
<return type='void'/>
<arg name='ctx' type='void *' info='the user data (XML parser context)'/>
<arg name='localname' type='const xmlChar *' info='the local name of the element'/>
<return type='void'/>
<arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
<arg name='cur' type='xmlDocPtr' info='the document'/>
- <arg name='encoding' type='const char *' info='the encoding string'/>
+ <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
<arg name='format' type='int' info='should formatting spaces been added'/>
</function>
<function name='htmlDocContentDumpOutput' file='HTMLtree' module='HTMLtree'>
<return type='void'/>
<arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
<arg name='cur' type='xmlDocPtr' info='the document'/>
- <arg name='encoding' type='const char *' info='the encoding string'/>
+ <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
</function>
<function name='htmlDocDump' file='HTMLtree' module='HTMLtree'>
<cond>defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)</cond>
</function>
<function name='htmlInitAutoClose' file='parserInternals' module='HTMLparser'>
<cond>defined(LIBXML_HTML_ENABLED)</cond>
- <info>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</info>
+ <info>This is a no-op now.</info>
<return type='void'/>
</function>
<function name='htmlIsAutoClosed' file='HTMLparser' module='HTMLparser'>
<arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
<arg name='doc' type='xmlDocPtr' info='the document'/>
<arg name='cur' type='xmlNodePtr' info='the current node'/>
- <arg name='encoding' type='const char *' info='the encoding string'/>
+ <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
<arg name='format' type='int' info='should formatting spaces been added'/>
</function>
<function name='htmlNodeDumpOutput' file='HTMLtree' module='HTMLtree'>
<arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
<arg name='doc' type='xmlDocPtr' info='the document'/>
<arg name='cur' type='xmlNodePtr' info='the current node'/>
- <arg name='encoding' type='const char *' info='the encoding string'/>
+ <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
</function>
<function name='htmlNodeStatus' file='HTMLparser' module='HTMLparser'>
<cond>defined(LIBXML_HTML_ENABLED)</cond>
</functype>
<function name='isolat1ToUTF8' file='encoding' module='encoding'>
<info>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</info>
- <return type='int' info='the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
+ <return type='int' info='the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.'/>
<arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
<arg name='outlen' type='int *' info='the length of @out'/>
<arg name='in' type='const unsigned char *' info='a pointer to an array of ISO Latin 1 chars'/>
<arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
</function>
<functype name='startElementNsSAX2Func' file='parser' module='parser'>
- <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</info>
+ <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</info>
<return type='void'/>
<arg name='ctx' type='void *' info='the user data (XML parser context)'/>
<arg name='localname' type='const xmlChar *' info='the local name of the element'/>
</function>
<function name='xmlDebugDumpString' file='debugXML' module='debugXML'>
<cond>defined(LIBXML_DEBUG_ENABLED)</cond>
- <info>Dumps informations about the string, shorten it if necessary</info>
+ <info>Dumps information about the string, shorten it if necessary</info>
<return type='void'/>
<arg name='output' type='FILE *' info='the FILE * for the output'/>
<arg name='str' type='const xmlChar *' info='the string'/>
<info>Handle a redefinition of attribute error</info>
<return type='void'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
- <arg name='extra' type='const char *' info='extra informations'/>
+ <arg name='extra' type='const char *' info='extra information'/>
</function>
<function name='xmlExpCtxtNbCons' file='xmlregexp' module='xmlregexp'>
<cond>defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)</cond>
</function>
<function name='xmlNanoFTPCleanup' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
- <info>Cleanup the FTP protocol layer. This cleanup proxy informations.</info>
+ <info>Cleanup the FTP protocol layer. This cleanup proxy information.</info>
<return type='void'/>
</function>
<function name='xmlNanoFTPClose' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Close the connection and both control and transport</info>
- <return type='int' info='-1 incase of error, 0 otherwise'/>
+ <return type='int' info='-1 in case of error, 0 otherwise'/>
<arg name='ctx' type='void *' info='an FTP context'/>
</function>
<function name='xmlNanoFTPCloseConnection' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Close the data connection from the server</info>
- <return type='int' info='-1 incase of error, 0 otherwise'/>
+ <return type='int' info='-1 in case of error, 0 otherwise'/>
<arg name='ctx' type='void *' info='an FTP context'/>
</function>
<function name='xmlNanoFTPConnect' file='nanoftp' module='nanoftp'>
<function name='xmlNanoFTPCwd' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Tries to change the remote directory</info>
- <return type='int' info='-1 incase of error, 1 if CWD worked, 0 if it failed'/>
+ <return type='int' info='-1 in case of error, 1 if CWD worked, 0 if it failed'/>
<arg name='ctx' type='void *' info='an FTP context'/>
<arg name='directory' type='const char *' info='a directory on the server'/>
</function>
<function name='xmlNanoFTPDele' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Tries to delete an item (file or directory) from server</info>
- <return type='int' info='-1 incase of error, 1 if DELE worked, 0 if it failed'/>
+ <return type='int' info='-1 in case of error, 1 if DELE worked, 0 if it failed'/>
<arg name='ctx' type='void *' info='an FTP context'/>
<arg name='file' type='const char *' info='a file or directory on the server'/>
</function>
<function name='xmlNanoFTPGet' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</info>
- <return type='int' info='-1 incase of error, 0 otherwise'/>
+ <return type='int' info='-1 in case of error, 0 otherwise'/>
<arg name='ctx' type='void *' info='an FTP context'/>
<arg name='callback' type='ftpDataCallback' info='the user callback'/>
<arg name='userData' type='void *' info='the user callback data'/>
<function name='xmlNanoFTPGetConnection' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Try to open a data connection to the server. Currently only passive mode is supported.</info>
- <return type='SOCKET' info='-1 incase of error, 0 otherwise'/>
+ <return type='SOCKET' info='-1 in case of error, 0 otherwise'/>
<arg name='ctx' type='void *' info='an FTP context'/>
</function>
<function name='xmlNanoFTPGetResponse' file='nanoftp' module='nanoftp'>
</function>
<function name='xmlNanoFTPInit' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
- <info>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</info>
+ <info>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</info>
<return type='void'/>
</function>
<function name='xmlNanoFTPList' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
<info>Do a listing on the server. All files info are passed back in the callbacks.</info>
- <return type='int' info='-1 incase of error, 0 otherwise'/>
+ <return type='int' info='-1 in case of error, 0 otherwise'/>
<arg name='ctx' type='void *' info='an FTP context'/>
<arg name='callback' type='ftpListCallback' info='the user callback'/>
<arg name='userData' type='void *' info='the user callback data'/>
</function>
<function name='xmlNanoFTPProxy' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
- <info>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</info>
+ <info>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</info>
<return type='void'/>
<arg name='host' type='const char *' info='the proxy host name'/>
<arg name='port' type='int' info='the proxy port'/>
</function>
<function name='xmlNanoFTPScanProxy' file='nanoftp' module='nanoftp'>
<cond>defined(LIBXML_FTP_ENABLED)</cond>
- <info>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</info>
+ <info>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</info>
<return type='void'/>
<arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
</function>
<function name='xmlNanoHTTPFetch' file='nanohttp' module='nanohttp'>
<cond>defined(LIBXML_HTTP_ENABLED)</cond>
<info>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</info>
- <return type='int' info='-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller'/>
+ <return type='int' info='-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller'/>
<arg name='URL' type='const char *' info='The URL to load'/>
<arg name='filename' type='const char *' info='the filename where the content should be saved'/>
<arg name='contentType' type='char **' info='if available the Content-Type information will be returned at that location'/>
</function>
<function name='xmlNanoHTTPInit' file='nanohttp' module='nanohttp'>
<cond>defined(LIBXML_HTTP_ENABLED)</cond>
- <info>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</info>
+ <info>Initialize the HTTP protocol layer. Currently it just checks for proxy information</info>
<return type='void'/>
</function>
<function name='xmlNanoHTTPMethod' file='nanohttp' module='nanohttp'>
<function name='xmlNanoHTTPSave' file='nanohttp' module='nanohttp'>
<cond>defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)</cond>
<info>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</info>
- <return type='int' info='-1 in case of failure, 0 incase of success.'/>
+ <return type='int' info='-1 in case of failure, 0 in case of success.'/>
<arg name='ctxt' type='void *' info='the HTTP context'/>
<arg name='filename' type='const char *' info='the filename where the content should be saved'/>
</function>
<function name='xmlNanoHTTPScanProxy' file='nanohttp' module='nanohttp'>
<cond>defined(LIBXML_HTTP_ENABLED)</cond>
- <info>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</info>
+ <info>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</info>
<return type='void'/>
<arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
</function>
<arg name='content' type='const xmlChar *' info='the PI content'/>
</function>
<function name='xmlNewDocProp' file='tree' module='tree'>
- <info>Create a new property carried by a document.</info>
+ <info>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need entities support.</info>
<return type='xmlAttrPtr' info='a pointer to the attribute'/>
<arg name='doc' type='xmlDocPtr' info='the document'/>
<arg name='name' type='const xmlChar *' info='the name of the attribute'/>
<cond>defined(LIBXML_SAX1_ENABLED)</cond>
<info>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
<return type='int' info='0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise'/>
- <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
- <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+ <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to (must not be NULL)'/>
+ <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
<arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
<arg name='depth' type='int' info='Used for loop detection, use 0'/>
<arg name='string' type='const xmlChar *' info='the input string in UTF8 or ISO-Latin (zero terminated)'/>
<cond>defined(LIBXML_SAX1_ENABLED)</cond>
<info>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
<return type='int' info='0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.'/>
- <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
- <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+ <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to (must not be NULL)'/>
+ <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
<arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
<arg name='depth' type='int' info='Used for loop detection, use 0'/>
<arg name='string' type='const xmlChar *' info='the input string in UTF8 or ISO-Latin (zero terminated)'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='xmlParseContent' file='parserInternals' module='parser'>
- <info>Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
+ <info>Parse a content sequence. Stops at EOF or '</'. [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
<return type='void'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<info>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</info>
<return type='int' info='0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise'/>
<arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
- <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+ <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
<arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
<arg name='depth' type='int' info='Used for loop detection, use 0'/>
<arg name='URL' type='const xmlChar *' info='the URL for the entity to load'/>
<arg name='input' type='xmlParserInputPtr' info='an xmlParserInputPtr input'/>
</function>
<function name='xmlParserPrintFileInfo' file='xmlerror' module='error'>
- <info>Displays the associated file and line informations for the current input</info>
+ <info>Displays the associated file and line information for the current input</info>
<return type='void'/>
<arg name='input' type='xmlParserInputPtr' info='an xmlParserInputPtr input'/>
</function>
<info>Clear the top input callback from the input stack. this includes the compiled-in I/O.</info>
<return type='int' info='the number of input callback registered or -1 in case of error.'/>
</function>
+ <function name='xmlPopOutputCallbacks' file='xmlIO' module='xmlIO'>
+ <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
+ <info>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</info>
+ <return type='int' info='the number of output callback registered or -1 in case of error.'/>
+ </function>
<function name='xmlPreviousElementSibling' file='tree' module='tree'>
<cond>defined(LIBXML_TREE_ENABLED)</cond>
<info>Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to entities references.</info>
</functype>
<function name='xmlRegExecErrInfo' file='xmlregexp' module='xmlregexp'>
<cond>defined(LIBXML_REGEXP_ENABLED)</cond>
- <info>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
+ <info>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
<return type='int' info='will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.'/>
<arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context generating an error'/>
<arg name='string' type='const xmlChar **' info='return value for the error string'/>
</function>
<function name='xmlRegExecNextValues' file='xmlregexp' module='xmlregexp'>
<cond>defined(LIBXML_REGEXP_ENABLED)</cond>
- <info>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
+ <info>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
<return type='int' info='will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.'/>
<arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context'/>
<arg name='nbval' type='int *' info='pointer to the number of accepted values IN/OUT'/>
</function>
<function name='xmlRelaxNGGetValidErrors' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>Get the error and warning callback informations</info>
+ <info>Get the error and warning callback information</info>
<return type='int' info='-1 in case of error and 0 otherwise'/>
<arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
<arg name='err' type='xmlRelaxNGValidityErrorFunc *' info='the error function result'/>
</function>
<function name='xmlRelaxNGSetValidErrors' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>Set the error and warning callback informations</info>
+ <info>Set the error and warning callback information</info>
<return type='void'/>
<arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
<arg name='err' type='xmlRelaxNGValidityErrorFunc' info='the error function'/>
</functype>
<function name='xmlRelaxParserSetFlag' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>Semi private function used to pass informations to a parser context which are a combination of xmlRelaxNGParserFlag .</info>
+ <info>Semi private function used to pass information to a parser context which are a combination of xmlRelaxNGParserFlag .</info>
<return type='int' info='0 if success and -1 in case of error'/>
<arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a RelaxNG parser context'/>
<arg name='flags' type='int' info='a set of flags values'/>
<arg name='name' type='const xmlChar *' info='The element name'/>
</function>
<function name='xmlSAX2EndElementNs' file='SAX2' module='SAX2'>
- <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</info>
+ <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</info>
<return type='void'/>
<arg name='ctx' type='void *' info='the user data (XML parser context)'/>
<arg name='localname' type='const xmlChar *' info='the local name of the element'/>
<arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
</function>
<function name='xmlSAX2StartElementNs' file='SAX2' module='SAX2'>
- <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</info>
+ <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</info>
<return type='void'/>
<arg name='ctx' type='void *' info='the user data (XML parser context)'/>
<arg name='localname' type='const xmlChar *' info='the local name of the element'/>
<info>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</info>
<return type='long' info='the number of byte written or -1 in case of error'/>
<arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
- <arg name='node' type='xmlNodePtr' info='the top node of the subtree to save'/>
+ <arg name='cur' type='xmlNodePtr' info=''/>
</function>
<function name='xmlSaveUri' file='uri' module='uri'>
<info>Save the URI as an escaped string</info>
</function>
<function name='xmlSchemaGetValidErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>Get the error and warning callback informations</info>
+ <info>Get the error and warning callback information</info>
<return type='int' info='-1 in case of error and 0 otherwise'/>
<arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a XML-Schema validation context'/>
<arg name='err' type='xmlSchemaValidityErrorFunc *' info='the error function result'/>
</function>
<function name='xmlSchemaSetValidErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>Set the error and warning callback informations</info>
+ <info>Set the error and warning callback information</info>
<return type='void'/>
<arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
<arg name='err' type='xmlSchemaValidityErrorFunc' info='the error function'/>
</functype>
<functype name='xmlSchemaValidityLocatorFunc' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</info>
+ <info>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</info>
<return type='int' info='0 in case of success and -1 in case of error'/>
<arg name='ctx' type='void *' info='user provided context'/>
<arg name='file' type='const char **' info='returned file information'/>
</functype>
<function name='xmlShellDir' file='debugXML' module='debugXML'>
<cond>defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)</cond>
- <info>Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).</info>
+ <info>Implements the XML shell function "dir" 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'/>
</function>
<function name='xmlTextReaderNormalization' file='xmlreader' module='xmlreader'>
<cond>defined(LIBXML_READER_ENABLED)</cond>
- <info>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &#0; is of course not supported either.</info>
+ <info>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &#0; is of course not supported either.</info>
<return type='int' info='1 or -1 in case of error.'/>
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
</function>
</function>
<function name='xmlXIncludeProcessNode' file='xinclude' module='xinclude'>
<cond>defined(LIBXML_XINCLUDE_ENABLED)</cond>
- <info>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</info>
+ <info>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</info>
<return type='int' info='0 if no substitution were done, -1 if some processing failed or the number of substitutions done.'/>
<arg name='ctxt' type='xmlXIncludeCtxtPtr' info='an existing XInclude context'/>
<arg name='node' type='xmlNodePtr' info='a node in an XML document'/>
<reference name='XMLCALL' href='html/libxml-xmlexports.html#XMLCALL'/>
<reference name='XMLCDECL' href='html/libxml-xmlexports.html#XMLCDECL'/>
<reference name='XMLPUBFUN' href='html/libxml-xmlexports.html#XMLPUBFUN'/>
+ <reference name='XMLPUBLIC' href='html/libxml-xmlexports.html#XMLPUBLIC'/>
<reference name='XMLPUBVAR' href='html/libxml-xmlexports.html#XMLPUBVAR'/>
<reference name='XML_ATTRIBUTE_CDATA' href='html/libxml-tree.html#XML_ATTRIBUTE_CDATA'/>
<reference name='XML_ATTRIBUTE_DECL' href='html/libxml-tree.html#XML_ATTRIBUTE_DECL'/>
<reference name='xmlPedanticParserDefaultValue' href='html/libxml-globals.html#xmlPedanticParserDefaultValue'/>
<reference name='xmlPopInput' href='html/libxml-parserInternals.html#xmlPopInput'/>
<reference name='xmlPopInputCallbacks' href='html/libxml-xmlIO.html#xmlPopInputCallbacks'/>
+ <reference name='xmlPopOutputCallbacks' href='html/libxml-xmlIO.html#xmlPopOutputCallbacks'/>
<reference name='xmlPreviousElementSibling' href='html/libxml-tree.html#xmlPreviousElementSibling'/>
<reference name='xmlPrintURI' href='html/libxml-uri.html#xmlPrintURI'/>
<reference name='xmlPushInput' href='html/libxml-parserInternals.html#xmlPushInput'/>
<reference name='xmlSplitQName2' href='html/libxml-tree.html#xmlSplitQName2'/>
<reference name='xmlSplitQName3' href='html/libxml-tree.html#xmlSplitQName3'/>
<reference name='xmlSprintfElementContent' href='html/libxml-valid.html#xmlSprintfElementContent'/>
+ <reference name='xmlStartTag' href='html/libxml-parser.html#xmlStartTag'/>
<reference name='xmlStopParser' href='html/libxml-parser.html#xmlStopParser'/>
<reference name='xmlStrEqual' href='html/libxml-xmlstring.html#xmlStrEqual'/>
<reference name='xmlStrPrintf' href='html/libxml-xmlstring.html#xmlStrPrintf'/>
<ref name='XMLCALL'/>
<ref name='XMLCDECL'/>
<ref name='XMLPUBFUN'/>
+ <ref name='XMLPUBLIC'/>
<ref name='XMLPUBVAR'/>
<ref name='XML_ATTRIBUTE_CDATA'/>
<ref name='XML_ATTRIBUTE_DECL'/>
<ref name='xmlPedanticParserDefaultValue'/>
<ref name='xmlPopInput'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlPreviousElementSibling'/>
<ref name='xmlPrintURI'/>
<ref name='xmlPushInput'/>
<ref name='xmlSplitQName2'/>
<ref name='xmlSplitQName3'/>
<ref name='xmlSprintfElementContent'/>
+ <ref name='xmlStartTag'/>
<ref name='xmlStopParser'/>
<ref name='xmlStrEqual'/>
<ref name='xmlStrPrintf'/>
<ref name='xmlSetExternalEntityLoader'/>
<ref name='xmlSetFeature'/>
<ref name='xmlSetupParserForBuffer'/>
+ <ref name='xmlStartTag'/>
<ref name='xmlStopParser'/>
<ref name='xmlSubstituteEntitiesDefault'/>
</file>
<ref name='xmlParserInputBufferPush'/>
<ref name='xmlParserInputBufferRead'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlRegisterDefaultInputCallbacks'/>
<ref name='xmlRegisterDefaultOutputCallbacks'/>
<ref name='xmlRegisterHTTPPostCallbacks'/>
<ref name='XMLCALL'/>
<ref name='XMLCDECL'/>
<ref name='XMLPUBFUN'/>
+ <ref name='XMLPUBLIC'/>
<ref name='XMLPUBVAR'/>
</file>
<file name='xmlmemory'>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNodeSetContentLen'/>
<ref name='xmlParseAttValue'/>
<ref name='_xmlXPathContext'/>
</word>
<word name='Call'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlInitParser'/>
<ref name='xmlXPathOrderDocElems'/>
</word>
<ref name='xmlStringGetNodeList'/>
<ref name='xmlStringLenGetNodeList'/>
</word>
+ <word name='EOF'>
+ <ref name='xmlParseContent'/>
+ </word>
<word name='ETag'>
<ref name='htmlParseElement'/>
<ref name='xmlParseElement'/>
<word name='Initialize'>
<ref name='docbDefaultSAXHandlerInit'/>
<ref name='htmlDefaultSAXHandlerInit'/>
- <ref name='htmlInitAutoClose'/>
<ref name='initdocbDefaultSAXHandler'/>
<ref name='inithtmlDefaultSAXHandler'/>
<ref name='initxmlDefaultSAXHandler'/>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNewTextChild'/>
<ref name='xmlNewTextWriter'/>
<ref name='xmlNewTextWriterPushParser'/>
<ref name='xmlListRemoveFirst'/>
<ref name='xmlListRemoveLast'/>
<ref name='xmlParserHandleReference'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlRemoveID'/>
<ref name='xmlRemoveRef'/>
<ref name='xmlUnsetNsProp'/>
<ref name='xmlTextWriterStartElementNS'/>
<ref name='xmlTextWriterStartPI'/>
</word>
+ <word name='Stops'>
+ <ref name='xmlParseContent'/>
+ </word>
<word name='StringType'>
<ref name='xmlParseAttributeType'/>
</word>
<ref name='xmlIsPubidChar'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNewNodeEatName'/>
<ref name='xmlNewPI'/>
<ref name='xmlNewTextChild'/>
<ref name='htmlIsAutoClosed'/>
<ref name='xmlCatalogAdd'/>
<ref name='xmlNewChild'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNodeSetContentLen'/>
<ref name='xmlParseURIRaw'/>
<word name='badly'>
<ref name='xmlParseExternalID'/>
</word>
- <word name='bahaviour'>
- <ref name='xmlTextReaderNormalization'/>
- </word>
<word name='balanced'>
<ref name='xmlParseBalancedChunkMemory'/>
<ref name='xmlParseBalancedChunkMemoryRecover'/>
<ref name='xmlAddAttributeDecl'/>
</word>
<word name='before'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlBuildRelativeURI'/>
<ref name='xmlCatalogAdd'/>
<ref name='xmlCleanupParser'/>
<ref name='xmlNodeGetSpacePreserve'/>
<ref name='xmlNodeSetSpacePreserve'/>
<ref name='xmlSAX2ResolveEntity'/>
+ <ref name='xmlTextReaderNormalization'/>
<ref name='xmlTextReaderSetParserProp'/>
<ref name='xmlUTF8Strsize'/>
</word>
<ref name='xmlKeepBlanksDefault'/>
<ref name='xmlSkipBlankChars'/>
</word>
- <word name='bloc'>
- <ref name='xmlParseBalancedChunkMemory'/>
- <ref name='xmlParseBalancedChunkMemoryRecover'/>
- <ref name='xmlParseExternalEntity'/>
- </word>
<word name='blockDefault'>
<ref name='XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION'/>
<ref name='XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION'/>
<ref name='xmlUTF8Size'/>
</word>
<word name='calling'>
+ <ref name='XMLCALL'/>
+ <ref name='XMLCDECL'/>
<ref name='_xmlXPathContext'/>
<ref name='xmlBuildRelativeURI'/>
<ref name='xmlC14NDocDumpMemory'/>
<ref name='xmlXPathRoundFunction'/>
</word>
<word name='closing'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlNanoFTPFreeCtxt'/>
<ref name='xmlParseElementChildrenContentDecl'/>
<ref name='xmlParseStartTag'/>
<ref name='xmlCleanupInputCallbacks'/>
<ref name='xmlCleanupOutputCallbacks'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlRegisterDefaultInputCallbacks'/>
<ref name='xmlRegisterDefaultOutputCallbacks'/>
</word>
<ref name='xmlXPtrNewContext'/>
</word>
<word name='content:'>
- <ref name='xmlParseContent'/>
<ref name='xmlXPathEqualValues'/>
<ref name='xmlXPathNotEqualValues'/>
</word>
<word name='conveniently'>
<ref name='xmlCurrentChar'/>
</word>
+ <word name='convention'>
+ <ref name='XMLCALL'/>
+ <ref name='XMLCDECL'/>
+ </word>
<word name='conversion'>
<ref name='_uconv_t'/>
<ref name='_xmlXPathType'/>
<ref name='xmlValidCtxtNormalizeAttributeValue'/>
<ref name='xmlValidNormalizeAttributeValue'/>
</word>
+ <word name='declares'>
+ <ref name='XMLCALL'/>
+ <ref name='XMLCDECL'/>
+ <ref name='XMLPUBFUN'/>
+ <ref name='XMLPUBLIC'/>
+ <ref name='XMLPUBVAR'/>
+ </word>
<word name='declaring'>
<ref name='xmlGetID'/>
</word>
<ref name='xmlLastElementChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNextElementSibling'/>
<ref name='xmlParseStartTag'/>
<ref name='xmlPreviousElementSibling'/>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNewTextChild'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNodeSetContentLen'/>
<word name='explored'>
<ref name='xmlXPathAxisFunc'/>
</word>
+ <word name='exportable'>
+ <ref name='XMLPUBFUN'/>
+ <ref name='XMLPUBVAR'/>
+ </word>
+ <word name='exported'>
+ <ref name='XMLCALL'/>
+ <ref name='XMLCDECL'/>
+ </word>
<word name='exposing'>
<ref name='xmlTextReaderRead'/>
</word>
<word name='fashion'>
<ref name='xmlNewRMutex'/>
</word>
- <word name='fast'>
- <ref name='htmlInitAutoClose'/>
- </word>
<word name='faster'>
<ref name='htmlNodeStatus'/>
<ref name='xmlStrEqual'/>
<ref name='xmlXPathNodeSetItem'/>
</word>
<word name='functions'>
+ <ref name='XMLCALL'/>
+ <ref name='XMLCDECL'/>
<ref name='htmlCtxtReadIO'/>
<ref name='htmlReadIO'/>
<ref name='xmlC14NDocDumpMemory'/>
<ref name='htmlAutoCloseTag'/>
<ref name='htmlIsAutoClosed'/>
</word>
- <word name='htmlStartCloseIndex'>
- <ref name='htmlInitAutoClose'/>
- </word>
<word name='http:'>
<ref name='XINCLUDE_NS'/>
<ref name='XINCLUDE_OLD_NS'/>
<ref name='xmlSAXParseMemoryWithData'/>
<ref name='xmlSAXUserParseMemory'/>
</word>
- <word name='incase'>
- <ref name='xmlNanoFTPClose'/>
- <ref name='xmlNanoFTPCloseConnection'/>
- <ref name='xmlNanoFTPCwd'/>
- <ref name='xmlNanoFTPDele'/>
- <ref name='xmlNanoFTPGet'/>
- <ref name='xmlNanoFTPGetConnection'/>
- <ref name='xmlNanoFTPList'/>
- <ref name='xmlNanoHTTPFetch'/>
- <ref name='xmlNanoHTTPSave'/>
- </word>
<word name='incl'>
<ref name='_xmlSchemaType'/>
</word>
<ref name='xmlCleanupInputCallbacks'/>
<ref name='xmlCleanupOutputCallbacks'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlXIncludeProcessFlags'/>
<ref name='xmlXIncludeProcessFlagsData'/>
<ref name='xmlXIncludeProcessTreeFlags'/>
<ref name='xmlParserFindNodeInfoIndex'/>
<ref name='xmlReallocLoc'/>
</word>
- <word name='information'>
- <ref name='LIBXML_VERSION_EXTRA'/>
- <ref name='_xmlError'/>
- <ref name='xmlDebugDumpAttr'/>
- <ref name='xmlDebugDumpAttrList'/>
- <ref name='xmlDebugDumpDTD'/>
- <ref name='xmlDebugDumpDocument'/>
- <ref name='xmlDebugDumpDocumentHead'/>
- <ref name='xmlDebugDumpEntities'/>
- <ref name='xmlDebugDumpNode'/>
- <ref name='xmlDebugDumpNodeList'/>
- <ref name='xmlDebugDumpOneNode'/>
- <ref name='xmlNanoFTPUpdateURL'/>
- <ref name='xmlNanoHTTPFetch'/>
- <ref name='xmlNanoHTTPMethod'/>
- <ref name='xmlNanoHTTPMethodRedir'/>
- <ref name='xmlNanoHTTPOpen'/>
- <ref name='xmlNanoHTTPOpenRedir'/>
- <ref name='xmlNewTextReader'/>
- <ref name='xmlRelaxNGGetParserErrors'/>
- <ref name='xmlSchemaGetParserErrors'/>
- <ref name='xmlSchemaValidateSetFilename'/>
- <ref name='xmlSchemaValidateSetLocator'/>
- <ref name='xmlSchemaValidateStream'/>
- <ref name='xmlSchemaValidityLocatorFunc'/>
- <ref name='xmlTextReaderByteConsumed'/>
- <ref name='xmlXPathOrderDocElems'/>
- </word>
- <word name='informations'>
- <ref name='_xmlAttr'/>
- <ref name='_xmlDoc'/>
- <ref name='_xmlNode'/>
- <ref name='_xmlParserCtxt'/>
- <ref name='endElementNsSAX2Func'/>
- <ref name='startElementNsSAX2Func'/>
- <ref name='xmlDebugDumpString'/>
- <ref name='xmlErrMemory'/>
- <ref name='xmlNanoFTPCleanup'/>
- <ref name='xmlNanoFTPInit'/>
- <ref name='xmlNanoFTPProxy'/>
- <ref name='xmlNanoFTPScanProxy'/>
- <ref name='xmlNanoHTTPInit'/>
- <ref name='xmlNanoHTTPScanProxy'/>
- <ref name='xmlParserPrintFileInfo'/>
- <ref name='xmlRegExecErrInfo'/>
- <ref name='xmlRegExecNextValues'/>
- <ref name='xmlRelaxNGGetValidErrors'/>
- <ref name='xmlRelaxNGSetValidErrors'/>
- <ref name='xmlRelaxParserSetFlag'/>
- <ref name='xmlSAX2EndElementNs'/>
- <ref name='xmlSAX2StartElementNs'/>
- <ref name='xmlSchemaGetValidErrors'/>
- <ref name='xmlSchemaSetValidErrors'/>
- <ref name='xmlSchemaValidityLocatorFunc'/>
- <ref name='xmlShellDir'/>
- <ref name='xmlXIncludeProcessNode'/>
- </word>
<word name='informative'>
<ref name='_xmlError'/>
</word>
<ref name='xmlXPathMultValues'/>
</word>
<word name='multithreaded'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlCleanupParser'/>
<ref name='xmlCleanupThreads'/>
<ref name='xmlInitParser'/>
<ref name='_xmlDoc'/>
<ref name='_xmlParserCtxt'/>
<ref name='_xmlSchema'/>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlGetFeaturesList'/>
<ref name='xmlHashAddEntry'/>
<ref name='xmlHashScan3'/>
<ref name='XML_SCHEMAS_ELEM_NILLABLE'/>
<ref name='xmlExpIsNillable'/>
</word>
+ <word name='no-op'>
+ <ref name='htmlInitAutoClose'/>
+ </word>
<word name='nod'>
<ref name='xmlEntityReferenceFunc'/>
</word>
<ref name='XML_CAST_FPTR'/>
<ref name='_xmlSchema'/>
<ref name='_xmlSchemaElement'/>
+ <ref name='htmlInitAutoClose'/>
<ref name='xmlDecodeEntities'/>
<ref name='xmlParserHandleReference'/>
<ref name='xmlScanName'/>
<ref name='xmlXPathStringLengthFunction'/>
</word>
<word name='once'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlAutomataNewOnceTrans'/>
<ref name='xmlAutomataNewOnceTrans2'/>
<ref name='xmlCleanupThreads'/>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNodeSetContentLen'/>
</word>
<ref name='xmlValidNormalizeAttributeValue'/>
</word>
<word name='processed'>
- <ref name='_xmlParserCtxt'/>
<ref name='startDocument'/>
<ref name='startDocumentSAXFunc'/>
<ref name='startElement'/>
<ref name='xmlStringLenGetNodeList'/>
</word>
<word name='produced'>
+ <ref name='UTF8Toisolat1'/>
+ <ref name='isolat1ToUTF8'/>
<ref name='xmlCharEncodingOutputFunc'/>
<ref name='xmlCurrentChar'/>
</word>
<ref name='xmlXPtrNewContext'/>
</word>
<word name='programs'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlInitParser'/>
</word>
<word name='progressed'>
<ref name='xmlNanoHTTPRedir'/>
</word>
<word name='reentrant'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlEncodeEntitiesReentrant'/>
<ref name='xmlEncodeSpecialChars'/>
<ref name='xmlFreeRMutex'/>
<ref name='xmlGetCharEncodingHandler'/>
<ref name='xmlGetLastError'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlRegisterInputCallbacks'/>
<ref name='xmlRegisterOutputCallbacks'/>
<ref name='xmlResetLastError'/>
<ref name='xmlGcMemGet'/>
<ref name='xmlMemGet'/>
<ref name='xmlNanoHTTPFetch'/>
- <ref name='xmlSaveTree'/>
<ref name='xmlShell'/>
<ref name='xmlShellSave'/>
</word>
<ref name='xmlParseAttValue'/>
<ref name='xmlParseBalancedChunkMemory'/>
<ref name='xmlParseBalancedChunkMemoryRecover'/>
+ <ref name='xmlParseContent'/>
<ref name='xmlParseInNodeContext'/>
<ref name='xmlParserAddNodeInfo'/>
<ref name='xmlParserFindNodeInfoIndex'/>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeAddContent'/>
<ref name='xmlNodeAddContentLen'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeAddContent'/>
<ref name='xmlNodeAddContentLen'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlPushInput'/>
</word>
<word name='symbol'>
+ <ref name='XMLPUBLIC'/>
<ref name='xmlModuleSymbol'/>
</word>
<word name='synchronizing'>
<ref name='htmlAutoCloseTag'/>
<ref name='htmlGetMetaEncoding'/>
<ref name='htmlHandleOmittedElem'/>
- <ref name='htmlInitAutoClose'/>
<ref name='htmlIsAutoClosed'/>
<ref name='htmlSetMetaEncoding'/>
</word>
<ref name='xmlNamespaceParseNSDef'/>
<ref name='xmlNamespaceParseQName'/>
<ref name='xmlPopInputCallbacks'/>
+ <ref name='xmlPopOutputCallbacks'/>
<ref name='xmlPushInput'/>
<ref name='xmlReconciliateNs'/>
- <ref name='xmlSaveTree'/>
<ref name='xmlSetTreeDoc'/>
</word>
<word name='total'>
<ref name='xmlNewChild'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNodeSetContent'/>
<ref name='xmlNodeSetContentLen'/>
</word>
<ref name='xmlSaveFormatFileEnc'/>
</word>
<word name='xmlInitParser'>
- <ref name='htmlInitAutoClose'/>
<ref name='xmlCleanupParser'/>
</word>
<word name='xmlInitThreads'>
<word name='xmlNewNode'>
<ref name='xmlNewNodeEatName'/>
</word>
+ <word name='xmlNewProp'>
+ <ref name='xmlNewDocProp'/>
+ </word>
<word name='xmlNewTextChild'>
<ref name='xmlNewChild'/>
<ref name='xmlNewTextChild'/>
<ref name='xmlDOMWrapCloneNode'/>
<ref name='xmlNewDocNode'/>
<ref name='xmlNewDocNodeEatName'/>
+ <ref name='xmlNewDocProp'/>
<ref name='xmlNewTextChild'/>
<ref name='xmlSchemaGetBuiltInType'/>
<ref name='xmlSearchNs'/>
</vendor>
<product id="libxml2">
<name>libxml2</name>
- <version>v2.9.9</version>
- <last-release> Jan 03 2019</last-release>
+ <version>v2.9.10</version>
+ <last-release> Oct 30 2019</last-release>
<info-url>http://xmlsoft.org/</info-url>
- <changes> - Security:
- CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),
- CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),
-
- - Documentation:
- reader: Fix documentation comment (Mohammed Sadiq)
+ <changes> - Documentation:
+ Fix a few more typos ("fonction") (Nick Wellnhofer),
+ Large batch of typo fixes (Jared Yanovich),
+ Fix typos: tree: move{ -> s}, reconcil{i -> }ed, h{o -> e}ld by... (Jan Pokorný),
+ Fix typo: xpath: simpli{ -> fi}ed (Jan Pokorný),
+ Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan Pokorný),
+ Fix comments in test code (zhouzhongyuan),
+ fix comment in testReader.c (zhouzhongyuan)
- Portability:
- Fix MSVC build with lzma (Nick Wellnhofer),
- Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),
- Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),
- Merge branch 'patch-2' into 'master' (Nick Wellnhofer),
- Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),
- Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),
- NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)
+ Fix some release issues on Fedora 30 (Daniel Veillard),
+ Fix exponent digits when running tests under old MSVC (Daniel Richard G),
+ Work around buggy ceil() function on AIX (Daniel Richard G),
+ Don't call printf with NULL string in runtest.c (Daniel Richard G),
+ Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney),
+ timsort.h: support older GCCs (Jérôme Duval),
+ Make configure.ac work with older pkg-config (Nick Wellnhofer),
+ Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer),
+ Fix nanohttp.c on MinGW (Nick Wellnhofer),
+ Fix Windows compiler warning in testC14N.c (Nick Wellnhofer),
+ Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer),
+ Fix Python bindings under Windows (Nick Wellnhofer)
- Bug Fixes:
- Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),
- Fix building relative URIs (Thomas Holder),
- Problem with data in interleave in RelaxNG validation (Nikolai Weibull),
- Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),
- Set doc on element obtained from freeElems (Nick Wellnhofer),
- Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),
- Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),
- Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),
- Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),
- Free input buffer in xmlHaltParser (Nick Wellnhofer),
- Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),
- Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),
- Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),
- Fix xmlTextReaderNext with preparsed document (Felix Bünemann),
- Remove stray character from comment (Nick Wellnhofer),
- Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),
- HTML noscript should not close p (Daniel Veillard),
- Don't change context node in xmlXPathRoot (Nick Wellnhofer),
- Stop using XPATH_OP_RESET (Nick Wellnhofer),
- Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)
+ Another fix for conditional sections at end of document (Nick Wellnhofer),
+ Fix for conditional sections at end of document (Nick Wellnhofer),
+ Make sure that Python tests exit with error code (Nick Wellnhofer),
+ Audit memory error handling in xpath.c (Nick Wellnhofer),
+ Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer),
+ Fix integer overflow when counting written bytes (Nick Wellnhofer),
+ Fix uninitialized memory access in HTML parser (Nick Wellnhofer),
+ Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),
+ Disallow conditional sections in internal subset (Nick Wellnhofer),
+ Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer),
+ Fix Regextests (Nick Wellnhofer),
+ Fix empty branch in regex (Nick Wellnhofer),
+ Fix integer overflow in entity recursion check (Nick Wellnhofer),
+ Don't read external entities or XIncludes from stdin (Nick Wellnhofer),
+ Fix Schema determinism check of ##other namespaces (Nick Wellnhofer),
+ Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan),
+ Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer),
+ Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer),
+ Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan),
+ 14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer),
+ Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie),
+ Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer),
+ Misleading error message with xs:{min|max}Inclusive (bettermanzzy),
+ Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin),
+ Partial fix for comparison of xs:durations (Nick Wellnhofer),
+ Fix null deref in xmlreader buffer (zhouzhongyuan),
+ Fix unability to RelaxNG-validate grammar with choice-based name class (Jan Pokorný),
+ Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan Pokorný),
+ Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan),
+ fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan),
+ Fix unsigned int overflow (Jens Eggerstedt),
+ dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer),
+ Fix another code path in xmlParseQName (Nick Wellnhofer),
+ Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer),
+ Fix build without reader but with pattern (Nick Wellnhofer),
+ Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer),
+ Fix unsigned integer overflow (Nick Wellnhofer),
+ Fix return value of xmlOutputBufferWrite (Nick Wellnhofer),
+ Fix parser termination from "Double hyphen within comment" error (David Warring),
+ Fix call stack overflow in xmlFreePattern (Nick Wellnhofer),
+ Fix null deref in previous commit (Nick Wellnhofer),
+ Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer),
+ Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer),
+ Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer),
+ Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer),
+ Fix null deref in xmlregexp error path (Nick Wellnhofer),
+ Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer),
+ Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer),
+ Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer),
+ Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer),
+ Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer),
+ Memory leak in xmlFreeTextReader (Nick Wellnhofer),
+ Memory leak in xmlFreeID (xmlreader.c) (Nick Wellnhofer)
- Improvements:
- Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),
- cleanup: remove some unreachable code (Thomas Holder),
- add --relative to testURI (Thomas Holder),
- Remove redefined starts and defines inside include elements (Nikolai Weibull),
- Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),
- Look inside divs for starts and defines inside include (Nikolai Weibull),
- Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),
- Stop using doc->charset outside parser code (Nick Wellnhofer),
- Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),
- Don't include SAX.h from globals.h (Nick Wellnhofer),
- Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),
- Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),
- Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),
- Improve restoring of context size and position (Nick Wellnhofer),
- Simplify and harden nodeset filtering (Nick Wellnhofer),
- Avoid unnecessary backups of the context node (Nick Wellnhofer),
- Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)
+ Run XML conformance tests under CI (Nick Wellnhofer),
+ Update GitLab CI config (Nick Wellnhofer),
+ Propagate memory errors in valuePush (Nick Wellnhofer),
+ Propagate memory errors in xmlXPathCompExprAdd (Nick Wellnhofer),
+ Make xmlFreeDocElementContent non-recursive (Nick Wellnhofer),
+ Enable continuous integration via GitLab CI (Nick Wellnhofer),
+ Avoid ignored attribute warnings under GCC (Nick Wellnhofer),
+ Make xmlDumpElementContent non-recursive (Nick Wellnhofer),
+ Make apibuild.py ignore ATTRIBUTE_NO_SANITIZE (Nick Wellnhofer),
+ Mark xmlExp* symbols as removed (Nick Wellnhofer),
+ Make xmlParseConditionalSections non-recursive (Nick Wellnhofer),
+ Adjust expected error in Python tests (Nick Wellnhofer),
+ Make xmlTextReaderFreeNodeList non-recursive (Nick Wellnhofer),
+ Make xmlFreeNodeList non-recursive (Nick Wellnhofer),
+ Make xmlParseContent and xmlParseElement non-recursive (Nick Wellnhofer),
+ Remove executable bit from non-executable files (Nick Wellnhofer),
+ Fix expected output of test/schemas/any4 (Nick Wellnhofer),
+ Optimize build instructions in README (zhouzhongyuan),
+ xml2-config.in: Output CFLAGS and LIBS on the same line (Hugh McMaster),
+ xml2-config: Add a --dynamic switch to print only shared libraries (Hugh McMaster),
+ Annotate functions with __attribute__((no_sanitize)) (Nick Wellnhofer),
+ Fix warnings when compiling without reader or push parser (Nick Wellnhofer),
+ Remove unused member `doc` in xmlSaveCtxt (Nick Wellnhofer),
+ Limit recursion depth in xmlXPathCompOpEvalPredicate (Nick Wellnhofer),
+ Remove -Wno-array-bounds (Nick Wellnhofer),
+ Remove unreachable code in xmlXPathCountFunction (Nick Wellnhofer),
+ Improve XPath predicate and filter evaluation (Nick Wellnhofer),
+ Limit recursion depth in xmlXPathOptimizeExpression (Nick Wellnhofer),
+ Disable hash randomization when fuzzing (Nick Wellnhofer),
+ Optional recursion limit when parsing XPath expressions (Nick Wellnhofer),
+ Optional recursion limit when evaluating XPath expressions (Nick Wellnhofer),
+ Use break statements in xmlXPathCompOpEval (Nick Wellnhofer),
+ Optional XPath operation limit (Nick Wellnhofer),
+ Fix compilation with --with-minimum (Nick Wellnhofer),
+ Check XPath stack after calling functions (Nick Wellnhofer),
+ Remove debug printf in xmlreader.c (Nick Wellnhofer),
+ Always define LIBXML_THREAD_ENABLED when enabled (Michael Haubenwallner),
+ Regenerate NEWS (Nick Wellnhofer),
+ Change git repo URL (Nick Wellnhofer),
+ Change bug tracker URL (Nick Wellnhofer),
+ Remove outdated HTML file (Nick Wellnhofer),
+ Fix unused function warning in testapi.c (Nick Wellnhofer),
+ Add some generated test files to .gitignore (Nick Wellnhofer),
+ Remove unneeded function pointer casts (Nick Wellnhofer),
+ Fix -Wcast-function-type warnings (GCC 8) (Nick Wellnhofer),
+ Fix -Wformat-truncation warnings (GCC 8) (Nick Wellnhofer)
- Cleanups:
+ Rebuild docs (Nick Wellnhofer),
+ Disable xmlExp regex code (Nick Wellnhofer),
+ Remove redundant code in xmlRelaxNGValidateState (Nick Wellnhofer),
+ Remove redundant code in xmlXPathCompRelationalExpr (Nick Wellnhofer)
</changes>
H3 {font-family: Verdana,Arial,Helvetica}
A:link, A:visited, A:active { text-decoration: underline }
</style><title>Releases</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Releases</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation & DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.10: Oct 30 2019</h3><ul>
+to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.11: May 13 2021</h3><ul>
+ <li>Security:<br />
+ Patch for security issue CVE-2021-3541 (Daniel Veillard)<br />
+ </li>
+
+ <li>Documentation:<br />
+ Clarify xmlNewDocProp documentation (Nick Wellnhofer)<br />
+ </li>
+
+ <li>Portability:<br />
+ CMake: Only add postfixes if MSVC (Christopher Degawa),<br />
+ Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),<br />
+ Use CMake PROJECT_VERSION (Markus Rickert),<br />
+ Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),<br />
+ Add CI for CMake on MSVC (Markus Rickert),<br />
+ Update minimum required CMake version (Markus Rickert),<br />
+ Add variables for configured options to CMake config files (Markus Rickert),<br />
+ Check if variables exist when defining targets (Markus Rickert),<br />
+ Check if target exists when reading target properties (Markus Rickert),<br />
+ Add xmlcatalog target and definition to config files (Markus Rickert),<br />
+ Remove include directories for link-only dependencies (Markus Rickert),<br />
+ Fix ICU build in CMake (Markus Rickert),<br />
+ Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),<br />
+ Update CMake config files (Markus Rickert),<br />
+ Add xmlcatalog and xmllint to CMake export (Markus Rickert),<br />
+ Simplify xmlexports.h (Nick Wellnhofer),<br />
+ Require dependencies based on enabled CMake options (Markus Rickert),<br />
+ Use NAMELINK_COMPONENT in CMake install (Markus Rickert),<br />
+ Add CMake files to EXTRA_DIST (Markus Rickert),<br />
+ Add missing compile definition for static builds to CMake (Markus Rickert),<br />
+ Add CI for CMake on Linux and MinGW (Markus Rickert),<br />
+ Fix variable name in win32/configure.js (Nick Wellnhofer),<br />
+ Fix version parsing in win32/configure.js (Nick Wellnhofer),<br />
+ Fix autotools warnings (Nick Wellnhofer),<br />
+ Update config.h.cmake.in (Markus Rickert),<br />
+ win32: allow passing *FLAGS on command line (Michael Stahl),<br />
+ Configure file xmlwin32version.h.in on MSVC (Markus Rickert),<br />
+ List headers individually (Markus Rickert),<br />
+ Add CMake build files (Markus Rickert),<br />
+ Parenthesize Py<type>_Check() in ifs (Miro Hrončok),<br />
+ Minor fixes to configure.js (Nick Wellnhofer)<br />
+ </li>
+
+ <li>Bug Fixes:<br />
+ Fix null deref in legacy SAX1 parser (Nick Wellnhofer),<br />
+ Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),<br />
+ Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),<br />
+ Fix htmlTagLookup (Nick Wellnhofer),<br />
+ Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),<br />
+ Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),<br />
+ Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),<br />
+ Validate UTF8 in xmlEncodeEntities (Joel Hockey),<br />
+ Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),<br />
+ Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),<br />
+ Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),<br />
+ Fix exponential behavior with recursive entities (Nick Wellnhofer),<br />
+ Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),<br />
+ Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),<br />
+ Fix null deref introduced with previous commit (Nick Wellnhofer),<br />
+ Check for invalid redeclarations of predefined entities (Nick Wellnhofer),<br />
+ Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),<br />
+ parser.c: shrink the input buffer when appropriate (Mike Dalessio),<br />
+ Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),<br />
+ Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),<br />
+ Fix timeout when handling recursive entities (Nick Wellnhofer),<br />
+ Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),<br />
+ Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),<br />
+ use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),<br />
+ htmlParseComment: treat `--!>` as if it closed the comment (Mike Dalessio),<br />
+ Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),<br />
+ encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),<br />
+ xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val" (Xiaoming Ni),<br />
+ Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),<br />
+ Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),<br />
+ Avoid quadratic checking of identity-constraints (Michael Matz),<br />
+ Fix building with ICU 68. (Frederik Seiffert),<br />
+ Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),<br />
+ Fix xmlURIEscape memory leaks. (Elliott Hughes),<br />
+ Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),<br />
+ Fix caret in regexp character group (Nick Wellnhofer),<br />
+ parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),<br />
+ Fix memory leaks in XPointer string-range function (Nick Wellnhofer),<br />
+ Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),<br />
+ Fix SEGV in xmlSAXParseFileWithData (yanjinjq),<br />
+ Fix null deref in XPointer expression error path (Nick Wellnhofer),<br />
+ Don't call xmlXPathInit directly (Nick Wellnhofer),<br />
+ Fix cleanup of attributes in XML reader (Nick Wellnhofer),<br />
+ Fix double free in XML reader with XIncludes (Nick Wellnhofer),<br />
+ Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),<br />
+ Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),<br />
+ Fix error reporting with xi:fallback (Nick Wellnhofer),<br />
+ Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),<br />
+ Fix corner case with empty xi:fallback (Nick Wellnhofer),<br />
+ Fix XInclude regression introduced with recent commit (Nick Wellnhofer),<br />
+ Fix memory leak in runtest.c (Nick Wellnhofer),<br />
+ Make "xmllint --push --recovery" work (Nick Wellnhofer),<br />
+ Revert "Do not URI escape in server side includes" (Nick Wellnhofer),<br />
+ Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),<br />
+ Stop counting nbChars in parser context (Nick Wellnhofer),<br />
+ Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),<br />
+ Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),<br />
+ Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),<br />
+ Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),<br />
+ Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),<br />
+ Check for custom free function in global destructor (Nick Wellnhofer),<br />
+ Fix integer overflow when comparing schema dates (Nick Wellnhofer),<br />
+ Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),<br />
+ Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),<br />
+ Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br />
+ Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),<br />
+ Reset XML parser input before reporting errors (David Kilzer),<br />
+ Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),<br />
+ Fix HTML push parser lookahead (Nick Wellnhofer),<br />
+ Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),<br />
+ Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),<br />
+ Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),<br />
+ Reset HTML parser input before reporting error (Nick Wellnhofer),<br />
+ Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br />
+ Fix regression introduced with 477c7f6a (Nick Wellnhofer),<br />
+ Fix quadratic runtime in HTML parser (Nick Wellnhofer),<br />
+ Reset HTML parser input before reporting encoding error (Nick Wellnhofer),<br />
+ Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),<br />
+ Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),<br />
+ Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),<br />
+ Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),<br />
+ Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),<br />
+ Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br />
+ Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),<br />
+ Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),<br />
+ Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),<br />
+ Fix return value of xmlCharEncOutput (Nick Wellnhofer),<br />
+ Never expand parameter entities in text declaration (Nick Wellnhofer),<br />
+ Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),<br />
+ Fix use-after-free with validating reader (Nick Wellnhofer),<br />
+ xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),<br />
+ Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),<br />
+ Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),<br />
+ Make schema validation fail with multiple top-level elements (Nick Wellnhofer),<br />
+ Call xmlCleanupParser on ELF destruction (Samuel Thibault),<br />
+ Fix copying of entities in xmlParseReference (Nick Wellnhofer),<br />
+ Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),<br />
+ Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),<br />
+ Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),<br />
+ Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),<br />
+ Fix integer overflow in xmlBufferResize (Nick Wellnhofer),<br />
+ Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),<br />
+ Remove useless comparisons (Nick Wellnhofer),<br />
+ Fix overflow check in xmlNodeDump (Nick Wellnhofer),<br />
+ Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),<br />
+ Fix freeing of nested documents (Nick Wellnhofer),<br />
+ Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),<br />
+ Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),<br />
+ Fix xml2-config error code (Nick Wellnhofer),<br />
+ Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),<br />
+ Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),<br />
+ Null pointer handling in catalog.c (raniervf),<br />
+ xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)<br />
+ </li>
+
+ <li>Improvements:<br />
+ Store per-element parser state in a struct (Nick Wellnhofer),<br />
+ update for xsd:language type check (PaulHiggs),<br />
+ Update INSTALL.libxml2 (Nick Wellnhofer),<br />
+ Fix include order in c14n.h (Nick Wellnhofer),<br />
+ Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),<br />
+ Speed up htmlCheckAutoClose (Nick Wellnhofer),<br />
+ Speed up htmlTagLookup (Nick Wellnhofer),<br />
+ Stop checking attributes for UTF-8 validity (Nick Wellnhofer),<br />
+ Reduce some fuzzer timeouts (Nick Wellnhofer),<br />
+ Only run a few CI tests unless scheduled (Nick Wellnhofer),<br />
+ Improve fuzzer stability (Nick Wellnhofer),<br />
+ Check for feature flags in fuzzer tests (Nick Wellnhofer),<br />
+ Another attempt at improving fuzzer stability (Nick Wellnhofer),<br />
+ Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),<br />
+ Add charset names to fuzzing dictionaries (Nick Wellnhofer),<br />
+ Improve HTML fuzzer stability (Nick Wellnhofer),<br />
+ Add CI for MSVC x86 (Markus Rickert),<br />
+ Add a flag to not output anything when xmllint succeeded (hhb),<br />
+ Speed up HTML fuzzer (Nick Wellnhofer),<br />
+ Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),<br />
+ Handle malloc failures in fuzzing code (Nick Wellnhofer),<br />
+ add test coverage for incorrectly-closed comments (Mike Dalessio),<br />
+ Enforce maximum length of fuzz input (Nick Wellnhofer),<br />
+ Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),<br />
+ Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),<br />
+ Add CI test for Python 3 (Nick Wellnhofer),<br />
+ Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),<br />
+ Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),<br />
+ Allow port numbers up to INT_MAX (Nick Wellnhofer),<br />
+ Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),<br />
+ Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),<br />
+ Hardcode maximum XPath recursion depth (Nick Wellnhofer),<br />
+ Pass URL of main entity in XML fuzzer (Nick Wellnhofer),<br />
+ Consolidate seed corpus generation (Nick Wellnhofer),<br />
+ Test fuzz targets with dummy driver (Nick Wellnhofer),<br />
+ Fix regression introduced with commit d88df4b (Nick Wellnhofer),<br />
+ Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),<br />
+ Add TODO comment in xinclude.c (Nick Wellnhofer),<br />
+ Stop using maxParserDepth in xpath.c (Nick Wellnhofer),<br />
+ Remove dead code in xinclude.c (Nick Wellnhofer),<br />
+ Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),<br />
+ Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),<br />
+ Remove unneeded progress checks in HTML parser (Nick Wellnhofer),<br />
+ Use strcmp when fuzzing (Nick Wellnhofer),<br />
+ Fix XPath fuzzer (Nick Wellnhofer),<br />
+ Fuzz XInclude engine (Nick Wellnhofer),<br />
+ Add XPath and XPointer fuzzer (Nick Wellnhofer),<br />
+ Update fuzzing code (Nick Wellnhofer),<br />
+ More *NodeDumpOutput fixes (Nick Wellnhofer),<br />
+ Fix *NodeDumpOutput functions (Nick Wellnhofer),<br />
+ Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),<br />
+ Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),<br />
+ Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),<br />
+ Fix .gitattributes (Nick Wellnhofer),<br />
+ Rework control flow in htmlCurrentChar (Nick Wellnhofer),<br />
+ Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),<br />
+ Remove misleading comments in xpath.c (Nick Wellnhofer),<br />
+ Update to Devhelp index file format version 2 (Andre Klapper),<br />
+ Set project language to C (Markus Rickert),<br />
+ Add variable for working directory of XML Conformance Test Suite (Markus Rickert),<br />
+ Add additional tests and XML Conformance Test Suite (Markus Rickert),<br />
+ Add command line option for temp directory in runtest (Markus Rickert),<br />
+ Ensure LF line endings for test files (Markus Rickert),<br />
+ Enable runtests and testThreads (Markus Rickert),<br />
+ Limit regexp nesting depth (Nick Wellnhofer),<br />
+ Fix return values and documentation in encoding.c (Nick Wellnhofer),<br />
+ Add regexp regression tests (David Kilzer),<br />
+ Report error for invalid regexp quantifiers (Nick Wellnhofer),<br />
+ Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),<br />
+ Copy xs:duration parser from libexslt (Nick Wellnhofer),<br />
+ Fuzz target for XML Schemas (Nick Wellnhofer),<br />
+ Move entity recorder to fuzz.c (Nick Wellnhofer),<br />
+ Fuzz target for HTML parser (Nick Wellnhofer),<br />
+ Update GitLab CI container (Nick Wellnhofer),<br />
+ Add options file for xml fuzzer (Nick Wellnhofer),<br />
+ Add a couple of libFuzzer targets (Nick Wellnhofer),<br />
+ Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),<br />
+ Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),<br />
+ Fix typos (Nick Wellnhofer),<br />
+ Disable LeakSanitizer (Nick Wellnhofer),<br />
+ Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),<br />
+ Add test case for recursive external parsed entities (Nick Wellnhofer),<br />
+ Enable error tests with entity substitution (Nick Wellnhofer),<br />
+ Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),<br />
+ Merge code paths loading external entities (Nick Wellnhofer),<br />
+ Copy some XMLReader option flags to parser context (Nick Wellnhofer),<br />
+ Add xmlPopOutputCallbacks (Nick Wellnhofer),<br />
+ Updated Python test reader2.py (Pieter van Oostrum),<br />
+ Updated python/tests/tstLastError.py (Pieter van Oostrum),<br />
+ Use random seed in xmlDictComputeFastKey (Ranier Vilela),<br />
+ Enable more undefined behavior sanitizers (Nick Wellnhofer)<br />
+ </li>
+</ul><h3>v2.9.10: Oct 30 2019</h3><ul>
<li>Documentation:<br />
Fix a few more typos ("fonction") (Nick Wellnhofer),<br />
Large batch of typo fixes (Jared Yanovich),<br />
</li>
</ul><h3>2.9.7: Nov 02 2017</h3><ul>
<li>Documentation:<br />
- xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný)<br />
+ xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)<br />
</li>
<li>Portability:<br />
<li>Improvements:<br />
Reuse xmlHaltParser() where it makes sense (Daniel Veillard),<br />
xmlStopParser reset errNo (Daniel Veillard),<br />
- Reenable xz support by default (Daniel Veillard),<br />
+ Re-enable xz support by default (Daniel Veillard),<br />
Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),<br />
Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),<br />
Regression test for bug #695699 (Nick Wellnhofer),<br />
Harden the buffer code and make it more compatible (Daniel Veillard),<br />
More cleanups for input/buffers code (Daniel Veillard),<br />
Cleanup function xmlBufResetInput(),<br /> to set input from Buffer (Daniel Veillard)
- Swicth the test program for characters to new input buffers (Daniel Veillard),<br />
+ Switch the test program for characters to new input buffers (Daniel Veillard),<br />
Convert the HTML tree module to the new buffers (Daniel Veillard),<br />
Convert of the HTML parser to new input buffers (Daniel Veillard),<br />
Convert the writer to new output buffer and save APIs (Daniel Veillard),<br />
Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
xmlParseNodeInContext problems with an empty document (Tim Elliott),
- HTML element position is not detected propperly (Pavel Andrejs),
+ HTML element position is not detected properly (Pavel Andrejs),
Fix an off by one pointer access (Jüri Aedla),
Try to fix a problem with entities in SAX mode (Daniel Veillard),
Fix a crash with xmllint --path on empty results (Daniel Veillard),
Small fix for previous commit (Daniel Veillard),
Fix a potential freeing error in XPath (Daniel Veillard),
Fix a potential memory access error (Daniel Veillard),
- Reactivate the shared library versionning script (Daniel Veillard)
+ Reactivate the shared library versioning script (Daniel Veillard)
</li>
<li>Improvements:
Problem with extern extern in header (Daniel Veillard),
Add -lnetwork for compiling on Haiku (Scott McCreary),
Runtest portability patch for Solaris (Tim Rice),
- Small patch to accomodate the Haiku OS (Scott McCreary),
+ Small patch to accommodate the Haiku OS (Scott McCreary),
584605 package VxWorks folder in the distribution (Daniel Veillard),
574017 Realloc too expensive on most platform (Daniel Veillard),
Fix windows build (Rob Richards),
558452 RNG compilation of optional multiple child (Daniel Veillard),
579746 XSD validation not correct / nilable groups (Daniel Veillard),
502960 provide namespace stack when parsing entity (Daniel Veillard),
- 566012 part 2 fix regresion tests and push mode (Daniel Veillard),
+ 566012 part 2 fix regression tests and push mode (Daniel Veillard),
566012 autodetected encoding and encoding conflict (Daniel Veillard),
584220 xpointer(/) and xinclude problems (Daniel Veillard),
587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
parsing and validation fixes based on the W3C regression tests, reader
tree skipping function fix (Ashwin), Schemas regexps escaping fix
(Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
- when encoder cant serialize characters on output</li>
+ when encoder can't serialize characters on output</li>
<li>Code cleanup: compilation fix without the reader, without the output
(Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
serious cleanup of the entity handling code</li>
<li>Improvement: switch parser to XML-1.0 5th edition, add parsing flags
for old versions, switch URI parsing to RFC 3986,
add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
- new hashing functions for dictionnaries (based on Stefan Behnel work),
+ new hashing functions for dictionaries (based on Stefan Behnel work),
improve handling of misplaced html/head/body in HTML parser, better
regression test tools and code coverage display, better algorithms
to detect various versions of the billion laughts attacks, make
</li>
<li>Code cleanup: fix open() call third argument, regexp cut'n paste
copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
- some make distcheck realted fixes (John Carr)</li>
+ some make distcheck related fixes (John Carr)</li>
<li>Improvements: HTTP Header: includes port number (William Brack),
testURI --debug option, </li>
</ul><h3>2.6.30: Aug 23 2007</h3><ul>
<li>bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
attribute (Kasimier), crash when using the recover mode,
xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
- missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
+ missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
(Kasimier), warning on entities processing, XHTML script and style
serialization (Kasimier), python generator for long types, bug in
xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
allocation bug (Marton Illes), error message end of line (Rob Richards),
fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
- crasher, parser safety patch (Ben Darnell), _private context propagation
+ crash, parser safety patch (Ben Darnell), _private context propagation
when parsing entities (with Michael Day), fix entities behaviour when
using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
context, arg error in SAX callback (Mike Hommey), fix mixed-content
Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
namespace ahndling in Schemas (Kasimier), empty model group in Schemas
(Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
- xs:anyType in Schemas (Kasimier), Python resolver emmitting error
+ xs:anyType in Schemas (Kasimier), Python resolver emitting error
messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
<li>build fixes: Windows build (Rob Richards), Mingw compilation (Igor
Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
andriy@google.com), use gcc weak references to pthread to avoid the
- pthread dependancy on Linux, compilation problem (Steve Nairn), compiling
+ pthread dependency on Linux, compilation problem (Steve Nairn), compiling
of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
compilation when disabling parts of the library, standalone test
distribution.</li>
Linux/ELF/gcc4</li>
<li>bug fixes: schemas type decimal fixups (William Brack), xmmlint return
code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
- Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin),
+ Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
(Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
HTML serialization of name attribute on a elements, Python error handlers
Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li>
<li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
- xmlreader stopping on non-fatal errors, thread support for dictionnaries
+ xmlreader stopping on non-fatal errors, thread support for dictionaries
reference counting (Gary Coady), internal subset and push problem, URL
saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
<li>bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
conversion functions return values, UTF-8 bug affecting XPath reported by
Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
- <li>documentation: fix to xmllint man page, some API function descritpion
+ <li>documentation: fix to xmllint man page, some API function description
were updated.</li>
<li>improvements: DTD validation APIs provided at the Python level (Brent
Hendricks)</li>
William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
William), Relax-NG name classes compares (William), XInclude duplicate
fallback (William), external DTD encoding detection (William), a DTD
- validation bug (William), xmlReader Close() fix, recusive extention
+ validation bug (William), xmlReader Close() fix, recursive extension
schemas</li>
<li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
save optimization, better handle IIS broken HTTP redirect behaviour (Ian
Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
- dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
+ dependency, XML Schemas union support (Kasimier Buchcik), warning removal
clanup (William), keep ChangeLog compressed when installing from RPMs</li>
<li>documentation: examples and xmlDocDumpMemory docs (John Fleck), new
example (load, xpath, modify, save), xmlCatalogDump() comments,</li>
William) reported by Yuuichi Teranishi</li>
<li>bugfixes: make test and path issues, xmlWriter attribute serialization
(William Brack), xmlWriter indentation (William), schemas validation
- (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg
+ (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
Paraschenko), XInclude empty fallback (William), HTML warnings (William),
XPointer in XInclude (William), Python namespace serialization,
isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
<li>Windows compilation: mingw, msys (Mikhail Grushinskiy), function
prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
patch</li>
- <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in
+ <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
input.</li>
</ul><h3>2.6.5: Jan 25 2004</h3><ul>
- <li>Bugfixes: dictionnaries for schemas (William Brack), regexp segfault
+ <li>Bugfixes: dictionaries for schemas (William Brack), regexp segfault
(William), xs:all problem (William), a number of XPointer bugfixes
(William), xmllint error go to stderr, DTD validation problem with
namespace, memory leak (William), SAX1 cleanup and minimal options fixes
also contains numerous fixes and enhancements:
<ul>
<li>added xmlStopParser() to stop parsing</li>
- <li>improved a lot parsing speed when there is large CDATA blocs</li>
+ <li>improved a lot parsing speed when there is large CDATA blocks</li>
<li>includes XPath patches provided by Picdar Technology</li>
<li>tried to fix as much as possible DTD validation and namespace
related problems</li>
<li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
libxslt as part of GNU ClasspathX project.</li>
- <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for
+ <li>Patrick McPhee provides Rexx bindings for libxml2 and libxslt, look for
<a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
<li><a href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
provides <a href="http://www.satimage.fr/software/en/downloads_osaxen.html">XMLLib
osax</a>. This is an osax for Mac OS X with a set of commands to
implement in AppleScript the XML DOM, XPATH and XSLT. Also includes
commands for Property-lists (Apple's fast lookup table XML format.)</li>
- <li>Francesco Montorsi developped <a href="https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182">wxXml2</a>
+ <li>Francesco Montorsi developed <a href="https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182">wxXml2</a>
wrappers that interface libxml2, allowing wxWidgets applications to
load/save/edit XML instances.</li>
</ul><p>The distribution includes a set of Python bindings, which are guaranteed
<release version="2.9.8">
<symbol file="hash">xmlHashDefaultDeallocator</symbol>
</release>
+ <release version="2.9.11">
+ <symbol file="xmlIO">xmlPopOutputCallbacks</symbol>
+ </release>
</symbols>
<p>Here is the list of public releases:</p>
+<h3>v2.9.11: May 13 2021</h3>
+<ul>
+ <li>Security:<br/>
+ Patch for security issue CVE-2021-3541 (Daniel Veillard)<br/>
+ </li>
+
+ <li>Documentation:<br/>
+ Clarify xmlNewDocProp documentation (Nick Wellnhofer)<br/>
+ </li>
+
+ <li>Portability:<br/>
+ CMake: Only add postfixes if MSVC (Christopher Degawa),<br/>
+ Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),<br/>
+ Use CMake PROJECT_VERSION (Markus Rickert),<br/>
+ Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),<br/>
+ Add CI for CMake on MSVC (Markus Rickert),<br/>
+ Update minimum required CMake version (Markus Rickert),<br/>
+ Add variables for configured options to CMake config files (Markus Rickert),<br/>
+ Check if variables exist when defining targets (Markus Rickert),<br/>
+ Check if target exists when reading target properties (Markus Rickert),<br/>
+ Add xmlcatalog target and definition to config files (Markus Rickert),<br/>
+ Remove include directories for link-only dependencies (Markus Rickert),<br/>
+ Fix ICU build in CMake (Markus Rickert),<br/>
+ Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),<br/>
+ Update CMake config files (Markus Rickert),<br/>
+ Add xmlcatalog and xmllint to CMake export (Markus Rickert),<br/>
+ Simplify xmlexports.h (Nick Wellnhofer),<br/>
+ Require dependencies based on enabled CMake options (Markus Rickert),<br/>
+ Use NAMELINK_COMPONENT in CMake install (Markus Rickert),<br/>
+ Add CMake files to EXTRA_DIST (Markus Rickert),<br/>
+ Add missing compile definition for static builds to CMake (Markus Rickert),<br/>
+ Add CI for CMake on Linux and MinGW (Markus Rickert),<br/>
+ Fix variable name in win32/configure.js (Nick Wellnhofer),<br/>
+ Fix version parsing in win32/configure.js (Nick Wellnhofer),<br/>
+ Fix autotools warnings (Nick Wellnhofer),<br/>
+ Update config.h.cmake.in (Markus Rickert),<br/>
+ win32: allow passing *FLAGS on command line (Michael Stahl),<br/>
+ Configure file xmlwin32version.h.in on MSVC (Markus Rickert),<br/>
+ List headers individually (Markus Rickert),<br/>
+ Add CMake build files (Markus Rickert),<br/>
+ Parenthesize Py<type>_Check() in ifs (Miro Hrončok),<br/>
+ Minor fixes to configure.js (Nick Wellnhofer)<br/>
+ </li>
+
+ <li>Bug Fixes:<br/>
+ Fix null deref in legacy SAX1 parser (Nick Wellnhofer),<br/>
+ Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),<br/>
+ Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),<br/>
+ Fix htmlTagLookup (Nick Wellnhofer),<br/>
+ Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),<br/>
+ Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),<br/>
+ Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),<br/>
+ Validate UTF8 in xmlEncodeEntities (Joel Hockey),<br/>
+ Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),<br/>
+ Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),<br/>
+ Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),<br/>
+ Fix exponential behavior with recursive entities (Nick Wellnhofer),<br/>
+ Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),<br/>
+ Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),<br/>
+ Fix null deref introduced with previous commit (Nick Wellnhofer),<br/>
+ Check for invalid redeclarations of predefined entities (Nick Wellnhofer),<br/>
+ Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),<br/>
+ parser.c: shrink the input buffer when appropriate (Mike Dalessio),<br/>
+ Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),<br/>
+ Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),<br/>
+ Fix timeout when handling recursive entities (Nick Wellnhofer),<br/>
+ Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),<br/>
+ Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),<br/>
+ use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),<br/>
+ htmlParseComment: treat `--!>` as if it closed the comment (Mike Dalessio),<br/>
+ Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),<br/>
+ encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),<br/>
+ xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val" (Xiaoming Ni),<br/>
+ Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),<br/>
+ Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),<br/>
+ Avoid quadratic checking of identity-constraints (Michael Matz),<br/>
+ Fix building with ICU 68. (Frederik Seiffert),<br/>
+ Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
+ Fix xmlURIEscape memory leaks. (Elliott Hughes),<br/>
+ Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),<br/>
+ Fix caret in regexp character group (Nick Wellnhofer),<br/>
+ parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),<br/>
+ Fix memory leaks in XPointer string-range function (Nick Wellnhofer),<br/>
+ Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),<br/>
+ Fix SEGV in xmlSAXParseFileWithData (yanjinjq),<br/>
+ Fix null deref in XPointer expression error path (Nick Wellnhofer),<br/>
+ Don't call xmlXPathInit directly (Nick Wellnhofer),<br/>
+ Fix cleanup of attributes in XML reader (Nick Wellnhofer),<br/>
+ Fix double free in XML reader with XIncludes (Nick Wellnhofer),<br/>
+ Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),<br/>
+ Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),<br/>
+ Fix error reporting with xi:fallback (Nick Wellnhofer),<br/>
+ Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),<br/>
+ Fix corner case with empty xi:fallback (Nick Wellnhofer),<br/>
+ Fix XInclude regression introduced with recent commit (Nick Wellnhofer),<br/>
+ Fix memory leak in runtest.c (Nick Wellnhofer),<br/>
+ Make "xmllint --push --recovery" work (Nick Wellnhofer),<br/>
+ Revert "Do not URI escape in server side includes" (Nick Wellnhofer),<br/>
+ Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),<br/>
+ Stop counting nbChars in parser context (Nick Wellnhofer),<br/>
+ Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),<br/>
+ Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),<br/>
+ Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),<br/>
+ Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),<br/>
+ Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),<br/>
+ Check for custom free function in global destructor (Nick Wellnhofer),<br/>
+ Fix integer overflow when comparing schema dates (Nick Wellnhofer),<br/>
+ Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),<br/>
+ Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),<br/>
+ Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
+ Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),<br/>
+ Reset XML parser input before reporting errors (David Kilzer),<br/>
+ Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),<br/>
+ Fix HTML push parser lookahead (Nick Wellnhofer),<br/>
+ Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),<br/>
+ Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),<br/>
+ Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),<br/>
+ Reset HTML parser input before reporting error (Nick Wellnhofer),<br/>
+ Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
+ Fix regression introduced with 477c7f6a (Nick Wellnhofer),<br/>
+ Fix quadratic runtime in HTML parser (Nick Wellnhofer),<br/>
+ Reset HTML parser input before reporting encoding error (Nick Wellnhofer),<br/>
+ Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),<br/>
+ Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),<br/>
+ Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),<br/>
+ Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),<br/>
+ Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),<br/>
+ Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br/>
+ Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),<br/>
+ Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),<br/>
+ Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),<br/>
+ Fix return value of xmlCharEncOutput (Nick Wellnhofer),<br/>
+ Never expand parameter entities in text declaration (Nick Wellnhofer),<br/>
+ Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),<br/>
+ Fix use-after-free with validating reader (Nick Wellnhofer),<br/>
+ xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),<br/>
+ Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),<br/>
+ Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),<br/>
+ Make schema validation fail with multiple top-level elements (Nick Wellnhofer),<br/>
+ Call xmlCleanupParser on ELF destruction (Samuel Thibault),<br/>
+ Fix copying of entities in xmlParseReference (Nick Wellnhofer),<br/>
+ Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),<br/>
+ Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),<br/>
+ Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),<br/>
+ Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),<br/>
+ Fix integer overflow in xmlBufferResize (Nick Wellnhofer),<br/>
+ Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),<br/>
+ Remove useless comparisons (Nick Wellnhofer),<br/>
+ Fix overflow check in xmlNodeDump (Nick Wellnhofer),<br/>
+ Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),<br/>
+ Fix freeing of nested documents (Nick Wellnhofer),<br/>
+ Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),<br/>
+ Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),<br/>
+ Fix xml2-config error code (Nick Wellnhofer),<br/>
+ Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),<br/>
+ Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),<br/>
+ Null pointer handling in catalog.c (raniervf),<br/>
+ xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)<br/>
+ </li>
+
+ <li>Improvements:<br/>
+ Store per-element parser state in a struct (Nick Wellnhofer),<br/>
+ update for xsd:language type check (PaulHiggs),<br/>
+ Update INSTALL.libxml2 (Nick Wellnhofer),<br/>
+ Fix include order in c14n.h (Nick Wellnhofer),<br/>
+ Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),<br/>
+ Speed up htmlCheckAutoClose (Nick Wellnhofer),<br/>
+ Speed up htmlTagLookup (Nick Wellnhofer),<br/>
+ Stop checking attributes for UTF-8 validity (Nick Wellnhofer),<br/>
+ Reduce some fuzzer timeouts (Nick Wellnhofer),<br/>
+ Only run a few CI tests unless scheduled (Nick Wellnhofer),<br/>
+ Improve fuzzer stability (Nick Wellnhofer),<br/>
+ Check for feature flags in fuzzer tests (Nick Wellnhofer),<br/>
+ Another attempt at improving fuzzer stability (Nick Wellnhofer),<br/>
+ Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),<br/>
+ Add charset names to fuzzing dictionaries (Nick Wellnhofer),<br/>
+ Improve HTML fuzzer stability (Nick Wellnhofer),<br/>
+ Add CI for MSVC x86 (Markus Rickert),<br/>
+ Add a flag to not output anything when xmllint succeeded (hhb),<br/>
+ Speed up HTML fuzzer (Nick Wellnhofer),<br/>
+ Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),<br/>
+ Handle malloc failures in fuzzing code (Nick Wellnhofer),<br/>
+ add test coverage for incorrectly-closed comments (Mike Dalessio),<br/>
+ Enforce maximum length of fuzz input (Nick Wellnhofer),<br/>
+ Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),<br/>
+ Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
+ Add CI test for Python 3 (Nick Wellnhofer),<br/>
+ Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),<br/>
+ Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),<br/>
+ Allow port numbers up to INT_MAX (Nick Wellnhofer),<br/>
+ Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),<br/>
+ Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),<br/>
+ Hardcode maximum XPath recursion depth (Nick Wellnhofer),<br/>
+ Pass URL of main entity in XML fuzzer (Nick Wellnhofer),<br/>
+ Consolidate seed corpus generation (Nick Wellnhofer),<br/>
+ Test fuzz targets with dummy driver (Nick Wellnhofer),<br/>
+ Fix regression introduced with commit d88df4b (Nick Wellnhofer),<br/>
+ Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),<br/>
+ Add TODO comment in xinclude.c (Nick Wellnhofer),<br/>
+ Stop using maxParserDepth in xpath.c (Nick Wellnhofer),<br/>
+ Remove dead code in xinclude.c (Nick Wellnhofer),<br/>
+ Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),<br/>
+ Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),<br/>
+ Remove unneeded progress checks in HTML parser (Nick Wellnhofer),<br/>
+ Use strcmp when fuzzing (Nick Wellnhofer),<br/>
+ Fix XPath fuzzer (Nick Wellnhofer),<br/>
+ Fuzz XInclude engine (Nick Wellnhofer),<br/>
+ Add XPath and XPointer fuzzer (Nick Wellnhofer),<br/>
+ Update fuzzing code (Nick Wellnhofer),<br/>
+ More *NodeDumpOutput fixes (Nick Wellnhofer),<br/>
+ Fix *NodeDumpOutput functions (Nick Wellnhofer),<br/>
+ Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),<br/>
+ Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),<br/>
+ Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),<br/>
+ Fix .gitattributes (Nick Wellnhofer),<br/>
+ Rework control flow in htmlCurrentChar (Nick Wellnhofer),<br/>
+ Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),<br/>
+ Remove misleading comments in xpath.c (Nick Wellnhofer),<br/>
+ Update to Devhelp index file format version 2 (Andre Klapper),<br/>
+ Set project language to C (Markus Rickert),<br/>
+ Add variable for working directory of XML Conformance Test Suite (Markus Rickert),<br/>
+ Add additional tests and XML Conformance Test Suite (Markus Rickert),<br/>
+ Add command line option for temp directory in runtest (Markus Rickert),<br/>
+ Ensure LF line endings for test files (Markus Rickert),<br/>
+ Enable runtests and testThreads (Markus Rickert),<br/>
+ Limit regexp nesting depth (Nick Wellnhofer),<br/>
+ Fix return values and documentation in encoding.c (Nick Wellnhofer),<br/>
+ Add regexp regression tests (David Kilzer),<br/>
+ Report error for invalid regexp quantifiers (Nick Wellnhofer),<br/>
+ Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),<br/>
+ Copy xs:duration parser from libexslt (Nick Wellnhofer),<br/>
+ Fuzz target for XML Schemas (Nick Wellnhofer),<br/>
+ Move entity recorder to fuzz.c (Nick Wellnhofer),<br/>
+ Fuzz target for HTML parser (Nick Wellnhofer),<br/>
+ Update GitLab CI container (Nick Wellnhofer),<br/>
+ Add options file for xml fuzzer (Nick Wellnhofer),<br/>
+ Add a couple of libFuzzer targets (Nick Wellnhofer),<br/>
+ Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),<br/>
+ Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),<br/>
+ Fix typos (Nick Wellnhofer),<br/>
+ Disable LeakSanitizer (Nick Wellnhofer),<br/>
+ Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),<br/>
+ Add test case for recursive external parsed entities (Nick Wellnhofer),<br/>
+ Enable error tests with entity substitution (Nick Wellnhofer),<br/>
+ Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),<br/>
+ Merge code paths loading external entities (Nick Wellnhofer),<br/>
+ Copy some XMLReader option flags to parser context (Nick Wellnhofer),<br/>
+ Add xmlPopOutputCallbacks (Nick Wellnhofer),<br/>
+ Updated Python test reader2.py (Pieter van Oostrum),<br/>
+ Updated python/tests/tstLastError.py (Pieter van Oostrum),<br/>
+ Use random seed in xmlDictComputeFastKey (Ranier Vilela),<br/>
+ Enable more undefined behavior sanitizers (Nick Wellnhofer)<br/>
+ </li>
+</ul>
+
<h3>v2.9.10: Oct 30 2019</h3>
<ul>
<li>Documentation:<br/>
<h3>2.9.7: Nov 02 2017</h3>
<ul>
<li>Documentation:<br/>
- xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný)<br/>
+ xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)<br/>
</li>
<li>Portability:<br/>
<li>Improvements:<br/>
Reuse xmlHaltParser() where it makes sense (Daniel Veillard),<br/>
xmlStopParser reset errNo (Daniel Veillard),<br/>
- Reenable xz support by default (Daniel Veillard),<br/>
+ Re-enable xz support by default (Daniel Veillard),<br/>
Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),<br/>
Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),<br/>
Regression test for bug #695699 (Nick Wellnhofer),<br/>
Harden the buffer code and make it more compatible (Daniel Veillard),<br/>
More cleanups for input/buffers code (Daniel Veillard),<br/>
Cleanup function xmlBufResetInput(),<br/> to set input from Buffer (Daniel Veillard)
- Swicth the test program for characters to new input buffers (Daniel Veillard),<br/>
+ Switch the test program for characters to new input buffers (Daniel Veillard),<br/>
Convert the HTML tree module to the new buffers (Daniel Veillard),<br/>
Convert of the HTML parser to new input buffers (Daniel Veillard),<br/>
Convert the writer to new output buffer and save APIs (Daniel Veillard),<br/>
Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
xmlParseNodeInContext problems with an empty document (Tim Elliott),
- HTML element position is not detected propperly (Pavel Andrejs),
+ HTML element position is not detected properly (Pavel Andrejs),
Fix an off by one pointer access (Jüri Aedla),
Try to fix a problem with entities in SAX mode (Daniel Veillard),
Fix a crash with xmllint --path on empty results (Daniel Veillard),
Small fix for previous commit (Daniel Veillard),
Fix a potential freeing error in XPath (Daniel Veillard),
Fix a potential memory access error (Daniel Veillard),
- Reactivate the shared library versionning script (Daniel Veillard)
+ Reactivate the shared library versioning script (Daniel Veillard)
</li>
<li>Improvements:
Problem with extern extern in header (Daniel Veillard),
Add -lnetwork for compiling on Haiku (Scott McCreary),
Runtest portability patch for Solaris (Tim Rice),
- Small patch to accomodate the Haiku OS (Scott McCreary),
+ Small patch to accommodate the Haiku OS (Scott McCreary),
584605 package VxWorks folder in the distribution (Daniel Veillard),
574017 Realloc too expensive on most platform (Daniel Veillard),
Fix windows build (Rob Richards),
558452 RNG compilation of optional multiple child (Daniel Veillard),
579746 XSD validation not correct / nilable groups (Daniel Veillard),
502960 provide namespace stack when parsing entity (Daniel Veillard),
- 566012 part 2 fix regresion tests and push mode (Daniel Veillard),
+ 566012 part 2 fix regression tests and push mode (Daniel Veillard),
566012 autodetected encoding and encoding conflict (Daniel Veillard),
584220 xpointer(/) and xinclude problems (Daniel Veillard),
587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
parsing and validation fixes based on the W3C regression tests, reader
tree skipping function fix (Ashwin), Schemas regexps escaping fix
(Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
- when encoder cant serialize characters on output</li>
+ when encoder can't serialize characters on output</li>
<li>Code cleanup: compilation fix without the reader, without the output
(Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
serious cleanup of the entity handling code</li>
<li>Improvement: switch parser to XML-1.0 5th edition, add parsing flags
for old versions, switch URI parsing to RFC 3986,
add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
- new hashing functions for dictionnaries (based on Stefan Behnel work),
+ new hashing functions for dictionaries (based on Stefan Behnel work),
improve handling of misplaced html/head/body in HTML parser, better
regression test tools and code coverage display, better algorithms
to detect various versions of the billion laughts attacks, make
</li>
<li>Code cleanup: fix open() call third argument, regexp cut'n paste
copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
- some make distcheck realted fixes (John Carr)</li>
+ some make distcheck related fixes (John Carr)</li>
<li>Improvements: HTTP Header: includes port number (William Brack),
testURI --debug option, </li>
</ul>
<li>bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
attribute (Kasimier), crash when using the recover mode,
xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
- missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
+ missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
(Kasimier), warning on entities processing, XHTML script and style
serialization (Kasimier), python generator for long types, bug in
xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
allocation bug (Marton Illes), error message end of line (Rob Richards),
fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
- crasher, parser safety patch (Ben Darnell), _private context propagation
+ crash, parser safety patch (Ben Darnell), _private context propagation
when parsing entities (with Michael Day), fix entities behaviour when
using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
context, arg error in SAX callback (Mike Hommey), fix mixed-content
Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
namespace ahndling in Schemas (Kasimier), empty model group in Schemas
(Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
- xs:anyType in Schemas (Kasimier), Python resolver emmitting error
+ xs:anyType in Schemas (Kasimier), Python resolver emitting error
messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
<li>build fixes: Windows build (Rob Richards), Mingw compilation (Igor
Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
andriy@google.com), use gcc weak references to pthread to avoid the
- pthread dependancy on Linux, compilation problem (Steve Nairn), compiling
+ pthread dependency on Linux, compilation problem (Steve Nairn), compiling
of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
compilation when disabling parts of the library, standalone test
distribution.</li>
Linux/ELF/gcc4</li>
<li>bug fixes: schemas type decimal fixups (William Brack), xmmlint return
code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
- Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin),
+ Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
(Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
HTML serialization of name attribute on a elements, Python error handlers
Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li>
<li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
- xmlreader stopping on non-fatal errors, thread support for dictionnaries
+ xmlreader stopping on non-fatal errors, thread support for dictionaries
reference counting (Gary Coady), internal subset and push problem, URL
saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
<li>bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
conversion functions return values, UTF-8 bug affecting XPath reported by
Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
- <li>documentation: fix to xmllint man page, some API function descritpion
+ <li>documentation: fix to xmllint man page, some API function description
were updated.</li>
<li>improvements: DTD validation APIs provided at the Python level (Brent
Hendricks)</li>
William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
William), Relax-NG name classes compares (William), XInclude duplicate
fallback (William), external DTD encoding detection (William), a DTD
- validation bug (William), xmlReader Close() fix, recusive extention
+ validation bug (William), xmlReader Close() fix, recursive extension
schemas</li>
<li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
save optimization, better handle IIS broken HTTP redirect behaviour (Ian
Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
- dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
+ dependency, XML Schemas union support (Kasimier Buchcik), warning removal
clanup (William), keep ChangeLog compressed when installing from RPMs</li>
<li>documentation: examples and xmlDocDumpMemory docs (John Fleck), new
example (load, xpath, modify, save), xmlCatalogDump() comments,</li>
William) reported by Yuuichi Teranishi</li>
<li>bugfixes: make test and path issues, xmlWriter attribute serialization
(William Brack), xmlWriter indentation (William), schemas validation
- (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg
+ (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
Paraschenko), XInclude empty fallback (William), HTML warnings (William),
XPointer in XInclude (William), Python namespace serialization,
isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
<li>Windows compilation: mingw, msys (Mikhail Grushinskiy), function
prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
patch</li>
- <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in
+ <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
input.</li>
</ul>
<h3>2.6.5: Jan 25 2004</h3>
<ul>
- <li>Bugfixes: dictionnaries for schemas (William Brack), regexp segfault
+ <li>Bugfixes: dictionaries for schemas (William Brack), regexp segfault
(William), xs:all problem (William), a number of XPointer bugfixes
(William), xmllint error go to stderr, DTD validation problem with
namespace, memory leak (William), SAX1 cleanup and minimal options fixes
also contains numerous fixes and enhancements:
<ul>
<li>added xmlStopParser() to stop parsing</li>
- <li>improved a lot parsing speed when there is large CDATA blocs</li>
+ <li>improved a lot parsing speed when there is large CDATA blocks</li>
<li>includes XPath patches provided by Picdar Technology</li>
<li>tried to fix as much as possible DTD validation and namespace
related problems</li>
<li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
libxslt as part of GNU ClasspathX project.</li>
- <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for
+ <li>Patrick McPhee provides Rexx bindings for libxml2 and libxslt, look for
<a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
<li><a
href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
osax</a>. This is an osax for Mac OS X with a set of commands to
implement in AppleScript the XML DOM, XPATH and XSLT. Also includes
commands for Property-lists (Apple's fast lookup table XML format.)</li>
- <li>Francesco Montorsi developped <a
+ <li>Francesco Montorsi developed <a
href="https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182">wxXml2</a>
wrappers that interface libxml2, allowing wxWidgets applications to
load/save/edit XML instances.</li>
<ul>
<li><a href="#Introducti">Introduction: why a new API</a></li>
<li><a href="#Walking">Walking a simple tree</a></li>
- <li><a href="#Extracting">Extracting informations for the current
+ <li><a href="#Extracting">Extracting information for the current
node</a></li>
- <li><a href="#Extracting1">Extracting informations for the
+ <li><a href="#Extracting1">Extracting information for the
attributes</a></li>
<li><a href="#Validating">Validating a document</a></li>
<li><a href="#Entities">Entities substitution</a></li>
/**
* xmlEncodingErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* Returns 0 if success, or -1 otherwise
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
static int
asciiToUTF8(unsigned char* out, int *outlen,
* Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
static int
UTF8Toascii(unsigned char* out, int *outlen,
* Returns the number of bytes written if success, or -1 otherwise
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
int
isolat1ToUTF8(unsigned char* out, int *outlen,
if (len < 0)
return(-1);
+ /*
+ * FIXME: Conversion functions must assure valid UTF-8, so we have
+ * to check for UTF-8 validity. Preferably, this converter shouldn't
+ * be used at all.
+ */
memcpy(out, inb, len);
*outlen = len;
or -1 otherwise
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
int
UTF8Toisolat1(unsigned char* out, int *outlen,
{
unsigned char* outstart = out;
const unsigned char* processed = inb;
- unsigned char* outend = out + *outlen;
+ unsigned char* outend;
unsigned short* in = (unsigned short*) inb;
unsigned short* inend;
unsigned int c, d, inlen;
unsigned char *tmp;
int bits;
+ if (*outlen == 0) {
+ *inlenb = 0;
+ return(0);
+ }
+ outend = out + *outlen;
if ((*inlenb % 2) == 1)
(*inlenb)--;
inlen = *inlenb / 2;
if ((handler == NULL) || (handlers == NULL)) {
xmlEncodingErr(XML_I18N_NO_HANDLER,
"xmlRegisterCharEncodingHandler: NULL handler !\n", NULL);
- return;
+ goto free_handler;
}
if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) {
xmlEncodingErr(XML_I18N_EXCESS_HANDLER,
"xmlRegisterCharEncodingHandler: Too many handler registered, see %s\n",
"MAX_ENCODING_HANDLERS");
- return;
+ goto free_handler;
}
handlers[nbCharEncodingHandler++] = handler;
+ return;
+
+free_handler:
+ if (handler != NULL) {
+ if (handler->name != NULL) {
+ xmlFree(handler->name);
+ }
+ xmlFree(handler);
+ }
}
/**
* @cd: iconv converter data structure
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
- * @in: a pointer to an array of ISO Latin 1 chars
+ * @in: a pointer to an array of input bytes
* @inlen: the length of @in
*
* Returns 0 if success, or
*
* The value of @inlen after return is the number of octets consumed
* as the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
static int
xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
* @toUnicode : non-zero if toUnicode. 0 otherwise.
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
- * @in: a pointer to an array of ISO Latin 1 chars
+ * @in: a pointer to an array of input bytes
* @inlen: the length of @in
* @flush: if true, indicates end of input
*
*
* The value of @inlen after return is the number of octets consumed
* as the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
*/
static int
xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
* *
************************************************************************/
+/**
+ * xmlEncInputChunk:
+ * @handler: encoding handler
+ * @out: a pointer to an array of bytes to store the result
+ * @outlen: the length of @out
+ * @in: a pointer to an array of input bytes
+ * @inlen: the length of @in
+ * @flush: flush (ICU-related)
+ *
+ * Returns 0 if success, or
+ * -1 by lack of space, or
+ * -2 if the transcoding fails (for *in is not valid utf8 string or
+ * the result of transformation can't fit into the encoding we want), or
+ * -3 if there the last byte can't form a single output char.
+ *
+ * The value of @inlen after return is the number of octets consumed
+ * as the return value is 0, else unpredictable.
+ * The value of @outlen after return is the number of octets produced.
+ */
static int
xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
int *outlen, const unsigned char *in, int *inlen, int flush) {
if (handler->input != NULL) {
ret = handler->input(out, outlen, in, inlen);
+ if (ret > 0)
+ ret = 0;
}
#ifdef LIBXML_ICONV_ENABLED
else if (handler->iconv_in != NULL) {
return(ret);
}
-/* Returns -4 if no output function was found. */
+/**
+ * xmlEncOutputChunk:
+ * @handler: encoding handler
+ * @out: a pointer to an array of bytes to store the result
+ * @outlen: the length of @out
+ * @in: a pointer to an array of input bytes
+ * @inlen: the length of @in
+ *
+ * Returns 0 if success, or
+ * -1 by lack of space, or
+ * -2 if the transcoding fails (for *in is not valid utf8 string or
+ * the result of transformation can't fit into the encoding we want), or
+ * -3 if there the last byte can't form a single output char.
+ * -4 if no output function was found.
+ *
+ * The value of @inlen after return is the number of octets consumed
+ * as the return value is 0, else unpredictable.
+ * The value of @outlen after return is the number of octets produced.
+ */
static int
xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
int *outlen, const unsigned char *in, int *inlen) {
if (handler->output != NULL) {
ret = handler->output(out, outlen, in, inlen);
+ if (ret > 0)
+ ret = 0;
}
#ifdef LIBXML_ICONV_ENABLED
else if (handler->iconv_out != NULL) {
#ifdef LIBXML_ICU_ENABLED
else if (handler->uconv_out != NULL) {
ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
- TRUE);
+ 1);
}
#endif /* LIBXML_ICU_ENABLED */
else {
*/
if (ret == -3) ret = 0;
if (ret == -1) ret = 0;
- return(ret);
+ return(written ? written : ret);
}
/**
*/
if (ret == -3) ret = 0;
if (ret == -1) ret = 0;
- return(ret);
+ return(c_out ? c_out : ret);
}
/**
{
int ret;
size_t written;
- size_t writtentot = 0;
+ int writtentot = 0;
size_t toconv;
int c_in;
int c_out;
xmlGenericError(xmlGenericErrorContext,
"initialized encoder\n");
#endif
- return(0);
+ return(c_out);
}
/*
goto retry;
}
}
- return(ret);
+ return(writtentot ? writtentot : ret);
}
#endif
goto retry;
}
}
- return(ret);
+ return(writtentot ? writtentot : ret);
}
/**
/**
* xmlEntitiesErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
const xmlChar *content) {
xmlDictPtr dict = NULL;
xmlEntitiesTablePtr table = NULL;
- xmlEntityPtr ret;
+ xmlEntityPtr ret, predef;
if (name == NULL)
return(NULL);
case XML_INTERNAL_GENERAL_ENTITY:
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
+ predef = xmlGetPredefinedEntity(name);
+ if (predef != NULL) {
+ int valid = 0;
+
+ /* 4.6 Predefined Entities */
+ if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
+ (content != NULL)) {
+ int c = predef->content[0];
+
+ if (((content[0] == c) && (content[1] == 0)) &&
+ ((c == '>') || (c == '\'') || (c == '"'))) {
+ valid = 1;
+ } else if ((content[0] == '&') && (content[1] == '#')) {
+ if (content[2] == 'x') {
+ xmlChar *hex = BAD_CAST "0123456789ABCDEF";
+ xmlChar ref[] = "00;";
+
+ ref[0] = hex[c / 16 % 16];
+ ref[1] = hex[c % 16];
+ if (xmlStrcasecmp(&content[3], ref) == 0)
+ valid = 1;
+ } else {
+ xmlChar ref[] = "00;";
+
+ ref[0] = '0' + c / 10 % 10;
+ ref[1] = '0' + c % 10;
+ if (xmlStrEqual(&content[2], ref))
+ valid = 1;
+ }
+ }
+ }
+ if (!valid) {
+ xmlEntitiesErr(XML_ERR_ENTITY_PROCESSING,
+ "xmlAddEntity: invalid redeclaration of predefined"
+ " entity");
+ return(NULL);
+ }
+ }
if (dtd->entities == NULL)
dtd->entities = xmlHashCreateDict(0, dict);
table = dtd->entities;
} else {
/*
* We assume we have UTF-8 input.
+ * It must match either:
+ * 110xxxxx 10xxxxxx
+ * 1110xxxx 10xxxxxx 10xxxxxx
+ * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ * That is:
+ * cur[0] is 11xxxxxx
+ * cur[1] is 10xxxxxx
+ * cur[2] is 10xxxxxx if cur[0] is 111xxxxx
+ * cur[3] is 10xxxxxx if cur[0] is 1111xxxx
+ * cur[0] is not 11111xxx
*/
char buf[11], *ptr;
int val = 0, l = 1;
- if (*cur < 0xC0) {
+ if (((cur[0] & 0xC0) != 0xC0) ||
+ ((cur[1] & 0xC0) != 0x80) ||
+ (((cur[0] & 0xE0) == 0xE0) && ((cur[2] & 0xC0) != 0x80)) ||
+ (((cur[0] & 0xF0) == 0xF0) && ((cur[3] & 0xC0) != 0x80)) ||
+ (((cur[0] & 0xF8) == 0xF8))) {
xmlEntitiesErr(XML_CHECK_NOT_UTF8,
"xmlEncodeEntities: input not UTF-8");
if (doc != NULL)
* xmlParserPrintFileInfo:
* @input: an xmlParserInputPtr input
*
- * Displays the associated file and line informations for the current input
+ * Displays the associated file and line information for the current input
*/
void
* of the usual "base" (doc->URL) for the node (bug 152623).
*/
xmlNodePtr prev = baseptr;
+ char *href = NULL;
int inclcount = 0;
while (prev != NULL) {
if (prev->prev == NULL)
else {
prev = prev->prev;
if (prev->type == XML_XINCLUDE_START) {
- if (--inclcount < 0)
- break;
+ if (inclcount > 0) {
+ --inclcount;
+ } else {
+ href = (char *) xmlGetProp(prev, BAD_CAST "href");
+ if (href != NULL)
+ break;
+ }
} else if (prev->type == XML_XINCLUDE_END)
inclcount++;
}
}
- if (prev != NULL) {
- if (prev->type == XML_XINCLUDE_START) {
- prev->type = XML_ELEMENT_NODE;
- to->file = (char *) xmlGetProp(prev, BAD_CAST "href");
- prev->type = XML_XINCLUDE_START;
- } else {
- to->file = (char *) xmlGetProp(prev, BAD_CAST "href");
- }
- } else
+ if (href != NULL)
+ to->file = href;
+ else
#endif
to->file = (char *) xmlStrdup(baseptr->doc->URL);
if ((to->file == NULL) && (node != NULL) && (node->doc != NULL)) {
* @domain: where the error comes from
* @code: the error code
* @node: the context node
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
--- /dev/null
+corpus/
+genSeed
+html
+regexp
+schema
+seed/html*
+seed/schema*
+seed/xml*
+seed/xpath*
+testFuzzer
+uri
+xml
+xpath
--- /dev/null
+AUTOMAKE_OPTIONS = -Wno-syntax
+EXTRA_PROGRAMS = genSeed html regexp schema uri xml xpath
+check_PROGRAMS = testFuzzer
+EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
+ seed/uri
+CLEANFILES = $(EXTRA_PROGRAMS)
+AM_CPPFLAGS = -I$(top_srcdir)/include
+DEPENDENCIES = $(top_builddir)/libxml2.la
+LDADD = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)
+
+XML_MAX_LEN = 80000
+# Single quotes to avoid wildcard expansion by the shell
+XML_SEED_CORPUS_SRC = \
+ '$(top_srcdir)/test/*' \
+ '$(top_srcdir)/test/errors/*.xml' \
+ '$(top_srcdir)/test/errors10/*.xml' \
+ '$(top_srcdir)/test/namespaces/*' \
+ '$(top_srcdir)/test/valid/*.xml' \
+ '$(top_srcdir)/test/VC/*' \
+ '$(top_srcdir)/test/VCM/*' \
+ '$(top_srcdir)/test/XInclude/docs/*' \
+ '$(top_srcdir)/test/xmlid/*'
+
+testFuzzer_SOURCES = testFuzzer.c fuzz.c
+
+.PHONY: tests corpus clean-corpus
+
+corpus: seed/html.stamp seed/schema.stamp seed/xml.stamp seed/xpath.stamp
+
+tests: testFuzzer$(EXEEXT) corpus
+ @echo "## Running fuzzer tests"
+ @./testFuzzer$(EXEEXT)
+
+clean-corpus:
+ rm -rf seed/html.stamp seed/html
+ rm -rf seed/schema.stamp seed/schema
+ rm -rf seed/xml.stamp seed/xml
+ rm -rf seed/xpath.stamp seed/xpath
+
+# Seed corpus
+
+genSeed_SOURCES = genSeed.c fuzz.c
+
+# XML fuzzer
+
+seed/xml.stamp: genSeed$(EXEEXT)
+ @mkdir -p seed/xml
+ @./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC)
+ @touch seed/xml.stamp
+
+xml_SOURCES = xml.c fuzz.c
+xml_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-xml: xml$(EXEEXT) seed/xml.stamp
+ @mkdir -p corpus/xml
+ ./xml$(EXEEXT) \
+ -dict=xml.dict \
+ -max_len=$(XML_MAX_LEN) \
+ -timeout=20 \
+ corpus/xml seed/xml
+
+# HTML fuzzer
+
+seed/html.stamp: genSeed$(EXEEXT)
+ @mkdir -p seed/html
+ @./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*'
+ @touch seed/html.stamp
+
+html_SOURCES = html.c fuzz.c
+html_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-html: html$(EXEEXT) seed/html.stamp
+ @mkdir -p corpus/html
+ ./html$(EXEEXT) \
+ -dict=html.dict \
+ -max_len=1000000 \
+ -timeout=10 \
+ corpus/html seed/html
+
+# Regexp fuzzer
+
+regexp_SOURCES = regexp.c fuzz.c
+regexp_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-regexp: regexp$(EXEEXT)
+ @mkdir -p corpus/regexp
+ ./regexp$(EXEEXT) \
+ -dict=regexp.dict \
+ -max_len=200 \
+ -timeout=5 \
+ corpus/regexp $(srcdir)/seed/regexp
+
+# URI fuzzer
+
+uri_SOURCES = uri.c fuzz.c
+uri_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-uri: uri$(EXEEXT)
+ @mkdir -p corpus/uri
+ ./uri$(EXEEXT) \
+ -max_len=10000 \
+ -timeout=2 \
+ corpus/uri $(srcdir)/seed/uri
+
+# XML Schema fuzzer
+
+seed/schema.stamp: genSeed$(EXEEXT)
+ @mkdir -p seed/schema
+ @./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd'
+ @touch seed/schema.stamp
+
+schema_SOURCES = schema.c fuzz.c
+schema_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-schema: schema$(EXEEXT) seed/schema.stamp
+ @mkdir -p corpus/schema
+ ./schema$(EXEEXT) \
+ -dict=schema.dict \
+ -max_len=$(XML_MAX_LEN) \
+ -timeout=20 \
+ corpus/schema seed/schema
+
+# XPath fuzzer
+
+seed/xpath.stamp: genSeed$(EXEEXT)
+ @mkdir -p seed/xpath
+ @./genSeed$(EXEEXT) xpath "$(top_builddir)/test/XPath"
+ @touch seed/xpath.stamp
+
+xpath_SOURCES = xpath.c fuzz.c
+xpath_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
+ @mkdir -p corpus/xpath
+ ./xpath$(EXEEXT) \
+ -dict=xpath.dict \
+ -max_len=10000 \
+ -timeout=20 \
+ corpus/xpath seed/xpath
+
--- /dev/null
+libFuzzer instructions for libxml2
+==================================
+
+Set compiler and options:
+
+ export CC=clang
+ export CFLAGS="-g -fsanitize=fuzzer-no-link,address,undefined \
+ -fno-sanitize-recover=all \
+ -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
+
+Build libxml2 with instrumentation:
+
+ ./configure --without-python
+ make
+
+Run fuzzers:
+
+ make -C fuzz fuzz-xml
+
--- /dev/null
+/*
+ * fuzz.c: Common functions for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <libxml/hash.h>
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/tree.h>
+#include <libxml/xmlIO.h>
+#include "fuzz.h"
+
+typedef struct {
+ const char *data;
+ size_t size;
+} xmlFuzzEntityInfo;
+
+/* Single static instance for now */
+static struct {
+ /* Original data */
+ const char *data;
+ size_t size;
+
+ /* Remaining data */
+ const char *ptr;
+ size_t remaining;
+
+ /* Buffer for unescaped strings */
+ char *outBuf;
+ char *outPtr; /* Free space at end of buffer */
+
+ xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
+
+ /* The first entity is the main entity. */
+ const char *mainUrl;
+ xmlFuzzEntityInfo *mainEntity;
+} fuzzData;
+
+/**
+ * xmlFuzzErrorFunc:
+ *
+ * An error function that simply discards all errors.
+ */
+void
+xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
+ ...) {
+}
+
+/**
+ * xmlFuzzDataInit:
+ *
+ * Initialize fuzz data provider.
+ */
+void
+xmlFuzzDataInit(const char *data, size_t size) {
+ fuzzData.data = data;
+ fuzzData.size = size;
+ fuzzData.ptr = data;
+ fuzzData.remaining = size;
+
+ fuzzData.outBuf = xmlMalloc(size + 1);
+ fuzzData.outPtr = fuzzData.outBuf;
+
+ fuzzData.entities = xmlHashCreate(8);
+ fuzzData.mainUrl = NULL;
+ fuzzData.mainEntity = NULL;
+}
+
+/**
+ * xmlFuzzDataFree:
+ *
+ * Cleanup fuzz data provider.
+ */
+void
+xmlFuzzDataCleanup(void) {
+ xmlFree(fuzzData.outBuf);
+ xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
+}
+
+/**
+ * xmlFuzzReadInt:
+ * @size: size of string in bytes
+ *
+ * Read an integer from the fuzz data.
+ */
+int
+xmlFuzzReadInt() {
+ int ret;
+
+ if (fuzzData.remaining < sizeof(int))
+ return(0);
+ memcpy(&ret, fuzzData.ptr, sizeof(int));
+ fuzzData.ptr += sizeof(int);
+ fuzzData.remaining -= sizeof(int);
+
+ return ret;
+}
+
+/**
+ * xmlFuzzReadRemaining:
+ * @size: size of string in bytes
+ *
+ * Read remaining bytes from fuzz data.
+ */
+const char *
+xmlFuzzReadRemaining(size_t *size) {
+ const char *ret = fuzzData.ptr;
+
+ *size = fuzzData.remaining;
+ fuzzData.ptr += fuzzData.remaining;
+ fuzzData.remaining = 0;
+
+ return(ret);
+}
+
+/*
+ * xmlFuzzWriteString:
+ * @out: output file
+ * @str: string to write
+ *
+ * Write a random-length string to file in a format similar to
+ * FuzzedDataProvider. Backslash followed by newline marks the end of the
+ * string. Two backslashes are used to escape a backslash.
+ */
+void
+xmlFuzzWriteString(FILE *out, const char *str) {
+ for (; *str; str++) {
+ int c = (unsigned char) *str;
+ putc(c, out);
+ if (c == '\\')
+ putc(c, out);
+ }
+ putc('\\', out);
+ putc('\n', out);
+}
+
+/**
+ * xmlFuzzReadString:
+ * @size: size of string in bytes
+ *
+ * Read a random-length string from the fuzz data.
+ *
+ * The format is similar to libFuzzer's FuzzedDataProvider but treats
+ * backslash followed by newline as end of string. This makes the fuzz data
+ * more readable. A backslash character is escaped with another backslash.
+ *
+ * Returns a zero-terminated string or NULL if the fuzz data is exhausted.
+ */
+const char *
+xmlFuzzReadString(size_t *size) {
+ const char *out = fuzzData.outPtr;
+
+ while (fuzzData.remaining > 0) {
+ int c = *fuzzData.ptr++;
+ fuzzData.remaining--;
+
+ if ((c == '\\') && (fuzzData.remaining > 0)) {
+ int c2 = *fuzzData.ptr;
+
+ if (c2 == '\n') {
+ fuzzData.ptr++;
+ fuzzData.remaining--;
+ *size = fuzzData.outPtr - out;
+ *fuzzData.outPtr++ = '\0';
+ return(out);
+ }
+ if (c2 == '\\') {
+ fuzzData.ptr++;
+ fuzzData.remaining--;
+ }
+ }
+
+ *fuzzData.outPtr++ = c;
+ }
+
+ if (fuzzData.outPtr > out) {
+ *size = fuzzData.outPtr - out;
+ *fuzzData.outPtr++ = '\0';
+ return(out);
+ }
+
+ return(NULL);
+}
+
+/**
+ * xmlFuzzReadEntities:
+ *
+ * Read entities like the main XML file, external DTDs, external parsed
+ * entities from fuzz data.
+ */
+void
+xmlFuzzReadEntities(void) {
+ size_t num = 0;
+
+ while (1) {
+ const char *url, *entity;
+ size_t urlSize, entitySize;
+ xmlFuzzEntityInfo *entityInfo;
+
+ url = xmlFuzzReadString(&urlSize);
+ if (url == NULL) break;
+
+ entity = xmlFuzzReadString(&entitySize);
+ if (entity == NULL) break;
+
+ if (xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
+ entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
+ if (entityInfo == NULL)
+ break;
+ entityInfo->data = entity;
+ entityInfo->size = entitySize;
+
+ xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
+
+ if (num == 0) {
+ fuzzData.mainUrl = url;
+ fuzzData.mainEntity = entityInfo;
+ }
+
+ num++;
+ }
+ }
+}
+
+/**
+ * xmlFuzzMainUrl:
+ *
+ * Returns the main URL.
+ */
+const char *
+xmlFuzzMainUrl(void) {
+ return(fuzzData.mainUrl);
+}
+
+/**
+ * xmlFuzzMainEntity:
+ * @size: size of the main entity in bytes
+ *
+ * Returns the main entity.
+ */
+const char *
+xmlFuzzMainEntity(size_t *size) {
+ if (fuzzData.mainEntity == NULL)
+ return(NULL);
+ *size = fuzzData.mainEntity->size;
+ return(fuzzData.mainEntity->data);
+}
+
+/**
+ * xmlFuzzEntityLoader:
+ *
+ * The entity loader for fuzz data.
+ */
+xmlParserInputPtr
+xmlFuzzEntityLoader(const char *URL, const char *ID ATTRIBUTE_UNUSED,
+ xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr input;
+ xmlFuzzEntityInfo *entity;
+
+ if (URL == NULL)
+ return(NULL);
+ entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
+ if (entity == NULL)
+ return(NULL);
+
+ input = xmlNewInputStream(ctxt);
+ input->filename = NULL;
+ input->buf = xmlParserInputBufferCreateMem(entity->data, entity->size,
+ XML_CHAR_ENCODING_NONE);
+ if (input->buf == NULL) {
+ xmlFreeInputStream(input);
+ return(NULL);
+ }
+ input->base = input->cur = xmlBufContent(input->buf->buffer);
+ input->end = input->base + entity->size;
+
+ return input;
+}
+
+/**
+ * xmlFuzzExtractStrings:
+ *
+ * Extract C strings from input data. Use exact-size allocations to detect
+ * potential memory errors.
+ */
+size_t
+xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
+ size_t numStrings) {
+ const char *start = data;
+ const char *end = data + size;
+ size_t i = 0, ret;
+
+ while (i < numStrings) {
+ size_t strSize = end - start;
+ const char *zero = memchr(start, 0, strSize);
+
+ if (zero != NULL)
+ strSize = zero - start;
+
+ strings[i] = xmlMalloc(strSize + 1);
+ memcpy(strings[i], start, strSize);
+ strings[i][strSize] = '\0';
+
+ i++;
+ if (zero != NULL)
+ start = zero + 1;
+ else
+ break;
+ }
+
+ ret = i;
+
+ while (i < numStrings) {
+ strings[i] = NULL;
+ i++;
+ }
+
+ return(ret);
+}
+
+char *
+xmlSlurpFile(const char *path, size_t *sizeRet) {
+ FILE *file;
+ struct stat statbuf;
+ char *data;
+ size_t size;
+
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+ return(NULL);
+ size = statbuf.st_size;
+ file = fopen(path, "rb");
+ if (file == NULL)
+ return(NULL);
+ data = xmlMalloc(size + 1);
+ if (data != NULL) {
+ if (fread(data, 1, size, file) != size) {
+ xmlFree(data);
+ data = NULL;
+ } else {
+ data[size] = 0;
+ if (sizeRet != NULL)
+ *sizeRet = size;
+ }
+ }
+ fclose(file);
+
+ return(data);
+}
+
--- /dev/null
+/*
+ * fuzz.h: Common functions and macros for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#ifndef __XML_FUZZERCOMMON_H__
+#define __XML_FUZZERCOMMON_H__
+
+#include <stddef.h>
+#include <stdio.h>
+#include <libxml/parser.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+ #define HAVE_HTML_FUZZER
+#endif
+#if defined(LIBXML_REGEXP_ENABLED)
+ #define HAVE_REGEXP_FUZZER
+#endif
+#if defined(LIBXML_SCHEMAS_ENABLED)
+ #define HAVE_SCHEMA_FUZZER
+#endif
+#if 1
+ #define HAVE_URI_FUZZER
+#endif
+#if defined(LIBXML_OUTPUT_ENABLED) && \
+ defined(LIBXML_READER_ENABLED) && \
+ defined(LIBXML_XINCLUDE_ENABLED)
+ #define HAVE_XML_FUZZER
+#endif
+#if defined(LIBXML_XPATH_ENABLED)
+ #define HAVE_XPATH_FUZZER
+#endif
+
+int
+LLVMFuzzerInitialize(int *argc, char ***argv);
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size);
+
+void
+xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
+ ...);
+
+void
+xmlFuzzDataInit(const char *data, size_t size);
+
+void
+xmlFuzzDataCleanup(void);
+
+int
+xmlFuzzReadInt(void);
+
+const char *
+xmlFuzzReadRemaining(size_t *size);
+
+void
+xmlFuzzWriteString(FILE *out, const char *str);
+
+const char *
+xmlFuzzReadString(size_t *size);
+
+void
+xmlFuzzReadEntities(void);
+
+const char *
+xmlFuzzMainUrl(void);
+
+const char *
+xmlFuzzMainEntity(size_t *size);
+
+xmlParserInputPtr
+xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
+
+size_t
+xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
+ size_t numStrings);
+
+char *
+xmlSlurpFile(const char *path, size_t *size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_FUZZERCOMMON_H__ */
+
--- /dev/null
+/*
+ * xmlSeed.c: Generate the XML seed corpus for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <glob.h>
+#include <libgen.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+#include <direct.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/HTMLparser.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlschemas.h>
+#include "fuzz.h"
+
+#define PATH_SIZE 500
+#define SEED_BUF_SIZE 16384
+#define EXPR_SIZE 4500
+
+typedef int
+(*fileFunc)(const char *base, FILE *out);
+
+typedef int
+(*mainFunc)(const char *arg);
+
+static struct {
+ FILE *out;
+ xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
+ xmlExternalEntityLoader oldLoader;
+ fileFunc processFile;
+ const char *fuzzer;
+ int counter;
+ char cwd[PATH_SIZE];
+} globalData;
+
+/*
+ * A custom entity loader that writes all external DTDs or entities to a
+ * single file in the format expected by xmlFuzzEntityLoader.
+ */
+static xmlParserInputPtr
+fuzzEntityRecorder(const char *URL, const char *ID,
+ xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr in;
+ static const int chunkSize = 16384;
+ int len;
+
+ in = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
+ if (in == NULL)
+ return(NULL);
+
+ if (globalData.entities == NULL) {
+ globalData.entities = xmlHashCreate(4);
+ } else if (xmlHashLookup(globalData.entities,
+ (const xmlChar *) URL) != NULL) {
+ return(in);
+ }
+
+ do {
+ len = xmlParserInputBufferGrow(in->buf, chunkSize);
+ if (len < 0) {
+ fprintf(stderr, "Error reading %s\n", URL);
+ xmlFreeInputStream(in);
+ return(NULL);
+ }
+ } while (len > 0);
+
+ xmlFuzzWriteString(globalData.out, URL);
+ xmlFuzzWriteString(globalData.out,
+ (char *) xmlBufContent(in->buf->buffer));
+
+ xmlFreeInputStream(in);
+
+ xmlHashAddEntry(globalData.entities, (const xmlChar *) URL, NULL);
+
+ return(xmlNoNetExternalEntityLoader(URL, ID, ctxt));
+}
+
+static void
+fuzzRecorderInit(FILE *out) {
+ globalData.out = out;
+ globalData.entities = xmlHashCreate(8);
+ globalData.oldLoader = xmlGetExternalEntityLoader();
+ xmlSetExternalEntityLoader(fuzzEntityRecorder);
+}
+
+static void
+fuzzRecorderCleanup() {
+ xmlSetExternalEntityLoader(globalData.oldLoader);
+ xmlHashFree(globalData.entities, xmlHashDefaultDeallocator);
+ globalData.out = NULL;
+ globalData.entities = NULL;
+ globalData.oldLoader = NULL;
+}
+
+#ifdef HAVE_XML_FUZZER
+static int
+processXml(const char *docFile, FILE *out) {
+ int opts = XML_PARSE_NOENT | XML_PARSE_DTDLOAD;
+ xmlDocPtr doc;
+
+ fwrite(&opts, sizeof(opts), 1, out);
+
+ fuzzRecorderInit(out);
+
+ doc = xmlReadFile(docFile, NULL, opts);
+ xmlXIncludeProcessFlags(doc, opts);
+ xmlFreeDoc(doc);
+
+ fuzzRecorderCleanup();
+
+ return(0);
+}
+#endif
+
+#ifdef HAVE_HTML_FUZZER
+static int
+processHtml(const char *docFile, FILE *out) {
+ char buf[SEED_BUF_SIZE];
+ FILE *file;
+ size_t size;
+ int opts = 0;
+
+ fwrite(&opts, sizeof(opts), 1, out);
+
+ /* Copy file */
+ file = fopen(docFile, "rb");
+ if (file == NULL) {
+ fprintf(stderr, "couldn't open %s\n", docFile);
+ return(0);
+ }
+ do {
+ size = fread(buf, 1, SEED_BUF_SIZE, file);
+ if (size > 0)
+ fwrite(buf, 1, size, out);
+ } while (size == SEED_BUF_SIZE);
+ fclose(file);
+
+ return(0);
+}
+#endif
+
+#ifdef HAVE_SCHEMA_FUZZER
+static int
+processSchema(const char *docFile, FILE *out) {
+ xmlSchemaPtr schema;
+ xmlSchemaParserCtxtPtr pctxt;
+
+ fuzzRecorderInit(out);
+
+ pctxt = xmlSchemaNewParserCtxt(docFile);
+ xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
+ schema = xmlSchemaParse(pctxt);
+ xmlSchemaFreeParserCtxt(pctxt);
+ xmlSchemaFree(schema);
+
+ fuzzRecorderCleanup();
+
+ return(0);
+}
+#endif
+
+static int
+processPattern(const char *pattern) {
+ glob_t globbuf;
+ int ret = 0;
+ int res, i;
+
+ res = glob(pattern, 0, NULL, &globbuf);
+ if (res == GLOB_NOMATCH)
+ return(0);
+ if (res != 0) {
+ fprintf(stderr, "couldn't match pattern %s\n", pattern);
+ return(-1);
+ }
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ struct stat statbuf;
+ char outPath[PATH_SIZE];
+ char *dirBuf = NULL;
+ char *baseBuf = NULL;
+ const char *path, *dir, *base;
+ FILE *out = NULL;
+ int dirChanged = 0;
+ size_t size;
+
+ path = globbuf.gl_pathv[i];
+
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+ continue;
+
+ dirBuf = (char *) xmlCharStrdup(path);
+ baseBuf = (char *) xmlCharStrdup(path);
+ if ((dirBuf == NULL) || (baseBuf == NULL)) {
+ fprintf(stderr, "memory allocation failed\n");
+ ret = -1;
+ goto error;
+ }
+ dir = dirname(dirBuf);
+ base = basename(baseBuf);
+
+ size = snprintf(outPath, sizeof(outPath), "seed/%s/%s",
+ globalData.fuzzer, base);
+ if (size >= PATH_SIZE) {
+ fprintf(stderr, "creating path failed\n");
+ ret = -1;
+ goto error;
+ }
+ out = fopen(outPath, "wb");
+ if (out == NULL) {
+ fprintf(stderr, "couldn't open %s for writing\n", outPath);
+ ret = -1;
+ goto error;
+ }
+ if (chdir(dir) != 0) {
+ fprintf(stderr, "couldn't chdir to %s\n", dir);
+ ret = -1;
+ goto error;
+ }
+ dirChanged = 1;
+ if (globalData.processFile(base, out) != 0)
+ ret = -1;
+
+error:
+ if (out != NULL)
+ fclose(out);
+ xmlFree(dirBuf);
+ xmlFree(baseBuf);
+ if ((dirChanged) && (chdir(globalData.cwd) != 0)) {
+ fprintf(stderr, "couldn't chdir to %s\n", globalData.cwd);
+ ret = -1;
+ break;
+ }
+ }
+
+ globfree(&globbuf);
+ return(ret);
+}
+
+#ifdef HAVE_XPATH_FUZZER
+static int
+processXPath(const char *testDir, const char *prefix, const char *name,
+ const char *data, const char *subdir, int xptr) {
+ char pattern[PATH_SIZE];
+ glob_t globbuf;
+ size_t i, size;
+ int ret = 0, res;
+
+ size = snprintf(pattern, sizeof(pattern), "%s/%s/%s*",
+ testDir, subdir, prefix);
+ if (size >= PATH_SIZE)
+ return(-1);
+ res = glob(pattern, 0, NULL, &globbuf);
+ if (res == GLOB_NOMATCH)
+ return(0);
+ if (res != 0) {
+ fprintf(stderr, "couldn't match pattern %s\n", pattern);
+ return(-1);
+ }
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ char *path = globbuf.gl_pathv[i];
+ struct stat statbuf;
+ FILE *in;
+ char expr[EXPR_SIZE];
+
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+ continue;
+
+ in = fopen(path, "rb");
+ if (in == NULL) {
+ ret = -1;
+ continue;
+ }
+
+ while (fgets(expr, EXPR_SIZE, in) > 0) {
+ char outPath[PATH_SIZE];
+ FILE *out;
+ int j;
+
+ for (j = 0; expr[j] != 0; j++)
+ if (expr[j] == '\r' || expr[j] == '\n')
+ break;
+ expr[j] = 0;
+
+ size = snprintf(outPath, sizeof(outPath), "seed/xpath/%s-%d",
+ name, globalData.counter);
+ if (size >= PATH_SIZE) {
+ ret = -1;
+ continue;
+ }
+ out = fopen(outPath, "wb");
+ if (out == NULL) {
+ ret = -1;
+ continue;
+ }
+
+ if (xptr) {
+ xmlFuzzWriteString(out, expr);
+ } else {
+ char xptrExpr[EXPR_SIZE+100];
+
+ /* Wrap XPath expressions as XPointer */
+ snprintf(xptrExpr, sizeof(xptrExpr), "xpointer(%s)", expr);
+ xmlFuzzWriteString(out, xptrExpr);
+ }
+
+ xmlFuzzWriteString(out, data);
+
+ fclose(out);
+ globalData.counter++;
+ }
+
+ fclose(in);
+ }
+
+ globfree(&globbuf);
+
+ return(ret);
+}
+
+int
+processXPathDir(const char *testDir) {
+ char pattern[PATH_SIZE];
+ glob_t globbuf;
+ size_t i, size;
+ int ret = 0;
+
+ globalData.counter = 1;
+ if (processXPath(testDir, "", "expr", "<d></d>", "expr", 0) != 0)
+ ret = -1;
+
+ size = snprintf(pattern, sizeof(pattern), "%s/docs/*", testDir);
+ if (size >= PATH_SIZE)
+ return(1);
+ if (glob(pattern, 0, NULL, &globbuf) != 0)
+ return(1);
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ char *path = globbuf.gl_pathv[i];
+ char *data;
+ const char *docFile;
+
+ data = xmlSlurpFile(path, NULL);
+ if (data == NULL) {
+ ret = -1;
+ continue;
+ }
+ docFile = basename(path);
+
+ globalData.counter = 1;
+ if (processXPath(testDir, docFile, docFile, data, "tests", 0) != 0)
+ ret = -1;
+ if (processXPath(testDir, docFile, docFile, data, "xptr", 1) != 0)
+ ret = -1;
+
+ xmlFree(data);
+ }
+
+ globfree(&globbuf);
+
+ return(ret);
+}
+#endif
+
+int
+main(int argc, const char **argv) {
+ mainFunc processArg = NULL;
+ const char *fuzzer;
+ int ret = 0;
+ int xpath = 0;
+ int i;
+
+ if (argc < 3) {
+ fprintf(stderr, "usage: seed [FUZZER] [PATTERN...]\n");
+ return(1);
+ }
+
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+ fuzzer = argv[1];
+ if (strcmp(fuzzer, "html") == 0) {
+#ifdef HAVE_HTML_FUZZER
+ processArg = processPattern;
+ globalData.processFile = processHtml;
+#endif
+ } else if (strcmp(fuzzer, "schema") == 0) {
+#ifdef HAVE_SCHEMA_FUZZER
+ processArg = processPattern;
+ globalData.processFile = processSchema;
+#endif
+ } else if (strcmp(fuzzer, "xml") == 0) {
+#ifdef HAVE_XML_FUZZER
+ processArg = processPattern;
+ globalData.processFile = processXml;
+#endif
+ } else if (strcmp(fuzzer, "xpath") == 0) {
+#ifdef HAVE_XPATH_FUZZER
+ processArg = processXPathDir;
+#endif
+ } else {
+ fprintf(stderr, "unknown fuzzer %s\n", fuzzer);
+ return(1);
+ }
+ globalData.fuzzer = fuzzer;
+
+ if (getcwd(globalData.cwd, PATH_SIZE) == NULL) {
+ fprintf(stderr, "couldn't get current directory\n");
+ return(1);
+ }
+
+ if (processArg != NULL)
+ for (i = 2; i < argc; i++)
+ processArg(argv[i]);
+
+ return(ret);
+}
+
--- /dev/null
+/*
+ * html.c: a libFuzzer target to test several HTML parser interfaces.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+#include <libxml/catalog.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+ char ***argv ATTRIBUTE_UNUSED) {
+ xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+ xmlInitializeCatalog();
+#endif
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+ return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ static const size_t maxChunkSize = 128;
+ htmlDocPtr doc;
+ htmlParserCtxtPtr ctxt;
+ xmlOutputBufferPtr out;
+ const char *docBuffer;
+ size_t docSize, consumed, chunkSize;
+ int opts, outSize;
+
+ xmlFuzzDataInit(data, size);
+ opts = xmlFuzzReadInt();
+
+ docBuffer = xmlFuzzReadRemaining(&docSize);
+ if (docBuffer == NULL) {
+ xmlFuzzDataCleanup();
+ return(0);
+ }
+
+ /* Pull parser */
+
+ doc = htmlReadMemory(docBuffer, docSize, NULL, NULL, opts);
+
+ /*
+ * Also test the serializer. Call htmlDocContentDumpOutput with our
+ * own buffer to avoid encoding the output. The HTML encoding is
+ * excruciatingly slow (see htmlEntityValueLookup).
+ */
+ out = xmlAllocOutputBuffer(NULL);
+ htmlDocContentDumpOutput(out, doc, NULL);
+ xmlOutputBufferClose(out);
+
+ xmlFreeDoc(doc);
+
+ /* Push parser */
+
+ ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL,
+ XML_CHAR_ENCODING_NONE);
+ htmlCtxtUseOptions(ctxt, opts);
+
+ for (consumed = 0; consumed < docSize; consumed += chunkSize) {
+ chunkSize = docSize - consumed;
+ if (chunkSize > maxChunkSize)
+ chunkSize = maxChunkSize;
+ htmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+ }
+
+ htmlParseChunk(ctxt, NULL, 0, 1);
+ xmlFreeDoc(ctxt->myDoc);
+ htmlFreeParserCtxt(ctxt);
+
+ /* Cleanup */
+
+ xmlFuzzDataCleanup();
+ xmlResetLastError();
+
+ return(0);
+}
+
--- /dev/null
+elem_a="<a></a>"
+elem_abbr="<abbr></abbr>"
+elem_acronym="<acronym></acronym>"
+elem_address="<address></address>"
+elem_applet="<applet></applet>"
+elem_area="<area>"
+elem_b="<b></b>"
+elem_base="<base>"
+elem_basefont="<basefont>"
+elem_bdo="<bdo></bdo>"
+elem_big="<big></big>"
+elem_blockquote="<blockquote></blockquote>"
+elem_body="<body></body>"
+elem_br="<br>"
+elem_button="<button></button>"
+elem_caption="<caption></caption>"
+elem_center="<center></center>"
+elem_cite="<cite></cite>"
+elem_code="<code></code>"
+elem_col="<col>"
+elem_colgroup="<colgroup></colgroup>"
+elem_dd="<dd></dd>"
+elem_del="<del></del>"
+elem_dfn="<dfn></dfn>"
+elem_dir="<dir></dir>"
+elem_div="<div></div>"
+elem_dl="<dl></dl>"
+elem_dt="<dt></dt>"
+elem_em="<em></em>"
+elem_embed="<embed></embed>"
+elem_fieldset="<fieldset></fieldset>"
+elem_font="<font></font>"
+elem_form="<form></form>"
+elem_frame="<frame>"
+elem_frameset="<frameset></frameset>"
+elem_h1="<h1></h1>"
+elem_h2="<h2></h2>"
+elem_h3="<h3></h3>"
+elem_h4="<h4></h4>"
+elem_h5="<h5></h5>"
+elem_h6="<h6></h6>"
+elem_head="<head></head>"
+elem_hr="<hr>"
+elem_html="<html></html>"
+elem_i="<i></i>"
+elem_iframe="<iframe></iframe>"
+elem_img="<img>"
+elem_input="<input>"
+elem_ins="<ins></ins>"
+elem_isindex="<isindex>"
+elem_kbd="<kbd></kbd>"
+elem_label="<label></label>"
+elem_legend="<legend></legend>"
+elem_li="<li></li>"
+elem_link="<link>"
+elem_map="<map></map>"
+elem_menu="<menu></menu>"
+elem_meta="<meta>"
+elem_noframes="<noframes></noframes>"
+elem_noscript="<noscript></noscript>"
+elem_object="<object></object>"
+elem_ol="<ol></ol>"
+elem_optgroup="<optgroup></optgroup>"
+elem_option="<option></option>"
+elem_p="<p></p>"
+elem_param="<param>"
+elem_pre="<pre></pre>"
+elem_q="<q></q>"
+elem_s="<s></s>"
+elem_samp="<samp></samp>"
+elem_script="<script></script>"
+elem_select="<select></select>"
+elem_small="<small></small>"
+elem_span="<span></span>"
+elem_strike="<strike></strike>"
+elem_strong="<strong></strong>"
+elem_style="<style></style>"
+elem_sub="<sub></sub>"
+elem_sup="<sup></sup>"
+elem_table="<table></table>"
+elem_tbody="<tbody></tbody>"
+elem_td="<td></td>"
+elem_textarea="<textarea></textarea>"
+elem_tfoot="<tfoot></tfoot>"
+elem_th="<th></th>"
+elem_thead="<thead></thead>"
+elem_title="<title></title>"
+elem_tr="<tr></tr>"
+elem_tt="<tt></tt>"
+elem_u="<u></u>"
+elem_ul="<ul></ul>"
+elem_var="<var></var>"
+
+attr_id=" id=\"\""
+attr_style=" style=\"\""
+
+comment="<!-- -->"
+
+doctype="<!DOCTYPE d>"
+doctype_system="<!DOCTYPE s SYSTEM \"u\">"
+doctype_public="<!DOCTYPE p PUBLIC \"i\" \"u\">"
+
+pi="<?a?>"
+
+ref_lt="<"
+ref_gt=">"
+ref_amp="&"
+ref_apos="'"
+ref_quot="""
+ref_dec="	"
+ref_hex="
"
+
+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"
--- /dev/null
+[libfuzzer]
+timeout = 10
--- /dev/null
+/*
+ * regexp.c: a libFuzzer target to test the regexp module.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/xmlregexp.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+ char ***argv ATTRIBUTE_UNUSED) {
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+ return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ xmlRegexpPtr regexp;
+ char *str[2] = { NULL, NULL };
+ size_t numStrings;
+
+ if (size > 200)
+ return(0);
+
+ numStrings = xmlFuzzExtractStrings(data, size, str, 2);
+
+ /* CUR_SCHAR doesn't handle invalid UTF-8 and may cause infinite loops. */
+ if (xmlCheckUTF8(BAD_CAST str[0]) != 0) {
+ regexp = xmlRegexpCompile(BAD_CAST str[0]);
+ /* xmlRegexpExec has pathological performance in too many cases. */
+#if 0
+ if ((regexp != NULL) && (numStrings >= 2)) {
+ xmlRegexpExec(regexp, BAD_CAST str[1]);
+ }
+#endif
+ xmlRegFreeRegexp(regexp);
+ }
+
+ xmlFree(str[0]);
+ xmlFree(str[1]);
+ xmlResetLastError();
+
+ return 0;
+}
+
--- /dev/null
+quant_any="*"
+quant_opt="?"
+quant_some="+"
+quant_num="{1,2}"
+
+dot="."
+branch="|a"
+parens="()"
+parens_inner=")("
+pos_group="[a]"
+neg_group="[^a]"
+class_subtraction="[a-[b]]"
+
+esc_space="\\s"
+esc_initial="\\i"
+esc_name="\\c"
+esc_digit="\\d"
+esc_word="\\w"
+
+cat_letter="\\p{L}"
+cat_mark="\\p{M}"
+cat_number="\\p{N}"
+cat_punct="\\p{P}"
+cat_sym="\\p{S}"
+cat_sep="\\p{Z}"
+cat_other="\\p{C}"
+
+block_aegean_numbers="\\p{IsAegeanNumbers}"
+block_alphabetic_presentation_forms="\\p{IsAlphabeticPresentationForms}"
+block_arabic="\\p{IsArabic}"
+block_arabic_presentation_forms_a="\\p{IsArabicPresentationFormsA}"
+block_arabic_presentation_forms_b="\\p{IsArabicPresentationFormsB}"
+block_armenian="\\p{IsArmenian}"
+block_arrows="\\p{IsArrows}"
+block_basic_latin="\\p{IsBasicLatin}"
+block_bengali="\\p{IsBengali}"
+block_block_elements="\\p{IsBlockElements}"
+block_bopomofo="\\p{IsBopomofo}"
+block_bopomofo_extended="\\p{IsBopomofoExtended}"
+block_box_drawing="\\p{IsBoxDrawing}"
+block_braille_patterns="\\p{IsBraillePatterns}"
+block_buhid="\\p{IsBuhid}"
+block_byzantine_musical_symbols="\\p{IsByzantineMusicalSymbols}"
+block_c_j_k_compatibility="\\p{IsCJKCompatibility}"
+block_c_j_k_compatibility_forms="\\p{IsCJKCompatibilityForms}"
+block_c_j_k_compatibility_ideographs="\\p{IsCJKCompatibilityIdeographs}"
+block_c_j_k_compatibility_ideographs_supplement="\\p{IsCJKCompatibilityIdeographsSupplement}"
+block_c_j_k_radicals_supplement="\\p{IsCJKRadicalsSupplement}"
+block_c_j_k_symbolsand_punctuation="\\p{IsCJKSymbolsandPunctuation}"
+block_c_j_k_unified_ideographs="\\p{IsCJKUnifiedIdeographs}"
+block_c_j_k_unified_ideographs_extension_a="\\p{IsCJKUnifiedIdeographsExtensionA}"
+block_cjk_unified_ideographs_extension_b="\\p{IsCJKUnifiedIdeographsExtensionB}"
+block_cherokee="\\p{IsCherokee}"
+block_combining_diacritical_marks="\\p{IsCombiningDiacriticalMarks}"
+block_combining_diacritical_marksfor_symbols="\\p{IsCombiningDiacriticalMarksforSymbols}"
+block_combining_half_marks="\\p{IsCombiningHalfMarks}"
+block_combining_marksfor_symbols="\\p{IsCombiningMarksforSymbols}"
+block_control_pictures="\\p{IsControlPictures}"
+block_currency_symbols="\\p{IsCurrencySymbols}"
+block_cypriot_syllabary="\\p{IsCypriotSyllabary}"
+block_cyrillic="\\p{IsCyrillic}"
+block_cyrillic_supplement="\\p{IsCyrillicSupplement}"
+block_deseret="\\p{IsDeseret}"
+block_devanagari="\\p{IsDevanagari}"
+block_dingbats="\\p{IsDingbats}"
+block_enclosed_alphanumerics="\\p{IsEnclosedAlphanumerics}"
+block_enclosed_cjk_lettersand_months="\\p{IsEnclosedCJKLettersandMonths}"
+block_ethiopic="\\p{IsEthiopic}"
+block_general_punctuation="\\p{IsGeneralPunctuation}"
+block_geometric_shapes="\\p{IsGeometricShapes}"
+block_georgian="\\p{IsGeorgian}"
+block_gothic="\\p{IsGothic}"
+block_greek="\\p{IsGreek}"
+block_greek_extended="\\p{IsGreekExtended}"
+block_greekand_coptic="\\p{IsGreekandCoptic}"
+block_gujarati="\\p{IsGujarati}"
+block_gurmukhi="\\p{IsGurmukhi}"
+block_halfwidthand_fullwidth_forms="\\p{IsHalfwidthandFullwidthForms}"
+block_hangul_compatibility_jamo="\\p{IsHangulCompatibilityJamo}"
+block_hangul_jamo="\\p{IsHangulJamo}"
+block_hangul_syllables="\\p{IsHangulSyllables}"
+block_hanunoo="\\p{IsHanunoo}"
+block_hebrew="\\p{IsHebrew}"
+block_high_private_use_surrogates="\\p{IsHighPrivateUseSurrogates}"
+block_high_surrogates="\\p{IsHighSurrogates}"
+block_hiragana="\\p{IsHiragana}"
+block_ipa_extensions="\\p{IsIPAExtensions}"
+block_ideographic_description_characters="\\p{IsIdeographicDescriptionCharacters}"
+block_kanbun="\\p{IsKanbun}"
+block_kangxi_radicals="\\p{IsKangxiRadicals}"
+block_kannada="\\p{IsKannada}"
+block_katakana="\\p{IsKatakana}"
+block_katakana_phonetic_extensions="\\p{IsKatakanaPhoneticExtensions}"
+block_khmer="\\p{IsKhmer}"
+block_khmer_symbols="\\p{IsKhmerSymbols}"
+block_lao="\\p{IsLao}"
+block_latin1Supplement="\\p{IsLatin1Supplement}"
+block_latin_extended_a="\\p{IsLatinExtendedA}"
+block_latin_extended_b="\\p{IsLatinExtendedB}"
+block_latin_extended_additional="\\p{IsLatinExtendedAdditional}"
+block_letterlike_symbols="\\p{IsLetterlikeSymbols}"
+block_limbu="\\p{IsLimbu}"
+block_linear_b_ideograms="\\p{IsLinearBIdeograms}"
+block_linear_b_syllabary="\\p{IsLinearBSyllabary}"
+block_low_surrogates="\\p{IsLowSurrogates}"
+block_malayalam="\\p{IsMalayalam}"
+block_mathematical_alphanumeric_symbols="\\p{IsMathematicalAlphanumericSymbols}"
+block_mathematical_operators="\\p{IsMathematicalOperators}"
+block_miscellaneous_mathematical_symbols_a="\\p{IsMiscellaneousMathematicalSymbolsA}"
+block_miscellaneous_mathematical_symbols_b="\\p{IsMiscellaneousMathematicalSymbolsB}"
+block_miscellaneous_symbols="\\p{IsMiscellaneousSymbols}"
+block_miscellaneous_symbolsand_arrows="\\p{IsMiscellaneousSymbolsandArrows}"
+block_miscellaneous_technical="\\p{IsMiscellaneousTechnical}"
+block_mongolian="\\p{IsMongolian}"
+block_musical_symbols="\\p{IsMusicalSymbols}"
+block_myanmar="\\p{IsMyanmar}"
+block_number_forms="\\p{IsNumberForms}"
+block_ogham="\\p{IsOgham}"
+block_old_italic="\\p{IsOldItalic}"
+block_optical_character_recognition="\\p{IsOpticalCharacterRecognition}"
+block_oriya="\\p{IsOriya}"
+block_osmanya="\\p{IsOsmanya}"
+block_phonetic_extensions="\\p{IsPhoneticExtensions}"
+block_private_use="\\p{IsPrivateUse}"
+block_private_use_area="\\p{IsPrivateUseArea}"
+block_runic="\\p{IsRunic}"
+block_shavian="\\p{IsShavian}"
+block_sinhala="\\p{IsSinhala}"
+block_small_form_variants="\\p{IsSmallFormVariants}"
+block_spacing_modifier_letters="\\p{IsSpacingModifierLetters}"
+block_specials="\\p{IsSpecials}"
+block_superscriptsand_subscripts="\\p{IsSuperscriptsandSubscripts}"
+block_supplemental_arrows_a="\\p{IsSupplementalArrowsA}"
+block_supplemental_arrows_b="\\p{IsSupplementalArrowsB}"
+block_supplemental_mathematical_operators="\\p{IsSupplementalMathematicalOperators}"
+block_supplementary_private_use_area_a="\\p{IsSupplementaryPrivateUseAreaA}"
+block_supplementary_private_use_area_b="\\p{IsSupplementaryPrivateUseAreaB}"
+block_syriac="\\p{IsSyriac}"
+block_tagalog="\\p{IsTagalog}"
+block_tagbanwa="\\p{IsTagbanwa}"
+block_tags="\\p{IsTags}"
+block_tai_le="\\p{IsTaiLe}"
+block_tai_xuan_jing_symbols="\\p{IsTaiXuanJingSymbols}"
+block_tamil="\\p{IsTamil}"
+block_telugu="\\p{IsTelugu}"
+block_thaana="\\p{IsThaana}"
+block_thai="\\p{IsThai}"
+block_tibetan="\\p{IsTibetan}"
+block_ugaritic="\\p{IsUgaritic}"
+block_unified_canadian_aboriginal_syllabics="\\p{IsUnifiedCanadianAboriginalSyllabics}"
+block_variation_selectors="\\p{IsVariationSelectors}"
+block_variation_selectors_supplement="\\p{IsVariationSelectorsSupplement}"
+block_yi_radicals="\\p{IsYiRadicals}"
+block_yi_syllables="\\p{IsYiSyllables}"
+block_yijing_hexagram_symbols="\\p{IsYijingHexagramSymbols}"
--- /dev/null
+[libfuzzer]
+timeout = 5
--- /dev/null
+/*
+ * schema.c: a libFuzzer target to test the XML Schema processor.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/catalog.h>
+#include <libxml/xmlschemas.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+ char ***argv ATTRIBUTE_UNUSED) {
+ xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+ xmlInitializeCatalog();
+#endif
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+ xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+ return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ xmlSchemaParserCtxtPtr pctxt;
+
+ if (size > 50000)
+ return(0);
+
+ xmlFuzzDataInit(data, size);
+ xmlFuzzReadEntities();
+
+ pctxt = xmlSchemaNewParserCtxt(xmlFuzzMainUrl());
+ xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
+ xmlSchemaFree(xmlSchemaParse(pctxt));
+ xmlSchemaFreeParserCtxt(pctxt);
+
+ xmlFuzzDataCleanup();
+ xmlResetLastError();
+
+ return(0);
+}
+
--- /dev/null
+# TODO: Add more language elements
+
+xs_annotation="<xs:annotation></xs:annotation>"
+
+xs_attribute="<xs:attribute name='a'></xs:attribute>"
+xs_attribute_required="<xs:attribute name='a' use='required'></xs:attribute>"
+xs_element="<xs:element name='e'></xs:element>"
+
+# Primitive datatypes
+type_string=" type='xs:string'"
+type_boolean=" type='xs:boolean'"
+type_decimal=" type='xs:decimal'"
+type_float=" type='xs:float'"
+type_double=" type='xs:double'"
+type_date_time=" type='xs:dateTime'"
+type_time=" type='xs:time'"
+type_date=" type='xs:date'"
+type_g_year_month=" type='xs:gYearMonth'"
+type_g_year=" type='xs:gYear'"
+type_g_month_day=" type='xs:gMonthDay'"
+type_g_day=" type='xs:gDay'"
+type_g_month=" type='xs:gMonth'"
+type_hex_binary=" type='xs:hexBinary'"
+type_base64_binary=" type='xs:base64Binary'"
+type_any_uri=" type='xs:anyURI'"
+type_qname=" type='xs:QName'"
+type_notation=" type='xs:NOTATION'"
+
+# Occurs
+occurs_min=" minOccurs='1'"
+occurs_max=" maxOccurs='9'"
+occurs_max_unbounded=" maxOccurs='unbounded'"
+
+# Simple type
+xs_restriction_integer="<xs:simpleType><xs:restriction base='xs:integer'></xs:restriction></xs:simpleType>"
+xs_restriction_string="<xs:simpleType><xs:restriction base='xs:string'></xs:restriction></xs:simpleType>"
+xs_list="<xs:simpleType><xs:list></xs:list></xs:simpleType>"
+xs_union="<xs:simpleType><xs:union></xs:union></xs:simpleType>"
+
+# Restrictions
+xs_min_exclusive="<xs:minExclusive value='0'/>"
+xs_min_inclusive="<xs:minInclusive value='0'/>"
+xs_max_exclusive="<xs:maxExclusive value='9'/>"
+xs_max_inclusive="<xs:maxInclusive value='9'/>"
+xs_total_digits="<xs:totalDigits value='3'/>"
+xs_fraction_digits="<xs:fractionDigits value='3'/>"
+xs_length="<xs:length value='3'/>"
+xs_min_length="<xs:minLength value='3'/>"
+xs_max_length="<xs:maxLength value='3'/>"
+xs_enumeration="<xs:enumeration value='a'/>"
+xs_white_space_collapse="<xs:whiteSpace value='collapse'/>"
+xs_white_space_preserve="<xs:whiteSpace value='preserve'/>"
+xs_white_space_replace="<xs:whiteSpace value='replace'/>"
+xs_pattern="<xs:pattern value='a'/>"
+
--- /dev/null
+[libfuzzer]
+timeout = 20
--- /dev/null
+.
\ No newline at end of file
--- /dev/null
+/*
+ * testFuzzer.c: Test program for the custom entity loader used to fuzz
+ * with multiple inputs.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <string.h>
+#include <glob.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlstring.h>
+#include "fuzz.h"
+
+#ifdef HAVE_HTML_FUZZER
+ #define LLVMFuzzerInitialize fuzzHtmlInit
+ #define LLVMFuzzerTestOneInput fuzzHtml
+ #include "html.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_REGEXP_FUZZER
+ #define LLVMFuzzerInitialize fuzzRegexpInit
+ #define LLVMFuzzerTestOneInput fuzzRegexp
+ #include "regexp.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_SCHEMA_FUZZER
+ #define LLVMFuzzerInitialize fuzzSchemaInit
+ #define LLVMFuzzerTestOneInput fuzzSchema
+ #include "schema.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_URI_FUZZER
+ #define LLVMFuzzerInitialize fuzzUriInit
+ #define LLVMFuzzerTestOneInput fuzzUri
+ #include "uri.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_XML_FUZZER
+ #define LLVMFuzzerInitialize fuzzXmlInit
+ #define LLVMFuzzerTestOneInput fuzzXml
+ #include "xml.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_XPATH_FUZZER
+ #define LLVMFuzzerInitialize fuzzXPathInit
+ #define LLVMFuzzerTestOneInput fuzzXPath
+ #include "xpath.c"
+ #undef LLVMFuzzerInitialize
+ #undef LLVMFuzzerTestOneInput
+#endif
+
+typedef int
+(*initFunc)(int *argc, char ***argv);
+typedef int
+(*fuzzFunc)(const char *data, size_t size);
+
+int numInputs;
+
+static int
+testFuzzer(initFunc init, fuzzFunc fuzz, const char *pattern) {
+ glob_t globbuf;
+ int ret = -1;
+ int i;
+
+ if (glob(pattern, 0, NULL, &globbuf) != 0) {
+ fprintf(stderr, "pattern %s matches no files\n", pattern);
+ return(-1);
+ }
+
+ if (init != NULL)
+ init(NULL, NULL);
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ const char *path = globbuf.gl_pathv[i];
+ char *data;
+ size_t size;
+
+ data = xmlSlurpFile(path, &size);
+ if (data == NULL) {
+ fprintf(stderr, "couldn't read %s\n", path);
+ goto error;
+ }
+ fuzz(data, size);
+ xmlFree(data);
+
+ numInputs++;
+ }
+
+ ret = 0;
+error:
+ globfree(&globbuf);
+ return(ret);
+}
+
+#ifdef HAVE_XML_FUZZER
+static int
+testEntityLoader() {
+ static const char data[] =
+ "doc.xml\\\n"
+ "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
+ "<doc>&ent;</doc>\\\n"
+ "doc.dtd\\\n"
+ "<!ELEMENT doc (#PCDATA)>\n"
+ "<!ENTITY ent SYSTEM \"ent.txt\">\\\n"
+ "ent.txt\\\n"
+ "Hello, world!\\\n";
+ static xmlChar expected[] =
+ "<?xml version=\"1.0\"?>\n"
+ "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
+ "<doc>Hello, world!</doc>\n";
+ const char *docBuffer;
+ size_t docSize;
+ xmlDocPtr doc;
+ xmlChar *out;
+ int ret = 0;
+
+ xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+ xmlFuzzDataInit(data, sizeof(data) - 1);
+ xmlFuzzReadEntities();
+ docBuffer = xmlFuzzMainEntity(&docSize);
+ doc = xmlReadMemory(docBuffer, docSize, NULL, NULL,
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+
+ xmlDocDumpMemory(doc, &out, NULL);
+ if (xmlStrcmp(out, expected) != 0) {
+ fprintf(stderr, "Expected:\n%sGot:\n%s", expected, out);
+ ret = 1;
+ }
+
+ xmlFree(out);
+ xmlFreeDoc(doc);
+ xmlFuzzDataCleanup();
+
+ return(ret);
+}
+#endif
+
+int
+main() {
+ int ret = 0;
+
+#ifdef HAVE_XML_FUZZER
+ if (testEntityLoader() != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_HTML_FUZZER
+ if (testFuzzer(fuzzHtmlInit, fuzzHtml, "seed/html/*") != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_REGEXP_FUZZER
+ if (testFuzzer(fuzzRegexpInit, fuzzRegexp, "seed/regexp/*") != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_SCHEMA_FUZZER
+ if (testFuzzer(fuzzSchemaInit, fuzzSchema, "seed/schema/*") != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_URI_FUZZER
+ if (testFuzzer(NULL, fuzzUri, "seed/uri/*") != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_XML_FUZZER
+ if (testFuzzer(fuzzXmlInit, fuzzXml, "seed/xml/*") != 0)
+ ret = 1;
+#endif
+#ifdef HAVE_XPATH_FUZZER
+ if (testFuzzer(fuzzXPathInit, fuzzXPath, "seed/xpath/*") != 0)
+ ret = 1;
+#endif
+
+ if (ret == 0)
+ printf("Successfully tested %d inputs\n", numInputs);
+
+ return(ret);
+}
+
--- /dev/null
+/*
+ * uri.c: a libFuzzer target to test the URI module.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/uri.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ xmlURIPtr uri;
+ char *str[2] = { NULL, NULL };
+ size_t numStrings;
+
+ if (size > 10000)
+ return(0);
+
+ numStrings = xmlFuzzExtractStrings(data, size, str, 2);
+
+ uri = xmlParseURI(str[0]);
+ xmlFree(xmlSaveUri(uri));
+ xmlFreeURI(uri);
+
+ uri = xmlParseURIRaw(str[0], 1);
+ xmlFree(xmlSaveUri(uri));
+ xmlFreeURI(uri);
+
+ xmlFree(xmlURIUnescapeString(str[0], -1, NULL));
+ xmlFree(xmlURIEscape(BAD_CAST str[0]));
+ xmlFree(xmlCanonicPath(BAD_CAST str[0]));
+ xmlFree(xmlPathToURI(BAD_CAST str[0]));
+
+ if (numStrings >= 2) {
+ xmlFree(xmlBuildURI(BAD_CAST str[1], BAD_CAST str[0]));
+ xmlFree(xmlBuildRelativeURI(BAD_CAST str[1], BAD_CAST str[0]));
+ xmlFree(xmlURIEscapeStr(BAD_CAST str[0], BAD_CAST str[1]));
+ }
+
+ /* Modifies string, so must come last. */
+ xmlNormalizeURIPath(str[0]);
+
+ xmlFree(str[0]);
+ xmlFree(str[1]);
+
+ return 0;
+}
+
--- /dev/null
+[libfuzzer]
+timeout = 2
--- /dev/null
+/*
+ * xml.c: a libFuzzer target to test several XML parser interfaces.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/catalog.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlerror.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlreader.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+ char ***argv ATTRIBUTE_UNUSED) {
+ xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+ xmlInitializeCatalog();
+#endif
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+ xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+ return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ static const size_t maxChunkSize = 128;
+ xmlDocPtr doc;
+ xmlParserCtxtPtr ctxt;
+ xmlTextReaderPtr reader;
+ xmlChar *out;
+ const char *docBuffer, *docUrl;
+ size_t maxSize, docSize, consumed, chunkSize;
+ int opts, outSize;
+
+ xmlFuzzDataInit(data, size);
+ opts = xmlFuzzReadInt();
+
+ /* Lower maximum size when processing entities for now. */
+ maxSize = opts & XML_PARSE_NOENT ? 50000 : 500000;
+ if (size > maxSize)
+ goto exit;
+
+ xmlFuzzReadEntities();
+ docBuffer = xmlFuzzMainEntity(&docSize);
+ docUrl = xmlFuzzMainUrl();
+ if (docBuffer == NULL)
+ goto exit;
+
+ /* Pull parser */
+
+ doc = xmlReadMemory(docBuffer, docSize, docUrl, NULL, opts);
+ if (opts & XML_PARSE_XINCLUDE)
+ xmlXIncludeProcessFlags(doc, opts);
+ /* Also test the serializer. */
+ xmlDocDumpMemory(doc, &out, &outSize);
+ xmlFree(out);
+ xmlFreeDoc(doc);
+
+ /* Push parser */
+
+ ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
+ if (ctxt == NULL)
+ goto exit;
+ xmlCtxtUseOptions(ctxt, opts);
+
+ for (consumed = 0; consumed < docSize; consumed += chunkSize) {
+ chunkSize = docSize - consumed;
+ if (chunkSize > maxChunkSize)
+ chunkSize = maxChunkSize;
+ xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+ }
+
+ xmlParseChunk(ctxt, NULL, 0, 1);
+ if (opts & XML_PARSE_XINCLUDE)
+ xmlXIncludeProcessFlags(ctxt->myDoc, opts);
+ xmlFreeDoc(ctxt->myDoc);
+ xmlFreeParserCtxt(ctxt);
+
+ /* Reader */
+
+ reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
+ if (reader == NULL)
+ goto exit;
+ while (xmlTextReaderRead(reader) == 1) {
+ if (xmlTextReaderNodeType(reader) == XML_ELEMENT_NODE) {
+ int i, n = xmlTextReaderAttributeCount(reader);
+ for (i=0; i<n; i++) {
+ xmlTextReaderMoveToAttributeNo(reader, i);
+ while (xmlTextReaderReadAttributeValue(reader) == 1);
+ }
+ }
+ }
+ xmlFreeTextReader(reader);
+
+exit:
+ xmlFuzzDataCleanup();
+ xmlResetLastError();
+ return(0);
+}
+
--- /dev/null
+xml_decl="<?xml version='1.0'?>"
+xml_decl_latin1="<?xml version='1.0' encoding='ISO-8859-1'?>"
+
+elem_start_end="<a></a>"
+elem_empty="<a/>"
+elem_ns_start_end="<a:a xmlns:a='a'></a:a>"
+elem_ns_empty="<a:a xmlns:a='a'/>"
+
+attr=" a='a'"
+
+ns_decl=" xmlns:a='a'"
+ns_default=" xmlns='a'"
+ns_prefix="a:"
+
+cdata_section="<![CDATA[ ]]>"
+
+comment="<!-- -->"
+
+pi="<?a?>"
+
+elem_decl_any="<!ELEMENT a ANY>"
+elem_decl_empty="<!ELEMENT a EMPTY>"
+elem_decl_children="<!ELEMENT a (a)>"
+elem_decl_mixed="<!ELEMENT a (#PCDATA|a)>"
+elem_children_choice="|a"
+elem_children_seq=",a"
+elem_children_sub_choice="|(a)"
+elem_children_sub_seq=",(a)"
+elem_quant_any="*"
+elem_quant_opt="?"
+elem_quant_some="+"
+
+attlist_decl_cdata_req="<!ATTLIST a a CDATA #REQUIRED>"
+attlist_decl_cdata_imp="<!ATTLIST a a CDATA #IMPLIED>"
+attlist_decl_cdata_def="<!ATTLIST a a CDATA 'a'>"
+attlist_decl_cdata_fix="<!ATTLIST a a CDATA #FIXED 'a'>"
+attlist_decl_id="<!ATTLIST a a ID #IMPLIED>"
+attlist_decl_idref="<!ATTLIST a a IDREF #IMPLIED>"
+attlist_decl_idrefs="<!ATTLIST a a IDREFS #IMPLIED>"
+attlist_decl_entity="<!ATTLIST a a ENTITY #IMPLIED>"
+attlist_decl_entities="<!ATTLIST a a ENTITIES #IMPLIED>"
+attlist_decl_nmtoken="<!ATTLIST a a NMTOKEN #IMPLIED>"
+attlist_decl_nmtokens="<!ATTLIST a a NMTOKENS #IMPLIED>"
+attlist_decl_enum="<!ATTLIST a a (a) #IMPLIED>"
+attlist_decl_notation="<!ATTLIST a a NOTATION (a) #IMPLIED>"
+
+include_sect="<![INCLUDE[ ]]>"
+ignore_sect="<![IGNORE[ ]]>"
+
+ge_decl="<!ENTITY a 'a'>"
+ge_decl_system="<!ENTITY a SYSTEM 'a'>"
+ge_decl_system_ndata="<!ENTITY a SYSTEM 'a' NDATA a>"
+ge_decl_public="<!ENTITY a PUBLIC 'a' 'a'>"
+ge_decl_public_ndata="<!ENTITY a PUBLIC 'a' 'a' NDATA a>"
+
+pe_decl="<!ENTITY % a 'a'>"
+pe_decl_system="<!ENTITY % a SYSTEM 'a'>"
+pe_decl_public="<!ENTITY % a PUBLIC 'a' 'a'>"
+
+char_ref_dec="<"
+char_ref_hex="<"
+char_ref_quoted="&#60;"
+
+ge_ref_lt="<"
+ge_ref_gt=">"
+ge_ref_amp="&"
+ge_ref_apos="'"
+ge_ref_quot="""
+ge_ref="&a;"
+ge_ref_quoted="&a;"
+
+pe_ref="%a;"
+pe_ref_quoted="%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"
--- /dev/null
+[libfuzzer]
+timeout = 20
--- /dev/null
+/*
+ * xpath.c: a libFuzzer target to test XPath and XPointer expressions.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/parser.h>
+#include <libxml/xpointer.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+ char ***argv ATTRIBUTE_UNUSED) {
+ xmlInitParser();
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+ return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ xmlDocPtr doc;
+ const char *expr, *xml;
+ size_t exprSize, xmlSize;
+
+ if (size > 10000)
+ return(0);
+
+ xmlFuzzDataInit(data, size);
+
+ expr = xmlFuzzReadString(&exprSize);
+ xml = xmlFuzzReadString(&xmlSize);
+
+ /* Recovery mode allows more input to be fuzzed. */
+ doc = xmlReadMemory(xml, xmlSize, NULL, NULL, XML_PARSE_RECOVER);
+ if (doc != NULL) {
+ xmlXPathContextPtr xpctxt = xmlXPathNewContext(doc);
+
+ /* Operation limit to avoid timeout */
+ xpctxt->opLimit = 500000;
+
+ xmlXPathFreeObject(xmlXPtrEval(BAD_CAST expr, xpctxt));
+ xmlXPathFreeContext(xpctxt);
+ }
+ xmlFreeDoc(doc);
+
+ xmlFuzzDataCleanup();
+ xmlResetLastError();
+
+ return(0);
+}
+
--- /dev/null
+# XML
+
+elem_a="<a></a>"
+elem_b="<b></b>"
+elem_c="<c></c>"
+elem_d="<d></d>"
+elem_empty="<a/>"
+elem_ns_a="<a:a xmlns:a='a'></a:a>"
+elem_ns_b="<b:b xmlns:b='b'></b:b>"
+
+attr_a=" a='a'"
+attr_b=" b='b'"
+
+ns_decl=" xmlns:a='a'"
+ns_default=" xmlns='a'"
+ns_prefix_a="a:"
+ns_prefix_b="b:"
+
+cdata_section="<![CDATA[ ]]>"
+
+comment="<!-- -->"
+
+pi="<?a?>"
+
+# XPath
+
+axis_ancestor="ancestor::"
+axis_ancestor_or_self="ancestor-or-self::"
+axis_attribute="attribute::"
+axis_attribute_abbrev="@"
+axis_child="child::"
+axis_descendant="descendant::"
+axis_descendant_or_self="descendant-or-self::"
+axis_following="following::"
+axis_following_sibling="following-sibling::"
+axis_namespace="namespace::"
+axis_parent="parent::"
+axis_preceding="preceding::"
+axis_preceding_siblings="preceding-sibling::"
+axis_self="self::"
+
+node_test_ns="a:"
+
+val_num="=(1.0)"
+val_str_sq="=('a')"
+val_str_dq="=(\"a\")"
+val_node_set="=(*)"
+val_elem="=(b)"
+
+step_root="/"
+step_descendant="//"
+step_any="//*"
+step_any_l="*//"
+step_elem="//b"
+step_ns_elem="//a:a"
+step_comment="//comment()"
+step_node="//node()"
+step_node_l="node()//"
+step_pi="//processing-instruction()"
+step_text="//text()"
+step_parent="../"
+
+op_plus="+1"
+op_minus=" - 1"
+op_neg="-"
+op_mul="*1"
+op_div=" div 1"
+op_mod=" mod 1"
+op_and=" and 1"
+op_or=" or 1"
+op_ne="!=1"
+op_lt="<1"
+op_gt=">1"
+op_le="<=1"
+op_ge=">=1"
+op_predicate_num="[1]"
+op_predicate_last="[last()]"
+op_predicate_str="['a']"
+op_predicate="[1=1]"
+op_arg_num=",1"
+op_arg_str=",'a'"
+op_arg_node=",*"
+op_union="|//b"
+
+var_num="=$f"
+var_bool="=$b"
+var_str="=$s"
+var_node_set="=$n"
+
+# Unicode
+
+utf8_2="\xC3\x84"
+utf8_3="\xE2\x80\x9C"
+utf8_4="\xF0\x9F\x98\x80"
--- /dev/null
+[libfuzzer]
+timeout = 20
"xmlRegisterInputCallbacks", "xmlReaderForIO",
"xmlOutputBufferCreateIO", "xmlRegisterOutputCallbacks",
"xmlSaveToIO", "xmlIOHTTPOpenW",
-# library state cleanup, generate false leak informations and other
+# library state cleanup, generate false leak information and other
# troubles, heavillyb tested otherwise.
"xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc",
"xmlSetTreeDoc", "xmlUnlinkNode",
#
# check we know how to handle the args and return values
- # and store the informations for the generation
+ # and store the information for the generation
#
try:
args = node.xpathEval("arg")
/**
* xmlParserDebugEntities:
*
- * Global setting, asking the parser to print out debugging informations.
+ * Global setting, asking the parser to print out debugging information.
* while handling entities.
* Disabled by default
*/
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
* Author: breese@users.sourceforge.net
*/
#ifndef __XML_C14N_H__
#define __XML_C14N_H__
+
+#include <libxml/xmlversion.h>
+
#ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-
/*
* XML Canonicalization
* http://www.w3.org/TR/xml-c14n
/**
* xmlParserNodeInfo:
*
- * The parser can be asked to collect Node informations, i.e. at what
+ * The parser can be asked to collect Node information, i.e. at what
* place in the file they were detected.
* NOTE: This is off by default and not very well tested.
*/
XML_PARSE_READER = 5
} xmlParserMode;
+typedef struct _xmlStartTag xmlStartTag;
+
/**
* xmlParserCtxt:
*
int nameMax; /* Max depth of the parsing stack */
const xmlChar * *nameTab; /* array of nodes */
- long nbChars; /* number of xmlChar processed */
+ long nbChars; /* unused */
long checkIndex; /* used by progressive parsing lookup */
int keepBlanks; /* ugly but ... */
int disableSAX; /* SAX callbacks are disabled */
int nsMax; /* the size of the arrays */
const xmlChar * *nsTab; /* the array of prefix/namespace name */
int *attallocs; /* which attribute were allocated */
- void * *pushTab; /* array of data for push */
+ xmlStartTag *pushTab; /* array of data for push */
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
int nsWellFormed; /* is the document XML Namespace okay */
xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
/*
- * the complete error informations for the last error.
+ * the complete error information for the last error.
*/
xmlError lastError;
xmlParserMode parseMode; /* the parser mode */
* xmlSAXHandler:
*
* A SAX handler is bunch of callbacks called by the parser when processing
- * of the input generate data or structure informations.
+ * of the input generate data or structure information.
*/
/**
* attribute values.
*
* SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
+ * It provides the namespace information for the element, as well as
* the new namespace declarations on the element.
*/
* @URI: the element namespace name if available
*
* SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
+ * It provides the namespace information for the element.
*/
typedef void (*endElementNsSAX2Func) (void *ctx,
struct _xmlDoc *doc; /* the containing document */
xmlNs *ns; /* pointer to the associated namespace */
xmlAttributeType atype; /* the attribute type if validating */
- void *psvi; /* for type/PSVI informations */
+ void *psvi; /* for type/PSVI information */
};
/**
xmlChar *content; /* the content */
struct _xmlAttr *properties;/* properties list */
xmlNs *nsDef; /* namespace definitions on this node */
- void *psvi; /* for type/PSVI informations */
+ void *psvi; /* for type/PSVI information */
unsigned short line; /* line number */
unsigned short extra; /* extra data for XPath/XSLT */
};
int charset; /* Internal flag for charset handling,
actually an xmlCharEncoding */
struct _xmlDict *dict; /* dict used to allocate names or NULL */
- void *psvi; /* for type/PSVI informations */
+ void *psvi; /* for type/PSVI information */
int parseFlags; /* set of xmlParserOption used to parse the
document */
int properties; /* set of xmlDocProperties for this document
*/
XMLPUBFUN void XMLCALL
xmlCleanupOutputCallbacks (void);
+XMLPUBFUN int XMLCALL
+ xmlPopOutputCallbacks (void);
XMLPUBFUN void XMLCALL
xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
* Description: macros for marking symbols as exportable/importable.
*
* Copy: See Copyright for the status of this software.
- *
- * Author: Igor Zlatovic <igor@zlatkovic.com>
*/
#ifndef __XML_EXPORTS_H__
#define __XML_EXPORTS_H__
-/**
- * XMLPUBFUN, XMLPUBVAR, XMLCALL
- *
- * Macros which declare an exportable function, an exportable variable and
- * the calling convention used for functions.
- *
- * Please use an extra block for every platform/compiler combination when
- * modifying this, rather than overlong #ifdef lines. This helps
- * readability as well as the fact that different compilers on the same
- * platform might need different definitions.
- */
+#if defined(_WIN32) || defined(__CYGWIN__)
+/** DOC_DISABLE */
+
+#ifdef LIBXML_STATIC
+ #define XMLPUBLIC
+#elif defined(IN_LIBXML)
+ #define XMLPUBLIC __declspec(dllexport)
+#else
+ #define XMLPUBLIC __declspec(dllimport)
+#endif
+
+#if defined(LIBXML_FASTCALL)
+ #define XMLCALL __fastcall
+#else
+ #define XMLCALL __cdecl
+#endif
+#define XMLCDECL __cdecl
+
+/** DOC_ENABLE */
+#else /* not Windows */
/**
- * XMLPUBFUN:
- *
- * Macros which declare an exportable function
- */
-#define XMLPUBFUN
-/**
- * XMLPUBVAR:
+ * XMLPUBLIC:
*
- * Macros which declare an exportable variable
+ * Macro which declares a public symbol
*/
-#define XMLPUBVAR extern
+#define XMLPUBLIC
+
/**
* XMLCALL:
*
- * Macros which declare the called convention for exported functions
+ * Macro which declares the calling convention for exported functions
*/
#define XMLCALL
+
/**
* XMLCDECL:
*
*/
#define XMLCDECL
-/** DOC_DISABLE */
-
-/* Windows platform with MS compiler */
-#if defined(_WIN32) && defined(_MSC_VER)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #if defined(LIBXML_FASTCALL)
- #define XMLCALL __fastcall
- #else
- #define XMLCALL __cdecl
- #endif
- #define XMLCDECL __cdecl
-#endif
+#endif /* platform switch */
-/* Windows platform with Borland compiler */
-#if defined(_WIN32) && defined(__BORLANDC__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
-#endif
-
-/* Windows platform with GNU compiler (Mingw) */
-#if defined(_WIN32) && defined(__MINGW32__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- /*
- * if defined(IN_LIBXML) this raises problems on mingw with msys
- * _imp__xmlFree listed as missing. Try to workaround the problem
- * by also making that declaration when compiling client code.
- */
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport) extern
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
-#endif
+/*
+ * XMLPUBFUN:
+ *
+ * Macro which declares an exportable function
+ */
+#define XMLPUBFUN XMLPUBLIC
-/* Cygwin platform (does not define _WIN32), GNU compiler */
-#if defined(__CYGWIN__)
- #undef XMLPUBFUN
- #undef XMLPUBVAR
- #undef XMLCALL
- #undef XMLCDECL
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
- #define XMLPUBFUN __declspec(dllexport)
- #define XMLPUBVAR __declspec(dllexport)
- #else
- #define XMLPUBFUN
- #if !defined(LIBXML_STATIC)
- #define XMLPUBVAR __declspec(dllimport) extern
- #else
- #define XMLPUBVAR extern
- #endif
- #endif
- #define XMLCALL __cdecl
- #define XMLCDECL __cdecl
-#endif
+/**
+ * XMLPUBVAR:
+ *
+ * Macro which declares an exportable variable
+ */
+#define XMLPUBVAR XMLPUBLIC extern
/* Compatibility */
#if !defined(LIBXML_DLL_IMPORT)
* @line: returned line information
*
* A schemas validation locator, a callback called by the validator.
- * This is used when file or node informations are not available
+ * This is used when file or node information are not available
* to find out what file and line number are affected
*
* Returns: 0 in case of success and -1 in case of error
/*
- * Summary: compile-time version informations
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information
+ * Description: compile-time version information for the XML library
*
* Copy: See Copyright for the status of this software.
*
/*
- * Summary: compile-time version informations on Windows
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information on Windows
+ * Description: compile-time version information for the XML library
* when compiled on the Windows platform
*
* Copy: See Copyright for the status of this software.
/*
- * Summary: compile-time version informations on Windows
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information on Windows
+ * Description: compile-time version information for the XML library
* when compiled on the Windows platform
*
* Copy: See Copyright for the status of this software.
unsigned long opLimit;
unsigned long opCount;
int depth;
- int maxDepth;
- int maxParserDepth;
};
/*
/**
* xmlXPathParserContext:
*
- * An XPath parser context. It contains pure parsing informations,
+ * An XPath parser context. It contains pure parsing information,
* an xmlXPathContext, and the stack of objects.
*/
struct _xmlXPathParserContext {
# Configure paths for LIBXML2
+# Simon Josefsson 2020-02-12
+# Fix autoconf 2.70+ warnings
# Mike Hommey 2004-06-19
# use CPPFLAGS instead of CFLAGS
# Toshio Kuratomi 2001-04-21
dnl (Also sanity checks the results of xml2-config to some extent)
dnl
rm -f conf.xmltest
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
printf("*** correct copy of xml2-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+ printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
return 1;
}
-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+]])],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
echo "*** Could not run libxml test program, checking why..."
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$LIBS $XML_LIBS"
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
#include <libxml/xmlversion.h>
#include <stdio.h>
-], [ LIBXML_TEST_VERSION; return 0;],
+]], [[ LIBXML_TEST_VERSION; return 0;]])],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
--- /dev/null
+# libxml2-config.cmake
+# --------------------
+#
+# Libxml2 cmake module.
+# This module sets the following variables:
+#
+# ::
+#
+# LIBXML2_INCLUDE_DIR - Directory where LibXml2 headers are located.
+# LIBXML2_INCLUDE_DIRS - list of the include directories needed to use LibXml2.
+# LIBXML2_LIBRARY - path to the LibXml2 library.
+# LIBXML2_LIBRARIES - xml2 libraries to link against.
+# LIBXML2_DEFINITIONS - the compiler switches required for using LibXml2.
+# LIBXML2_VERSION_MAJOR - The major version of libxml2.
+# LIBXML2_VERSION_MINOR - The minor version of libxml2.
+# LIBXML2_VERSION_PATCH - The patch version of libxml2.
+# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
+# LIBXML2_MODULES - whether libxml2 has dso support
+# LIBXML2_XMLLINT_EXECUTABLE - path to the XML checking tool xmllint coming with LibXml2
+
+include("${CMAKE_CURRENT_LIST_DIR}/libxml2-export.cmake")
+
+@PACKAGE_INIT@
+
+set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
+set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
+set(LIBXML2_VERSION_PATCH @LIBXML_MICRO_VERSION@)
+set(LIBXML2_VERSION_STRING "@VERSION@")
+set(LIBXML2_INSTALL_PREFIX ${PACKAGE_PREFIX_DIR})
+set(LIBXML2_INCLUDE_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@/libxml2)
+set(LIBXML2_LIBRARY_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@)
+
+macro(select_library_location target basename)
+ if(TARGET ${target})
+ foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
+ get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
+ get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
+ get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE)
+ get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO)
+
+ if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE)
+ set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE})
+ elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO)
+ set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO})
+ elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL)
+ set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL})
+ elseif(${basename}_${property}_RELEASE)
+ set(${basename}_LIBRARY ${${basename}_${property}_RELEASE})
+ elseif(${basename}_${property}_RELWITHDEBINFO)
+ set(${basename}_LIBRARY ${${basename}_${property}_RELWITHDEBINFO})
+ elseif(${basename}_${property}_MINSIZEREL)
+ set(${basename}_LIBRARY ${${basename}_${property}_MINSIZEREL})
+ elseif(${basename}_${property}_DEBUG)
+ set(${basename}_LIBRARY ${${basename}_${property}_DEBUG})
+ endif()
+ endforeach()
+ endif()
+endmacro()
+
+macro(select_executable_location target basename)
+ if(TARGET ${target})
+ get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG)
+ get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL)
+ get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE)
+ get_target_property(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO ${target} IMPORTED_LOCATION_RELWITHDEBINFO)
+
+ if(${basename}_IMPORTED_LOCATION_RELEASE)
+ set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELEASE})
+ elseif(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO)
+ set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELWITHDEBINFO})
+ elseif(${basename}_IMPORTED_LOCATION_MINSIZEREL)
+ set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_MINSIZEREL})
+ elseif(${basename}_IMPORTED_LOCATION_DEBUG)
+ set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG})
+ endif()
+ endif()
+endmacro()
+
+select_library_location(LibXml2::LibXml2 LIBXML2)
+select_executable_location(LibXml2::xmlcatalog LIBXML2_XMLCATALOG)
+select_executable_location(LibXml2::xmllint LIBXML2_XMLLINT)
+
+set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
+
+include(CMakeFindDependencyMacro)
+
+set(LIBXML2_SHARED @BUILD_SHARED_LIBS@)
+set(LIBXML2_WITH_ICONV @LIBXML2_WITH_ICONV@)
+set(LIBXML2_WITH_THREADS @LIBXML2_WITH_THREADS@)
+set(LIBXML2_WITH_ICU @LIBXML2_WITH_ICU@)
+set(LIBXML2_WITH_LZMA @LIBXML2_WITH_LZMA@)
+set(LIBXML2_WITH_ZLIB @LIBXML2_WITH_ZLIB@)
+
+if(LIBXML2_WITH_ICONV)
+ find_dependency(Iconv)
+ list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES})
+ list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+endif()
+
+if(NOT LIBXML2_SHARED)
+ set(LIBXML2_DEFINITIONS -DLIBXML_STATIC)
+
+ if(LIBXML2_WITH_THREADS)
+ find_dependency(Threads)
+ list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+ endif()
+
+ if(LIBXML2_WITH_ICU)
+ find_dependency(ICU COMPONENTS data i18n uc)
+ list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES})
+ endif()
+
+ if(LIBXML2_WITH_LZMA)
+ find_dependency(LibLZMA)
+ list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
+ endif()
+
+ if(LIBXML2_WITH_ZLIB)
+ find_dependency(ZLIB)
+ list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
+ endif()
+
+ if(UNIX)
+ list(APPEND LIBXML2_LIBRARIES m)
+ endif()
+
+ if(WIN32)
+ list(APPEND LIBXML2_LIBRARIES ws2_32)
+ endif()
+endif()
+
+# whether libxml2 has dso support
+set(LIBXML2_MODULES @LIBXML2_WITH_MODULES@)
+
+mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
# --------------------
#
# Libxml2 cmake module.
-# THis module sets the following variables:
+# This module sets the following variables:
#
# ::
#
-# LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located.
-# LIBXML2_LIBRARIES - xml2 libraries to link against.
-# LIBXML2_VERSION_MAJOR - The major version of libxml2.
-# LIBXML2_VERSION_MINOR - The minor version of libxml2.
-# LIBXML2_VERSION_PATCH - The patch version of libxml2.
-# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
-# LIBXML2_MODULES - whether libxml2 as dso support
+# LIBXML2_INCLUDE_DIR - Directory where LibXml2 headers are located.
+# LIBXML2_INCLUDE_DIRS - list of the include directories needed to use LibXml2.
+# LIBXML2_LIBRARY - path to the LibXml2 library.
+# LIBXML2_LIBRARIES - xml2 libraries to link against.
+# LIBXML2_DEFINITIONS - the compiler switches required for using LibXml2.
+# LIBXML2_VERSION_MAJOR - The major version of libxml2.
+# LIBXML2_VERSION_MINOR - The minor version of libxml2.
+# LIBXML2_VERSION_PATCH - The patch version of libxml2.
+# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
+# LIBXML2_MODULES - whether libxml2 has dso support
+# LIBXML2_XMLLINT_EXECUTABLE - path to the XML checking tool xmllint coming with LibXml2
+#
+# The following targets are defined:
+#
+# LibXml2::LibXml2 - the LibXml2 library
+# LibXml2::xmllint - the xmllint command-line executable
get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@)
set(LIBXML2_VERSION_STRING "@VERSION@")
+set(LIBXML2_DEFINITIONS "@XML_CFLAGS@")
set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
-set(LIBXML2_INCLUDE_DIRS ${_libxml2_rootdir}/include ${_libxml2_rootdir}/include/libxml2)
+set(LIBXML2_INCLUDE_DIR ${_libxml2_rootdir}/include/libxml2)
set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib)
-set(LIBXML2_LIBRARIES -L${LIBXML2_LIBRARY_DIR} -lxml2)
-if(@WITH_THREADS@)
- find_package(Threads REQUIRED)
- list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+find_library(LIBXML2_LIBRARY NAMES xml2 HINTS ${LIBXML2_LIBRARY_DIR} NO_DEFAULT_PATH)
+find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
+find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
+
+set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
+unset(LIBXML2_INTERFACE_LINK_LIBRARIES)
+
+include(CMakeFindDependencyMacro)
+
+set(LIBXML2_WITH_ICONV @WITH_ICONV@)
+set(LIBXML2_WITH_THREADS @WITH_THREADS@)
+set(LIBXML2_WITH_ICU @WITH_ICU@)
+set(LIBXML2_WITH_LZMA @WITH_LZMA@)
+set(LIBXML2_WITH_ZLIB @WITH_ZLIB@)
+
+if(LIBXML2_WITH_ICONV)
+ find_dependency(Iconv)
+ list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES})
+ list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+ find_dependency(Threads)
+ list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>")
+endif()
+
+if(LIBXML2_WITH_ICU)
+ find_dependency(ICU COMPONENTS data i18n uc)
+ list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES})
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
endif()
-if(@WITH_LZMA@)
- find_package(LibLZMA REQUIRED)
+if(LIBXML2_WITH_LZMA)
+ find_dependency(LibLZMA)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
- list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS})
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:LibLZMA::LibLZMA>")
endif()
-if(@WITH_ZLIB@)
- find_package(ZLIB REQUIRED)
+if(LIBXML2_WITH_ZLIB)
+ find_dependency(ZLIB)
list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
- list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ZLIB::ZLIB>")
endif()
-list(APPEND LIBXML2_LIBRARIES @ICU_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@)
+if(UNIX)
+ list(APPEND LIBXML2_LIBRARIES m)
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:m>")
+endif()
+
+if(WIN32)
+ list(APPEND LIBXML2_LIBRARIES ws2_32)
+ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>")
+endif()
# whether libxml2 has dso support
set(LIBXML2_MODULES @WITH_MODULES@)
-mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES )
+mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
+
+if(NOT TARGET LibXml2::LibXml2 AND DEFINED LIBXML2_LIBRARY AND DEFINED LIBXML2_INCLUDE_DIRS)
+ add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
+ set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
+ set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
+ set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
+ set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
+endif()
+
+if(NOT TARGET LibXml2::xmlcatalog AND DEFINED LIBXML2_XMLCATALOG_EXECUTABLE)
+ add_executable(LibXml2::xmlcatalog IMPORTED)
+ set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
+endif()
+
+if(NOT TARGET LibXml2::xmllint AND DEFINED LIBXML2_XMLLINT_EXECUTABLE)
+ add_executable(LibXml2::xmllint IMPORTED)
+ set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
+endif()
xmlHashDefaultDeallocator;
} LIBXML2_2.9.1;
+LIBXML2_2.9.11 {
+ global:
+
+# xmlIO
+ xmlPopOutputCallbacks;
+} LIBXML2_2.9.8;
+
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
* Author: Gary.Pennington@uk.sun.com
/**
* xmlFTPErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* xmlNanoFTPInit:
*
* Initialize the FTP protocol layer.
- * Currently it just checks for proxy informations,
+ * Currently it just checks for proxy information,
* and get the hostname
*/
/**
* xmlNanoFTPCleanup:
*
- * Cleanup the FTP protocol layer. This cleanup proxy informations.
+ * Cleanup the FTP protocol layer. This cleanup proxy information.
*/
void
* @passwd: the proxy password
* @type: the type of proxy 1 for using SITE, 2 for USER a@b
*
- * Setup the FTP proxy informations.
+ * Setup the FTP proxy information.
* This can also be done by using ftp_proxy ftp_proxy_user and
* ftp_proxy_password environment variables.
*/
* (Re)Initialize the FTP Proxy context by parsing the URL and finding
* the protocol host port it indicates.
* Should be like ftp://myproxy/ or ftp://myproxy:3128/
- * A NULL URL cleans up proxy informations.
+ * A NULL URL cleans up proxy information.
*/
void
xmlNanoFTPFreeCtxt(ctxt);
return(NULL);
}
- if (port != 0)
- ctxt->port = port;
+ ctxt->port = port;
res = xmlNanoFTPConnect(ctxt);
if (res < 0) {
xmlNanoFTPFreeCtxt(ctxt);
*
* Tries to change the remote directory
*
- * Returns -1 incase of error, 1 if CWD worked, 0 if it failed
+ * Returns -1 in case of error, 1 if CWD worked, 0 if it failed
*/
int
*
* Tries to delete an item (file or directory) from server
*
- * Returns -1 incase of error, 1 if DELE worked, 0 if it failed
+ * Returns -1 in case of error, 1 if DELE worked, 0 if it failed
*/
int
* Try to open a data connection to the server. Currently only
* passive mode is supported.
*
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
*/
SOCKET
*
* Close the data connection from the server
*
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
*/
int
*
* Parse at most one entry from the listing.
*
- * Returns -1 incase of error, the length of data parsed otherwise
+ * Returns -1 in case of error, the length of data parsed otherwise
*/
static int
* Do a listing on the server. All files info are passed back
* in the callbacks.
*
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
*/
int
* Fetch the given file from the server. All data are passed back
* in the callbacks. The last callback has a size of 0 block.
*
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
*/
int
*
* Close the connection and both control and transport
*
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
*/
int
/**
* xmlHTTPErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* xmlNanoHTTPInit:
*
* Initialize the HTTP protocol layer.
- * Currently it just checks for proxy informations
+ * Currently it just checks for proxy information
*/
void
* (Re)Initialize the HTTP Proxy context by parsing the URL and finding
* the protocol host port it indicates.
* Should be like http://myproxy/ or http://myproxy:3128/
- * A NULL URL cleans up proxy informations.
+ * A NULL URL cleans up proxy information.
*/
void
* @ctxt: an HTTP context
*
* Read one line in the HTTP server output, usually for extracting
- * the HTTP protocol informations from the answer header.
+ * the HTTP protocol information from the answer header.
*
* Returns a newly allocated string with a copy of the line, or NULL
* which indicate the end of the input.
* @ctxt: an HTTP context
* @line: an HTTP header line
*
- * Try to extract useful informations from the server answer.
+ * Try to extract useful information from the server answer.
* We currently parse and process:
* - The HTTP revision/ return code
* - The Content-Type, Mime-Type and charset used
* This function try to fetch the indicated resource via HTTP GET
* and save it's content in the file.
*
- * Returns -1 in case of failure, 0 incase of success. The contentType,
+ * Returns -1 in case of failure, 0 in case of success. The contentType,
* if provided must be freed by the caller
*/
int
* This function saves the output of the HTTP transaction to a file
* It closes and free the context at the end
*
- * Returns -1 in case of failure, 0 incase of success.
+ * Returns -1 in case of failure, 0 in case of success.
*/
int
xmlNanoHTTPSave(void *ctxt, const char *filename) {
- constants at the XPAth level
- provide more info on compiled expressions
- dependances w.r.t. variables (which ones)
- - dependancy on the current node
- - dependancy on the current document
+ - dependency on the current node
+ - dependency on the current document
- do not use _private but other fields in the node structures.
--- Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
-->
<ccsid_mibenum>
- <assoc ccsid="0"><!-- Curent job's CCSID. --></assoc>
+ <assoc ccsid="0"><!-- Current job's CCSID. --></assoc>
<assoc ccsid="37" mibenum="2028"><!-- EBCDIC-US -->
<alias>EBCDIC</alias>
</assoc>
* XML_CATALOG_PI:
*
- * The specific XML Catalog Processing Instuction name.
+ * The specific XML Catalog Processing Instruction name.
d XML_CATALOG_PI c 'oasis-xml-catalog'
* xmlParserNodeInfo:
*
- * The parser can be asked to collect Node informations, i.e. at what
+ * The parser can be asked to collect Node information, i.e. at what
* place in the file they were detected.
* NOTE: This is off by default and not very well tested.
d freeAttrsNr like(xmlCint) # free attr. nodes
d freeAttrs like(xmlAttrPtr) Free attr noes list
*
- * the complete error informations for the last error.
+ * the complete error information for the last error.
*
d lastError likeds(xmlError)
d parseMode like(xmlParserMode) The parser mode
* xmlSAXHandler:
*
* A SAX handler is bunch of callbacks called by the parser when
- * processing of the input generate data or structure informations.
+ * processing of the input generate data or structure information.
* resolveEntitySAXFunc:
* @ctx: the user data (XML parser context)
* (localname/prefix/URI/value/end) attribute values.
*
* SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
+ * It provides the namespace information for the element, as well as
* the new namespace declarations on the element.
d startElementNsSAX2Func...
* @URI: the element namespace name if available
*
* SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
+ * It provides the namespace information for the element.
d endElementNsSAX2Func...
d s * based(######typedef######)
* xmlFeature:
*
- * Used to examine the existance of features that can be enabled
+ * Used to examine the existence of features that can be enabled
* or disabled at compile-time.
* They used to be called XML_FEATURE_xxx but this clashed with Expat
* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
*
- * The attribute wildcard has been already builded.
+ * The attribute wildcard has been already built.
d XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED...
d c X'0001'
* XML_SCHEMAS_ATTRGROUP_GLOBAL:
*
- * The attribute wildcard has been already builded.
+ * The attribute wildcard has been already built.
d XML_SCHEMAS_ATTRGROUP_GLOBAL...
d c X'0002'
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
*
- * disallowed substitutions: "substituion"
+ * disallowed substitutions: "substitution"
d XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION...
d c X'00002000'
* xmlDocProperty
*
* Set of properties of the document as found by the parser
- * Some of them are linked to similary named xmlParserOption
+ * Some of them are linked to similarly named xmlParserOption
d xmlDocProperties...
d s based(######typedef######)
* @filename: the filename or URI
*
* Callback used in the I/O Input API to detect if the current handler
- * can provide input fonctionnalities for this resource.
+ * can provide input functionalities for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
* @filename: the filename or URI
*
* Callback used in the I/O Output API to detect if the current handler
- * can provide output fonctionnalities for this resource.
+ * can provide output functionalities for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
- * Eqivalent of C data types.
+ * Equivalent of C data types.
*
* Copy: See Copyright for the status of this software.
*
/if not defined(XML_EXPORTS_H__)
/define XML_EXPORTS_H__
- * The definition in the original C header file are not appliable to
+ * The definition in the original C header file are not applicable to
* ILE/RPG.
* Therefore this file is intentionally empty.
* @line: returned line information
*
* A schemas validation locator, a callback called by the validator.
- * This is used when file or node informations are not available
+ * This is used when file or node information are not available
* to find out what file and line number are affected
*
* Returns: 0 in case of success and -1 in case of error
- * Summary: compile-time version informations
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information
+ * Description: compile-time version information for the XML library
*
* Copy: See Copyright for the status of this software.
*
* xmlXPathParserContext:
*
- * An XPath parser context. It contains pure parsing informations,
+ * An XPath parser context. It contains pure parsing information,
* an xmlXPathContext, and the stack of objects.
d xmlXPathParserContext...
/**
-*** ILE/RPG cannot directly derefence a pointer and has no macros.
+*** ILE/RPG cannot directly dereference a pointer and has no macros.
*** The following additional procedures supply these functions.
*** In addition, the following code is adjusted for threads control at
*** compile time via the C macros.
/**
-*** Additional delarations for ILE/RPG support.
+*** Additional declarations for ILE/RPG support.
***
*** See Copyright for the status of this software.
***
/**
*** Support for inline conversion from/to UTF-8.
-*** This is targetted to function parameter encoding conversion.
+*** This is targeted to function parameter encoding conversion.
*** Method is:
*** - Convert string from/to UTF-8.
*** - Keep it in a dictionary.
#include "buf.h"
#include "enc.h"
+struct _xmlStartTag {
+ const xmlChar *prefix;
+ const xmlChar *URI;
+ int line;
+ int nsNr;
+};
+
static void
xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info);
xmlEntityPtr ent, size_t replacement)
{
size_t consumed = 0;
+ int i;
if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
return (0);
rep = NULL;
}
}
+
+ /*
+ * Prevent entity exponential check, not just replacement while
+ * parsing the DTD
+ * The check is potentially costly so do that only once in a thousand
+ */
+ if ((ctxt->instate == XML_PARSER_DTD) && (ctxt->nbentities > 10000) &&
+ (ctxt->nbentities % 1024 == 0)) {
+ for (i = 0;i < ctxt->inputNr;i++) {
+ consumed += ctxt->inputTab[i]->consumed +
+ (ctxt->inputTab[i]->cur - ctxt->inputTab[i]->base);
+ }
+ if (ctxt->nbentities > consumed * XML_PARSER_NON_LINEAR) {
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+ ctxt->instate = XML_PARSER_EOF;
+ return (1);
+ }
+ consumed = 0;
+ }
+
+
+
if (replacement != 0) {
if (replacement < XML_MAX_TEXT_LENGTH)
return(0);
*/
static void
xmlDetectSAX2(xmlParserCtxtPtr ctxt) {
+ xmlSAXHandlerPtr sax;
if (ctxt == NULL) return;
+ sax = ctxt->sax;
#ifdef LIBXML_SAX1_ENABLED
- if ((ctxt->sax) && (ctxt->sax->initialized == XML_SAX2_MAGIC) &&
- ((ctxt->sax->startElementNs != NULL) ||
- (ctxt->sax->endElementNs != NULL))) ctxt->sax2 = 1;
+ if ((sax) && (sax->initialized == XML_SAX2_MAGIC) &&
+ ((sax->startElementNs != NULL) ||
+ (sax->endElementNs != NULL) ||
+ ((sax->startElement == NULL) && (sax->endElement == NULL))))
+ ctxt->sax2 = 1;
#else
ctxt->sax2 = 1;
#endif /* LIBXML_SAX1_ENABLED */
* @value: the element name
* @prefix: the element prefix
* @URI: the element namespace name
+ * @line: the current line number for error messages
+ * @nsNr: the number of namespaces pushed on the namespace table
*
* Pushes a new element name/prefix/URL on top of the name stack
*
*/
static int
nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value,
- const xmlChar *prefix, const xmlChar *URI, int nsNr)
+ const xmlChar *prefix, const xmlChar *URI, int line, int nsNr)
{
+ xmlStartTag *tag;
+
if (ctxt->nameNr >= ctxt->nameMax) {
const xmlChar * *tmp;
- void **tmp2;
+ xmlStartTag *tmp2;
ctxt->nameMax *= 2;
tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab,
ctxt->nameMax *
goto mem_error;
}
ctxt->nameTab = tmp;
- tmp2 = (void **) xmlRealloc((void * *)ctxt->pushTab,
- ctxt->nameMax * 3 *
+ tmp2 = (xmlStartTag *) xmlRealloc((void * *)ctxt->pushTab,
+ ctxt->nameMax *
sizeof(ctxt->pushTab[0]));
if (tmp2 == NULL) {
ctxt->nameMax /= 2;
}
ctxt->pushTab = tmp2;
} else if (ctxt->pushTab == NULL) {
- ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 *
+ ctxt->pushTab = (xmlStartTag *) xmlMalloc(ctxt->nameMax *
sizeof(ctxt->pushTab[0]));
if (ctxt->pushTab == NULL)
goto mem_error;
}
ctxt->nameTab[ctxt->nameNr] = value;
ctxt->name = value;
- ctxt->pushTab[ctxt->nameNr * 3] = (void *) prefix;
- ctxt->pushTab[ctxt->nameNr * 3 + 1] = (void *) URI;
- ctxt->pushTab[ctxt->nameNr * 3 + 2] = (void *) (ptrdiff_t) nsNr;
+ tag = &ctxt->pushTab[ctxt->nameNr];
+ tag->prefix = prefix;
+ tag->URI = URI;
+ tag->line = line;
+ tag->nsNr = nsNr;
return (ctxt->nameNr++);
mem_error:
xmlErrMemory(ctxt, NULL);
((unsigned char *) s)[ 9 ] == c10 )
#define SKIP(val) do { \
- ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val); \
+ ctxt->input->cur += (val),ctxt->input->col+=(val); \
if (*ctxt->input->cur == 0) \
xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
} while (0)
if (*(ctxt->input->cur) == '\n') { \
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
- ctxt->nbChars++; \
ctxt->input->cur++; \
} \
if (*ctxt->input->cur == 0) \
#define NEXT1 { \
ctxt->input->col++; \
ctxt->input->cur++; \
- ctxt->nbChars++; \
if (*ctxt->input->cur == 0) \
xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
}
* It's Okay to use CUR/NEXT here since all the blanks are on
* the ASCII range.
*/
- if ((ctxt->inputNr == 1) && (ctxt->instate != XML_PARSER_DTD)) {
+ if (ctxt->instate != XML_PARSER_DTD) {
const xmlChar *cur;
/*
* if we are in the document content, go really fast
if (RAW == ';') {
/* on purpose to avoid reentrancy problems with NEXT and SKIP */
ctxt->input->col++;
- ctxt->nbChars ++;
ctxt->input->cur++;
}
} else if ((RAW == '&') && (NXT(1) == '#')) {
if (RAW == ';') {
/* on purpose to avoid reentrancy problems with NEXT and SKIP */
ctxt->input->col++;
- ctxt->nbChars ++;
ctxt->input->cur++;
}
} else {
else
c = 0;
while ((c != 0) && (c != end) && /* non input consuming loop */
- (c != end2) && (c != end3)) {
+ (c != end2) && (c != end3) &&
+ (ctxt->instate != XML_PARSER_EOF)) {
if (c == 0) break;
if ((c == '&') && (str[1] == '#')) {
rep = xmlStringDecodeEntities(ctxt, ent->content, what,
0, 0, 0);
ctxt->depth--;
- if (rep == NULL)
+ if (rep == NULL) {
+ ent->content[0] = 0;
goto int_error;
+ }
current = rep;
while (*current != 0) { /* non input consuming loop */
rep = xmlStringDecodeEntities(ctxt, ent->content, what,
0, 0, 0);
ctxt->depth--;
- if (rep == NULL)
+ if (rep == NULL) {
+ if (ent->content != NULL)
+ ent->content[0] = 0;
goto int_error;
+ }
current = rep;
while (*current != 0) { /* non input consuming loop */
buffer[nbchars++] = *current++;
}
ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
ctxt->input->cur = in;
- ctxt->nbChars += count;
ctxt->input->col += count;
if (ret == NULL)
xmlErrMemory(ctxt, NULL);
}
ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
ctxt->input->cur = in;
- ctxt->nbChars += count;
ctxt->input->col += count;
if (ret == NULL) {
xmlErrMemory(ctxt, NULL);
while (*in != 0 && *in == *cmp) {
++in;
++cmp;
- ctxt->input->col++;
}
if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
/* success */
+ ctxt->input->col += in - ctxt->input->cur;
ctxt->input->cur = in;
return (const xmlChar*) 1;
}
"AttValue length too long\n");
goto mem_error;
}
- if (c == 0) break;
if (c == '&') {
in_space = 0;
if (NXT(1) == '#') {
}
count++;
if (count > 50) {
+ SHRINK;
GROW;
count = 0;
if (ctxt->instate == XML_PARSER_EOF) {
buf[len++] = cur;
count++;
if (count > 50) {
+ SHRINK;
GROW;
count = 0;
if (ctxt->instate == XML_PARSER_EOF) {
if (ctxt->instate == XML_PARSER_EOF)
return;
in = ctxt->input->cur;
- } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09));
+ } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
nbchar = 0;
}
ctxt->input->line = line;
}
count++;
if (count > 50) {
+ SHRINK;
GROW;
count = 0;
if (ctxt->instate == XML_PARSER_EOF)
count++;
if (count > 50) {
+ SHRINK;
GROW;
count = 0;
if (ctxt->instate == XML_PARSER_EOF) {
ctxt->input->col++;
goto get_more;
}
- } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09));
+ } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
xmlParseCommentComplex(ctxt, buf, len, size);
ctxt->instate = state;
return;
* <?oasis-xml-catalog catalog="http://example.com/catalog.xml"?>
*
* Occurs only if allowed by the user and if happening in the Misc
- * part of the document before any doctype informations
+ * part of the document before any doctype information
* This will add the given catalog to the parsing context in order
* to be used if there is a resolution need further down in the document
*/
}
count++;
if (count > 50) {
+ SHRINK;
GROW;
if (ctxt->instate == XML_PARSER_EOF) {
xmlFree(buf);
NEXT;
if (elem == NULL) {
ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
- if (ret == NULL) return(NULL);
+ if (ret == NULL) {
+ xmlFreeDocElementContent(ctxt->myDoc, cur);
+ return(NULL);
+ }
ret->c1 = cur;
if (cur != NULL)
cur->parent = ret;
cur = ret;
} else {
n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
- if (n == NULL) return(NULL);
+ if (n == NULL) {
+ xmlFreeDocElementContent(ctxt->myDoc, ret);
+ return(NULL);
+ }
n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
if (n->c1 != NULL)
n->c1->parent = n;
SKIP_BLANKS;
cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, inputid,
depth + 1);
+ if (cur == NULL)
+ return(NULL);
SKIP_BLANKS;
GROW;
} else {
SKIP_BLANKS;
last = xmlParseElementChildrenContentDeclPriv(ctxt, inputid,
depth + 1);
+ if (last == NULL) {
+ if (ret != NULL)
+ xmlFreeDocElementContent(ctxt->myDoc, ret);
+ return(NULL);
+ }
SKIP_BLANKS;
} else {
elem = xmlParseName(ctxt);
xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
xmlChar *version;
const xmlChar *encoding;
+ int oldstate;
/*
* We know that '<?xml' is here.
return;
}
+ /* Avoid expansion of parameter entities when skipping blanks. */
+ oldstate = ctxt->instate;
+ ctxt->instate = XML_PARSER_START;
+
if (SKIP_BLANKS == 0) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space needed after '<?xml'\n");
/*
* The XML REC instructs us to stop parsing right here
*/
+ ctxt->instate = oldstate;
return;
}
if ((encoding == NULL) && (ctxt->errNo == XML_ERR_OK)) {
MOVETO_ENDTAG(CUR_PTR);
NEXT;
}
+
+ ctxt->instate = oldstate;
}
/**
ent->checked |= 1;
if (ret == XML_ERR_ENTITY_LOOP) {
xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+ xmlHaltParser(ctxt);
xmlFreeNodeList(list);
return;
}
(ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY))&&
(ent->children == NULL)) {
ent->children = list;
- if (ctxt->replaceEntities) {
- /*
- * Prune it directly in the generated document
- * except for single text nodes.
- */
- if (((list->type == XML_TEXT_NODE) &&
- (list->next == NULL)) ||
- (ctxt->parseMode == XML_PARSE_READER)) {
- list->parent = (xmlNodePtr) ent;
- list = NULL;
- ent->owner = 1;
- } else {
- ent->owner = 0;
- while (list != NULL) {
- list->parent = (xmlNodePtr) ctxt->node;
- list->doc = ctxt->myDoc;
- if (list->next == NULL)
- ent->last = list;
- list = list->next;
- }
- list = ent->children;
+ /*
+ * Prune it directly in the generated document
+ * except for single text nodes.
+ */
+ if ((ctxt->replaceEntities == 0) ||
+ (ctxt->parseMode == XML_PARSE_READER) ||
+ ((list->type == XML_TEXT_NODE) &&
+ (list->next == NULL))) {
+ ent->owner = 1;
+ while (list != NULL) {
+ list->parent = (xmlNodePtr) ent;
+ xmlSetTreeDoc(list, ent->doc);
+ if (list->next == NULL)
+ ent->last = list;
+ list = list->next;
+ }
+ list = NULL;
+ } else {
+ ent->owner = 0;
+ while (list != NULL) {
+ list->parent = (xmlNodePtr) ctxt->node;
+ list->doc = ctxt->myDoc;
+ if (list->next == NULL)
+ ent->last = list;
+ list = list->next;
+ }
+ list = ent->children;
#ifdef LIBXML_LEGACY_ENABLED
- if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
- xmlAddEntityReference(ent, list, NULL);
+ if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
+ xmlAddEntityReference(ent, list, NULL);
#endif /* LIBXML_LEGACY_ENABLED */
- }
- } else {
- ent->owner = 1;
- while (list != NULL) {
- list->parent = (xmlNodePtr) ent;
- xmlSetTreeDoc(list, ent->doc);
- if (list->next == NULL)
- ent->last = list;
- list = list->next;
- }
- }
+ }
} else {
xmlFreeNodeList(list);
list = NULL;
xmlChar start[4];
xmlCharEncoding enc;
+ if (xmlParserEntityCheck(ctxt, 0, entity, 0))
+ return;
+
if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
((ctxt->options & XML_PARSE_NOENT) == 0) &&
((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
*
*/
if (name != (xmlChar*)1) {
- if (name == NULL) name = BAD_CAST "unparseable";
+ if (name == NULL) name = BAD_CAST "unparsable";
xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
"Opening and ending tag mismatch: %s line %d and %s\n",
ctxt->name, line, name);
}
if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
/* success */
+ ctxt->input->col += in - ctxt->input->cur;
ctxt->input->cur = in;
return((const xmlChar*) 1);
}
*/
static void
-xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
- const xmlChar *URI, int line, int nsNr, int tlen) {
+xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
const xmlChar *name;
- size_t curLength;
GROW;
if ((RAW != '<') || (NXT(1) != '/')) {
}
SKIP(2);
- curLength = ctxt->input->end - ctxt->input->cur;
- if ((tlen > 0) && (curLength >= (size_t)tlen) &&
- (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) {
- if ((curLength >= (size_t)(tlen + 1)) &&
- (ctxt->input->cur[tlen] == '>')) {
- ctxt->input->cur += tlen + 1;
- ctxt->input->col += tlen + 1;
- goto done;
- }
- ctxt->input->cur += tlen;
- ctxt->input->col += tlen;
- name = (xmlChar*)1;
- } else {
- if (prefix == NULL)
- name = xmlParseNameAndCompare(ctxt, ctxt->name);
- else
- name = xmlParseQNameAndCompare(ctxt, ctxt->name, prefix);
- }
+ if (tag->prefix == NULL)
+ name = xmlParseNameAndCompare(ctxt, ctxt->name);
+ else
+ name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
/*
* We should definitely be at the ending "S? '>'" part
*
*/
if (name != (xmlChar*)1) {
- if (name == NULL) name = BAD_CAST "unparseable";
- if ((line == 0) && (ctxt->node != NULL))
- line = ctxt->node->line;
+ if (name == NULL) name = BAD_CAST "unparsable";
xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
"Opening and ending tag mismatch: %s line %d and %s\n",
- ctxt->name, line, name);
+ ctxt->name, tag->line, name);
}
/*
* SAX: End of Tag
*/
-done:
if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
(!ctxt->disableSAX))
- ctxt->sax->endElementNs(ctxt->userData, ctxt->name, prefix, URI);
+ ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
+ tag->URI);
spacePop(ctxt);
- if (nsNr != 0)
- nsPop(ctxt, nsNr);
- return;
+ if (tag->nsNr != 0)
+ nsPop(ctxt, tag->nsNr);
}
/**
sl = l;
count++;
if (count > 50) {
+ SHRINK;
GROW;
if (ctxt->instate == XML_PARSER_EOF) {
xmlFree(buf);
}
/**
- * xmlParseContent:
+ * xmlParseContentInternal:
* @ctxt: an XML parser context
*
- * Parse a content:
- *
- * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
+ * Parse a content sequence. Stops at EOF or '</'. Leaves checking of
+ * unexpected EOF to the caller.
*/
-void
-xmlParseContent(xmlParserCtxtPtr ctxt) {
+static void
+xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
int nameNr = ctxt->nameNr;
GROW;
}
/**
+ * xmlParseContent:
+ * @ctxt: an XML parser context
+ *
+ * Parse a content sequence. Stops at EOF or '</'.
+ *
+ * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
+ */
+
+void
+xmlParseContent(xmlParserCtxtPtr ctxt) {
+ int nameNr = ctxt->nameNr;
+
+ xmlParseContentInternal(ctxt);
+
+ if ((ctxt->instate != XML_PARSER_EOF) && (ctxt->nameNr > nameNr)) {
+ const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
+ int line = ctxt->pushTab[ctxt->nameNr - 1].line;
+ xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
+ "Premature end of data in tag %s line %d\n",
+ name, line, NULL);
+ }
+}
+
+/**
* xmlParseElement:
* @ctxt: an XML parser context
*
xmlParseElement(xmlParserCtxtPtr ctxt) {
if (xmlParseElementStart(ctxt) != 0)
return;
- xmlParseContent(ctxt);
+
+ xmlParseContentInternal(ctxt);
if (ctxt->instate == XML_PARSER_EOF)
return;
+
+ if (CUR == 0) {
+ const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
+ int line = ctxt->pushTab[ctxt->nameNr - 1].line;
+ xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
+ "Premature end of data in tag %s line %d\n",
+ name, line, NULL);
+ return;
+ }
+
xmlParseElementEnd(ctxt);
}
spacePop(ctxt);
return(-1);
}
- if (ctxt->sax2)
- nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr);
-#ifdef LIBXML_SAX1_ENABLED
- else
- namePush(ctxt, name);
-#endif /* LIBXML_SAX1_ENABLED */
+ nameNsPush(ctxt, name, prefix, URI, line, ctxt->nsNr - nsNr);
ret = ctxt->node;
#ifdef LIBXML_VALID_ENABLED
* parse the end of tag: '</' should be here.
*/
if (ctxt->sax2) {
- const xmlChar *prefix = ctxt->pushTab[ctxt->nameNr * 3 - 3];
- const xmlChar *URI = ctxt->pushTab[ctxt->nameNr * 3 - 2];
- int nsNr = (ptrdiff_t) ctxt->pushTab[ctxt->nameNr * 3 - 1];
- xmlParseEndTag2(ctxt, prefix, URI, 0, nsNr, 0);
+ xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
namePop(ctxt);
}
#ifdef LIBXML_SAX1_ENABLED
const xmlChar *name;
const xmlChar *prefix = NULL;
const xmlChar *URI = NULL;
+ int line = ctxt->input->line;
int nsNr = ctxt->nsNr;
if ((avail < 2) && (ctxt->inputNr == 1))
nodePop(ctxt);
spacePop(ctxt);
}
- if (ctxt->sax2)
- nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr);
-#ifdef LIBXML_SAX1_ENABLED
- else
- namePush(ctxt, name);
-#endif /* LIBXML_SAX1_ENABLED */
+ nameNsPush(ctxt, name, prefix, URI, line, ctxt->nsNr - nsNr);
ctxt->instate = XML_PARSER_CONTENT;
ctxt->progressive = 1;
}
}
if (ctxt->sax2) {
- xmlParseEndTag2(ctxt,
- (void *) ctxt->pushTab[ctxt->nameNr * 3 - 3],
- (void *) ctxt->pushTab[ctxt->nameNr * 3 - 2], 0,
- (int) (ptrdiff_t)
- ctxt->pushTab[ctxt->nameNr * 3 - 1], 0);
+ xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
nameNsPop(ctxt);
}
#ifdef LIBXML_SAX1_ENABLED
}
}
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
+ xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
ctxt->errNo = XML_PARSER_EOF;
xmlHaltParser(ctxt);
return (XML_PARSER_EOF);
}
- xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
#endif
size_t current = ctxt->input->cur - ctxt->input->base;
nbchars = xmlCharEncInput(in, terminate);
+ xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
if (nbchars < 0) {
/* TODO 2.6.0 */
xmlGenericError(xmlGenericErrorContext,
xmlHaltParser(ctxt);
return(XML_ERR_INVALID_ENCODING);
}
- xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
}
}
}
int
xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
const xmlChar *ID, xmlNodePtr *lst) {
- xmlParserCtxtPtr ctxt;
- xmlDocPtr newDoc;
- xmlNodePtr newRoot;
- xmlSAXHandlerPtr oldsax = NULL;
- int ret = 0;
- xmlChar start[4];
- xmlCharEncoding enc;
+ void *userData;
if (ctx == NULL) return(-1);
-
- if (((ctx->depth > 40) && ((ctx->options & XML_PARSE_HUGE) == 0)) ||
- (ctx->depth > 1024)) {
- return(XML_ERR_ENTITY_LOOP);
- }
-
- if (lst != NULL)
- *lst = NULL;
- if ((URL == NULL) && (ID == NULL))
- return(-1);
- if (ctx->myDoc == NULL) /* @@ relax but check for dereferences */
- return(-1);
-
- ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, ctx);
- if (ctxt == NULL) {
- return(-1);
- }
-
- oldsax = ctxt->sax;
- ctxt->sax = ctx->sax;
- xmlDetectSAX2(ctxt);
- newDoc = xmlNewDoc(BAD_CAST "1.0");
- if (newDoc == NULL) {
- xmlFreeParserCtxt(ctxt);
- return(-1);
- }
- newDoc->properties = XML_DOC_INTERNAL;
- if (ctx->myDoc->dict) {
- newDoc->dict = ctx->myDoc->dict;
- xmlDictReference(newDoc->dict);
- }
- if (ctx->myDoc != NULL) {
- newDoc->intSubset = ctx->myDoc->intSubset;
- newDoc->extSubset = ctx->myDoc->extSubset;
- }
- if (ctx->myDoc->URL != NULL) {
- newDoc->URL = xmlStrdup(ctx->myDoc->URL);
- }
- newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
- if (newRoot == NULL) {
- ctxt->sax = oldsax;
- xmlFreeParserCtxt(ctxt);
- newDoc->intSubset = NULL;
- newDoc->extSubset = NULL;
- xmlFreeDoc(newDoc);
- return(-1);
- }
- xmlAddChild((xmlNodePtr) newDoc, newRoot);
- nodePush(ctxt, newDoc->children);
- if (ctx->myDoc == NULL) {
- ctxt->myDoc = newDoc;
- } else {
- ctxt->myDoc = ctx->myDoc;
- newDoc->children->doc = ctx->myDoc;
- }
-
- /*
- * Get the 4 first bytes and decode the charset
- * if enc != XML_CHAR_ENCODING_NONE
- * plug some encoding conversion routines.
- */
- GROW
- if ((ctxt->input->end - ctxt->input->cur) >= 4) {
- start[0] = RAW;
- start[1] = NXT(1);
- start[2] = NXT(2);
- start[3] = NXT(3);
- enc = xmlDetectCharEncoding(start, 4);
- if (enc != XML_CHAR_ENCODING_NONE) {
- xmlSwitchEncoding(ctxt, enc);
- }
- }
-
/*
- * Parse a possible text declaration first
- */
- if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
- xmlParseTextDecl(ctxt);
- /*
- * An XML-1.0 document can't reference an entity not XML-1.0
- */
- if ((xmlStrEqual(ctx->version, BAD_CAST "1.0")) &&
- (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
- xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
- "Version mismatch between document and entity\n");
- }
- }
-
- /*
- * If the user provided its own SAX callbacks then reuse the
- * useData callback field, otherwise the expected setup in a
+ * If the user provided their own SAX callbacks, then reuse the
+ * userData callback field, otherwise the expected setup in a
* DOM builder is to have userData == ctxt
*/
if (ctx->userData == ctx)
- ctxt->userData = ctxt;
+ userData = NULL;
else
- ctxt->userData = ctx->userData;
-
- /*
- * Doing validity checking on chunk doesn't make sense
- */
- ctxt->instate = XML_PARSER_CONTENT;
- ctxt->validate = ctx->validate;
- ctxt->valid = ctx->valid;
- ctxt->loadsubset = ctx->loadsubset;
- ctxt->depth = ctx->depth + 1;
- ctxt->replaceEntities = ctx->replaceEntities;
- if (ctxt->validate) {
- ctxt->vctxt.error = ctx->vctxt.error;
- ctxt->vctxt.warning = ctx->vctxt.warning;
- } else {
- ctxt->vctxt.error = NULL;
- ctxt->vctxt.warning = NULL;
- }
- ctxt->vctxt.nodeTab = NULL;
- ctxt->vctxt.nodeNr = 0;
- ctxt->vctxt.nodeMax = 0;
- ctxt->vctxt.node = NULL;
- if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
- ctxt->dict = ctx->dict;
- ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
- ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
- ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
- ctxt->dictNames = ctx->dictNames;
- ctxt->attsDefault = ctx->attsDefault;
- ctxt->attsSpecial = ctx->attsSpecial;
- ctxt->linenumbers = ctx->linenumbers;
-
- xmlParseContent(ctxt);
-
- ctx->validate = ctxt->validate;
- ctx->valid = ctxt->valid;
- if ((RAW == '<') && (NXT(1) == '/')) {
- xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
- } else if (RAW != 0) {
- xmlFatalErr(ctxt, XML_ERR_EXTRA_CONTENT, NULL);
- }
- if (ctxt->node != newDoc->children) {
- xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
- }
-
- if (!ctxt->wellFormed) {
- if (ctxt->errNo == 0)
- ret = 1;
- else
- ret = ctxt->errNo;
- } else {
- if (lst != NULL) {
- xmlNodePtr cur;
-
- /*
- * Return the newly created nodeset after unlinking it from
- * they pseudo parent.
- */
- cur = newDoc->children->children;
- *lst = cur;
- while (cur != NULL) {
- cur->parent = NULL;
- cur = cur->next;
- }
- newDoc->children->children = NULL;
- }
- ret = 0;
- }
- ctxt->sax = oldsax;
- ctxt->dict = NULL;
- ctxt->attsDefault = NULL;
- ctxt->attsSpecial = NULL;
- xmlFreeParserCtxt(ctxt);
- newDoc->intSubset = NULL;
- newDoc->extSubset = NULL;
- xmlFreeDoc(newDoc);
-
- return(ret);
+ userData = ctx->userData;
+ return xmlParseExternalEntityPrivate(ctx->myDoc, ctx, ctx->sax,
+ userData, ctx->depth + 1,
+ URL, ID, lst);
}
/**
* xmlParseExternalEntityPrivate:
* @doc: the document the chunk pertains to
* @oldctxt: the previous parser context if available
- * @sax: the SAX handler bloc (possibly NULL)
+ * @sax: the SAX handler block (possibly NULL)
* @user_data: The user data returned on SAX callbacks (possibly NULL)
* @depth: Used for loop detection, use 0
* @URL: the URL for the entity to load
ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, oldctxt);
if (ctxt == NULL) return(XML_WAR_UNDECLARED_ENTITY);
ctxt->userData = ctxt;
- if (oldctxt != NULL) {
- ctxt->_private = oldctxt->_private;
- ctxt->loadsubset = oldctxt->loadsubset;
- ctxt->validate = oldctxt->validate;
- ctxt->external = oldctxt->external;
- ctxt->record_info = oldctxt->record_info;
- ctxt->node_seq.maximum = oldctxt->node_seq.maximum;
- ctxt->node_seq.length = oldctxt->node_seq.length;
- ctxt->node_seq.buffer = oldctxt->node_seq.buffer;
- } else {
- /*
- * Doing validity checking on chunk without context
- * doesn't make sense
- */
- ctxt->_private = NULL;
- ctxt->validate = 0;
- ctxt->external = 2;
- ctxt->loadsubset = 0;
- }
if (sax != NULL) {
oldsax = ctxt->sax;
ctxt->sax = sax;
xmlDetectSAX2(ctxt);
newDoc = xmlNewDoc(BAD_CAST "1.0");
if (newDoc == NULL) {
- ctxt->node_seq.maximum = 0;
- ctxt->node_seq.length = 0;
- ctxt->node_seq.buffer = NULL;
xmlFreeParserCtxt(ctxt);
return(XML_ERR_INTERNAL_ERROR);
}
newDoc->properties = XML_DOC_INTERNAL;
- newDoc->intSubset = doc->intSubset;
- newDoc->extSubset = doc->extSubset;
- newDoc->dict = doc->dict;
- xmlDictReference(newDoc->dict);
-
- if (doc->URL != NULL) {
- newDoc->URL = xmlStrdup(doc->URL);
+ if (doc) {
+ newDoc->intSubset = doc->intSubset;
+ newDoc->extSubset = doc->extSubset;
+ if (doc->dict) {
+ newDoc->dict = doc->dict;
+ xmlDictReference(newDoc->dict);
+ }
+ if (doc->URL != NULL) {
+ newDoc->URL = xmlStrdup(doc->URL);
+ }
}
newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
if (newRoot == NULL) {
if (sax != NULL)
ctxt->sax = oldsax;
- ctxt->node_seq.maximum = 0;
- ctxt->node_seq.length = 0;
- ctxt->node_seq.buffer = NULL;
xmlFreeParserCtxt(ctxt);
newDoc->intSubset = NULL;
newDoc->extSubset = NULL;
}
xmlAddChild((xmlNodePtr) newDoc, newRoot);
nodePush(ctxt, newDoc->children);
- ctxt->myDoc = doc;
- newRoot->doc = doc;
+ if (doc == NULL) {
+ ctxt->myDoc = newDoc;
+ } else {
+ ctxt->myDoc = doc;
+ newRoot->doc = doc;
+ }
/*
* Get the 4 first bytes and decode the charset
*/
if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
xmlParseTextDecl(ctxt);
+ /*
+ * An XML-1.0 document can't reference an entity not XML-1.0
+ */
+ if ((xmlStrEqual(oldctxt->version, BAD_CAST "1.0")) &&
+ (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
+ xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
+ "Version mismatch between document and entity\n");
+ }
}
ctxt->instate = XML_PARSER_CONTENT;
ctxt->depth = depth;
+ if (oldctxt != NULL) {
+ ctxt->_private = oldctxt->_private;
+ ctxt->loadsubset = oldctxt->loadsubset;
+ ctxt->validate = oldctxt->validate;
+ ctxt->valid = oldctxt->valid;
+ ctxt->replaceEntities = oldctxt->replaceEntities;
+ if (oldctxt->validate) {
+ ctxt->vctxt.error = oldctxt->vctxt.error;
+ ctxt->vctxt.warning = oldctxt->vctxt.warning;
+ ctxt->vctxt.userData = oldctxt->vctxt.userData;
+ }
+ ctxt->external = oldctxt->external;
+ if (ctxt->dict) xmlDictFree(ctxt->dict);
+ ctxt->dict = oldctxt->dict;
+ ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
+ ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
+ ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
+ ctxt->dictNames = oldctxt->dictNames;
+ ctxt->attsDefault = oldctxt->attsDefault;
+ ctxt->attsSpecial = oldctxt->attsSpecial;
+ ctxt->linenumbers = oldctxt->linenumbers;
+ ctxt->record_info = oldctxt->record_info;
+ ctxt->node_seq.maximum = oldctxt->node_seq.maximum;
+ ctxt->node_seq.length = oldctxt->node_seq.length;
+ ctxt->node_seq.buffer = oldctxt->node_seq.buffer;
+ } else {
+ /*
+ * Doing validity checking on chunk without context
+ * doesn't make sense
+ */
+ ctxt->_private = NULL;
+ ctxt->validate = 0;
+ ctxt->external = 2;
+ ctxt->loadsubset = 0;
+ }
xmlParseContent(ctxt);
if (sax != NULL)
ctxt->sax = oldsax;
if (oldctxt != NULL) {
+ ctxt->dict = NULL;
+ ctxt->attsDefault = NULL;
+ ctxt->attsSpecial = NULL;
+ oldctxt->validate = ctxt->validate;
+ oldctxt->valid = ctxt->valid;
oldctxt->node_seq.maximum = ctxt->node_seq.maximum;
oldctxt->node_seq.length = ctxt->node_seq.length;
oldctxt->node_seq.buffer = ctxt->node_seq.buffer;
/**
* xmlParseExternalEntity:
* @doc: the document the chunk pertains to
- * @sax: the SAX handler bloc (possibly NULL)
+ * @sax: the SAX handler block (possibly NULL)
* @user_data: The user data returned on SAX callbacks (possibly NULL)
* @depth: Used for loop detection, use 0
* @URL: the URL for the entity to load
/**
* xmlParseBalancedChunkMemory:
- * @doc: the document the chunk pertains to
- * @sax: the SAX handler bloc (possibly NULL)
+ * @doc: the document the chunk pertains to (must not be NULL)
+ * @sax: the SAX handler block (possibly NULL)
* @user_data: The user data returned on SAX callbacks (possibly NULL)
* @depth: Used for loop detection, use 0
* @string: the input string in UTF8 or ISO-Latin (zero terminated)
#ifdef LIBXML_SAX1_ENABLED
/**
* xmlParseBalancedChunkMemoryRecover:
- * @doc: the document the chunk pertains to
- * @sax: the SAX handler bloc (possibly NULL)
+ * @doc: the document the chunk pertains to (must not be NULL)
+ * @sax: the SAX handler block (possibly NULL)
* @user_data: The user data returned on SAX callbacks (possibly NULL)
* @depth: Used for loop detection, use 0
* @string: the input string in UTF8 or ISO-Latin (zero terminated)
} else {
xmlCtxtUseOptionsInternal(ctxt, XML_PARSE_NODICT, NULL);
}
+ /* doc == NULL is only supported for historic reasons */
if (doc != NULL) {
newDoc->intSubset = doc->intSubset;
newDoc->extSubset = doc->extSubset;
}
xmlAddChild((xmlNodePtr) newDoc, newRoot);
nodePush(ctxt, newRoot);
+ /* doc == NULL is only supported for historic reasons */
if (doc == NULL) {
ctxt->myDoc = newDoc;
} else {
xmlFreeParserCtxt(ctxt);
newDoc->intSubset = NULL;
newDoc->extSubset = NULL;
- if(doc != NULL)
- newDoc->oldNs = NULL;
+ /* This leaks the namespace list if doc == NULL */
+ newDoc->oldNs = NULL;
xmlFreeDoc(newDoc);
return(ret);
if ((ctxt->wellFormed) || recovery) {
ret = ctxt->myDoc;
- if (ret != NULL) {
+ if ((ret != NULL) && (ctxt->input->buf != NULL)) {
if (ctxt->input->buf->compressed > 0)
ret->compression = 9;
else
if (xmlParserInitialized != 0)
return;
+#if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+ atexit(xmlCleanupParser);
+#endif
+
#ifdef LIBXML_THREAD_ENABLED
__xmlGlobalInitMutexLock();
if (xmlParserInitialized == 0) {
xmlParserInitialized = 0;
}
+#if defined(HAVE_ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \
+ !defined(_WIN32)
+static void
+ATTRIBUTE_DESTRUCTOR
+xmlDestructor(void) {
+ /*
+ * Calling custom deallocation functions in a destructor can cause
+ * problems, for example with Nokogiri.
+ */
+ if (xmlFree == free)
+ xmlCleanupParser();
+}
+#endif
+
/************************************************************************
* *
* New set (2.6.0) of simpler and more flexible APIs *
ctxt->vctxt.warning = xmlParserValidityWarning;
#endif
ctxt->record_info = 0;
- ctxt->nbChars = 0;
ctxt->checkIndex = 0;
ctxt->inSubset = 0;
ctxt->errNo = XML_ERR_OK;
/**
* xmlErrMemory:
* @ctxt: an XML parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
* xmlErrInternal:
* @ctxt: an XML parser context
* @msg: the error message
- * @str: error informations
+ * @str: error information
*
* Handle an internal error
*/
} else
/* 1-byte code */
ctxt->input->cur++;
-
- ctxt->nbChars++;
} else {
/*
* Assume it's a fixed length encoding (1) with
} else
ctxt->input->col++;
ctxt->input->cur++;
- ctxt->nbChars++;
}
if (*ctxt->input->cur == 0)
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
}
if (*ctxt->input->cur == 0xD) {
if (ctxt->input->cur[1] == 0xA) {
- ctxt->nbChars++;
ctxt->input->cur++;
}
return(0xA);
*len = 1;
if (*ctxt->input->cur == 0xD) {
if (ctxt->input->cur[1] == 0xA) {
- ctxt->nbChars++;
ctxt->input->cur++;
}
return(0xA);
* Note: this is a bit dangerous, but that's what it
* takes to use nearly compatible signature for different
* encodings.
+ *
+ * FIXME: Encoders might buffer partial byte sequences, so
+ * this probably can't work. We should return an error and
+ * make sure that callers never try to switch the encoding
+ * twice.
*/
xmlCharEncCloseFunc(input->buf->encoder);
input->buf->encoder = handler;
ctxt->options |= XML_PARSE_NOENT;
}
ctxt->record_info = 0;
- ctxt->nbChars = 0;
ctxt->checkIndex = 0;
ctxt->inSubset = 0;
ctxt->errNo = XML_ERR_OK;
/************************************************************************
* *
- * Handling of node informations *
+ * Handling of node information *
* *
************************************************************************/
format_args = format_args + ", &%s" % (arg[0])
if f == 's#':
format_args = format_args + ", &py_buffsize%d" % num_bufs
- c_args = c_args + " int py_buffsize%d;\n" % num_bufs
+ c_args = c_args + " Py_ssize_t py_buffsize%d;\n" % num_bufs
num_bufs = num_bufs + 1
if c_call != "":
c_call = c_call + ", "
export.write("/* Generated */\n\n")
wrapper = open("libxml2-py.c", "w")
wrapper.write("/* Generated */\n\n")
+ wrapper.write("#define PY_SSIZE_T_CLEAN\n")
wrapper.write("#include <Python.h>\n")
wrapper.write("#include <libxml/xmlversion.h>\n")
wrapper.write("#include <libxml/tree.h>\n")
*
* daniel@veillard.com
*/
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <fileobject.h>
/* #include "config.h" */
lenread = PyBytes_Size(ret);
data = PyBytes_AsString(ret);
#ifdef PyUnicode_Check
- } else if PyUnicode_Check (ret) {
+ } else if (PyUnicode_Check (ret)) {
#if PY_VERSION_HEX >= 0x03030000
Py_ssize_t size;
const char *tmp;
lenread = PyBytes_Size(ret);
data = PyBytes_AsString(ret);
#ifdef PyUnicode_Check
- } else if PyUnicode_Check (ret) {
+ } else if (PyUnicode_Check (ret)) {
#if PY_VERSION_HEX >= 0x03030000
Py_ssize_t size;
const char *tmp;
if (type != 0) {
if (type == 1)
result = PyObject_CallMethod(handler, (char *) "characters",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
else if (type == 2)
result = PyObject_CallMethod(handler, (char *) "data",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
if (PyErr_Occurred())
PyErr_Print();
Py_XDECREF(result);
result =
PyObject_CallMethod(handler,
(char *) "ignorableWhitespace",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
else if (type == 2)
result =
PyObject_CallMethod(handler, (char *) "data",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
Py_XDECREF(result);
}
}
if (type == 1)
result =
PyObject_CallMethod(handler, (char *) "cdataBlock",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
else if (type == 2)
result =
PyObject_CallMethod(handler, (char *) "cdata",
- (char *) "s#", ch, len);
+ (char *) "s#", ch, (Py_ssize_t)len);
if (PyErr_Occurred())
PyErr_Print();
Py_XDECREF(result);
last = property(get_last, None, None, "Last sibling node")
next = property(get_next, None, None, "Next sibling node")
prev = property(get_prev, None, None, "Previous sibling node")
- properties = property(get_properties, None, None, "List of properies")
+ properties = property(get_properties, None, None, "List of properties")
content = property(get_content, None, None, "Content of this node")
name = property(get_name, None, None, "Node name")
type = property(get_type, None, None, "Node type")
<info>Create a libxml2 output buffer from a Python file</info>
<return type='xmlOutputBufferPtr' info="the output buffer"/>
<arg name='file' type='pythonObject' info='the Python file'/>
- <arg name='encoding' type='xmlChar *' info='an optionnal encoding'/>
+ <arg name='encoding' type='xmlChar *' info='an optional encoding'/>
</function>
<function name='xmlCreateInputBuffer' file='python'>
<info>Create a libxml2 input buffer from a Python file</info>
<return type='xmlParserInputBufferPtr' info="the input buffer"/>
<arg name='file' type='pythonObject' info='the Python file'/>
- <arg name='encoding' type='xmlChar *' info='an optionnal encoding'/>
+ <arg name='encoding' type='xmlChar *' info='an optional encoding'/>
</function>
<function name='xmlSetEntityLoader' file='python'>
<info>Set the entity resolver as a python function</info>
libxml2.debugMemory(1)
expect="""--> (3) xmlns: URI foo is not absolute
---> (4) Opening and ending tag mismatch: x line 0 and y
+--> (4) Opening and ending tag mismatch: x line 1 and y
"""
err=""
ns.freeNsList()
doc.freeDoc()
-# Remove a namespace refered to by a child
+# Remove a namespace referred to by a child
doc = libxml2.newDoc("1.0")
root = doc.newChild(None, "root", None)
namespace = root.newNs("http://example.com/sample", "s")
#!/usr/bin/python -u
+# -*- coding: utf-8 -*-
#
# this tests the DTD validation with the XmlTextReader interface
#
# Memory debug specific
libxml2.debugMemory(1)
-err=""
-expect="""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version
+err = ""
+dir_prefix = "../../test/valid/"
+# This dictionary reflects the contents of the files
+# ../../test/valid/*.xml.err that are not empty, except that
+# the file paths in the messages start with ../../test/
+
+expect = {
+ '766956':
+"""../../test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';'
+%ä%ent;
+ ^
+../../test/valid/dtds/766956.dtd:2: parser error : Content error in the external subset
+%ä%ent;
+ ^
+Entity: line 1:
+value
+^
+""",
+ '781333':
+"""../../test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got
+<a/>
+ ^
+../../test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child
+
+^
+""",
+ 'cond_sect2':
+"""../../test/valid/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity
+ %ent;
+ ^
+Entity: line 1:
+]]>
+^
+../../test/valid/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset
+
+^
+""",
+ 'rss':
+"""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version
</rss>
^
-../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined
+""",
+ 't8':
+"""../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+ ^
+Entity: line 1:
+<!ELEMENT root (middle) >
+^
+../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+ ^
+Entity: line 1:
+<!ELEMENT middle (test) >
+^
+../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+ ^
+Entity: line 1:
+<!ELEMENT test (#PCDATA) >
+^
+""",
+ 't8a':
+"""../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+ ^
+Entity: line 1:
+<!ELEMENT root (middle) >
+^
+../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+ ^
+Entity: line 1:
+<!ELEMENT middle (test) >
+^
+../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+ ^
+Entity: line 1:
+<!ELEMENT test (#PCDATA) >
+^
+""",
+ 'xlink':
+"""../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined
<p><termdef id="dt-arc" term="Arc">An <ter
^
-../../test/valid/xlink.xml:530: validity error : attribute def line 199 references an unknown ID "dt-xlg"
+validity error : attribute def line 199 references an unknown ID "dt-xlg"
+""",
+}
+
+# Add prefix_dir and extension to the keys
+expect = {"{}{}.xml".format(dir_prefix, key): val for key, val in expect.items()}
-^
-"""
def callback(ctx, str):
global err
err = err + "%s" % (str)
libxml2.registerErrorHandler(callback, "")
-valid_files = glob.glob("../../test/valid/*.x*")
+parsing_error_files = ["766956", "cond_sect2", "t8", "t8a"]
+expect_parsing_error = ["{}{}.xml".format(dir_prefix, f) for f in parsing_error_files]
+
+valid_files = glob.glob(dir_prefix + "*.x*")
valid_files.sort()
for file in valid_files:
- if file.find("t8") != -1:
- continue
- if file == "../../test/valid/rss.xml":
- continue
- if file == "../../test/valid/xlink.xml":
- continue
+ err = ""
reader = libxml2.newTextReaderFilename(file)
#print "%s:" % (file)
reader.SetParserProp(libxml2.PARSER_VALIDATE, 1)
ret = reader.Read()
while ret == 1:
ret = reader.Read()
- if ret != 0:
+ if ret != 0 and file not in expect_parsing_error:
print("Error parsing and validating %s" % (file))
- #sys.exit(1)
-
-if err != expect:
- print(err)
-
+ #sys.exit(1)
+ if (err):
+ if not(file in expect and err == expect[file]):
+ print("Error: ", err)
+ if file in expect:
+ print("Expected: ", expect[file])
#
# another separate test based on Stephane Bidoul one
#
when the exception is raised, check the libxml2.lastError for
expected values."""
# disable the default error handler
- libxml2.registerErrorHandler(None,None)
+ def noerr(ctx, str):
+ pass
+ # None is not acceptable as function.
+ libxml2.registerErrorHandler(noerr,None)
try:
f(*args)
except exc:
print("file =",e.file())
print("line =",e.line())
print()
- self.failUnlessEqual(domain,e.domain())
- self.failUnlessEqual(code,e.code())
- self.failUnlessEqual(message,e.message())
- self.failUnlessEqual(level,e.level())
- self.failUnlessEqual(file,e.file())
- self.failUnlessEqual(line,e.line())
+ self.assertEqual(domain,e.domain())
+ self.assertEqual(code,e.code())
+ self.assertEqual(message,e.message())
+ self.assertEqual(level,e.level())
+ self.assertEqual(file,e.file())
+ self.assertEqual(line,e.line())
else:
self.fail("exception %s should have been raised" % exc)
(s,len(s),"dummy.xml",None,0),
libxml2.treeError,
domain=libxml2.XML_FROM_PARSER,
- code=libxml2.XML_ERR_LTSLASH_REQUIRED,
- message='EndTag: \'</\' not found\n',
+ code=libxml2.XML_ERR_TAG_NOT_FINISHED,
+ message='Premature end of data in tag x line 1\n',
level=libxml2.XML_ERR_FATAL,
file='dummy.xml',
line=3)
sys.exit(1)
i = i - 1
-#desactivate error messages from the validation
+#deactivate error messages from the validation
def noerr(ctx, str):
pass
if (obj == NULL) {
return (NULL);
}
- if PyFloat_Check (obj) {
+ if (PyFloat_Check (obj)) {
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
- } else if PyLong_Check(obj) {
+ } else if (PyLong_Check(obj)) {
#ifdef PyLong_AS_LONG
ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
#else
ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
#endif
#ifdef PyBool_Check
- } else if PyBool_Check (obj) {
+ } else if (PyBool_Check (obj)) {
if (obj == Py_True) {
ret = xmlXPathNewBoolean(1);
ret = xmlXPathNewBoolean(0);
}
#endif
- } else if PyBytes_Check (obj) {
+ } else if (PyBytes_Check (obj)) {
xmlChar *str;
str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
PyBytes_GET_SIZE(obj));
ret = xmlXPathWrapString(str);
#ifdef PyUnicode_Check
- } else if PyUnicode_Check (obj) {
+ } else if (PyUnicode_Check (obj)) {
#if PY_VERSION_HEX >= 0x03030000
xmlChar *str;
const char *tmp;
ret = xmlXPathWrapString(str);
#endif
#endif
- } else if PyList_Check (obj) {
+ } else if (PyList_Check (obj)) {
int i;
PyObject *node;
xmlNodePtr cur;
/**
* xmlRngPErrMemory:
* @ctxt: an Relax-NG parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
/**
* xmlRngVErrMemory:
* @ctxt: a Relax-NG validation context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
* @ctxt: a RelaxNG parser context
* @flags: a set of flags values
*
- * Semi private function used to pass informations to a parser context
+ * Semi private function used to pass information to a parser context
* which are a combination of xmlRelaxNGParserFlag .
*
* Returns 0 if success and -1 in case of error
@ @inputdata: callback data, the Relax NG validation context
*
* Handle the callback and if needed validate the element children.
- * some of the in/out informations are passed via the context in @inputdata.
+ * some of the in/out information are passed via the context in @inputdata.
*/
static void
xmlRelaxNGValidateProgressiveCallback(xmlRegExecCtxtPtr exec
* @warn: the warning function
* @ctx: the functions context
*
- * Set the error and warning callback informations
+ * Set the error and warning callback information
*/
void
xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
* @warn: the warning function result
* @ctx: the functions context result
*
- * Get the error and warning callback informations
+ * Get the error and warning callback information
*
* Returns -1 in case of error and 0 otherwise
*/
-<!DOCTYPE >
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
-./test/HTML/758606.html:1: HTML parser error : Comment not terminated
-<!--
+./test/HTML/758606.html:1: HTML parser error : Invalid char in comment 0xC
<!--\f<!doctype
- ^
-./test/HTML/758606.html:1: HTML parser error : Invalid char in CDATA 0xC
-<!--\f<!doctype
- ^
-./test/HTML/758606.html:1: HTML parser error : Misplaced DOCTYPE declaration
-<!--\f<!doctype
- ^
-./test/HTML/758606.html:2: HTML parser error : htmlParseDocTypeDecl : no DOCTYPE name !
-
-^
-./test/HTML/758606.html:2: HTML parser error : DOCTYPE improperly terminated
+ ^
+./test/HTML/758606.html:2: HTML parser error : Comment not terminated
+<!--<!doctyp
^
SAX.setDocumentLocator()
SAX.startDocument()
+SAX.error: Invalid char in comment 0xC
SAX.error: Comment not terminated
-<!--
-SAX.error: Invalid char in CDATA 0xC
-SAX.error: Misplaced DOCTYPE declaration
-SAX.error: htmlParseDocTypeDecl : no DOCTYPE name !
-SAX.error: DOCTYPE improperly terminated
-SAX.internalSubset((null), , )
+<!--<!doctyp
SAX.endDocument()
-<!DOCTYPE >
-<html><body><p>‘</p></body></html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+
-./test/HTML/758606_2.html:1: HTML parser error : Comment not terminated
-<!--
-<!--\f\91<!dOctYPE
- ^
-./test/HTML/758606_2.html:1: HTML parser error : Invalid char in CDATA 0xC
-<!--\f\91<!dOctYPE
- ^
-./test/HTML/758606_2.html:1: HTML parser error : Misplaced DOCTYPE declaration
+./test/HTML/758606_2.html:1: HTML parser error : Invalid char in comment 0xC
\91<!dOctYPE
- ^
-./test/HTML/758606_2.html:2: HTML parser error : htmlParseDocTypeDecl : no DOCTYPE name !
-
-^
-./test/HTML/758606_2.html:2: HTML parser error : DOCTYPE improperly terminated
+ ^
+./test/HTML/758606_2.html:2: HTML parser error : Comment not terminated
+<!--\91<!dOctYP
^
SAX.setDocumentLocator()
SAX.startDocument()
+SAX.error: Invalid char in comment 0xC
SAX.error: Comment not terminated
-<!--
-SAX.error: Invalid char in CDATA 0xC
-SAX.startElement(html)
-SAX.startElement(body)
-SAX.startElement(p)
-SAX.characters(‘, 2)
-SAX.error: Misplaced DOCTYPE declaration
-SAX.error: htmlParseDocTypeDecl : no DOCTYPE name !
-SAX.error: DOCTYPE improperly terminated
-SAX.internalSubset((null), , )
-SAX.endElement(p)
-SAX.endElement(body)
-SAX.endElement(html)
+<!--\91<!dOctYP
SAX.endDocument()
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<!--
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+-->
+<body>
+<p>
+Filler bytes follow:
+
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 1000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 2000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+xxx
+</p>
+<div fill1="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" onmouseover="x<b>text</b>x" fill2="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill3="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill4="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill5="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill6="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789">
+</div>
+</body>
+</html>
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+, 1)
+SAX.comment(
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+)
+SAX.characters(
+, 1)
+SAX.startElement(body)
+SAX.characters(
+, 1)
+SAX.startElement(p)
+SAX.characters(
+Filler bytes follow:
+
+ 1, 1000)
+SAX.characters(89 123456789 123456789
+ 1, 1000)
+SAX.characters(89 123456789 123456789
+ 1, 827)
+SAX.endElement(p)
+SAX.characters(
+, 1)
+SAX.startElement(div, fill1='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', onmouseover='x<b>text</b>x', fill2='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill3='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill4='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill5='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill6='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789')
+SAX.characters(
+, 1)
+SAX.endElement(div)
+SAX.characters(
+, 1)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+ <body>
+ <div>
+ <h3>
+ <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+ Incorrectly closed comment
+ </a>
+ </h3>
+ <div>
+ <!--incorrectly closed comment--><span id="under-test">whatwg guidance is that this should be a DOM node</span><!--correctly closed comment-->
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+./test/HTML/comments.html:10: HTML parser error : Comment incorrectly closed by '--!>'
+ <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is
+ ^
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+ , 3)
+SAX.startElement(body)
+SAX.characters(
+ , 5)
+SAX.startElement(div)
+SAX.characters(
+ , 7)
+SAX.startElement(h3)
+SAX.characters(
+ , 9)
+SAX.startElement(a, href='https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment')
+SAX.characters(
+ Incorrectly closed , 46)
+SAX.endElement(a)
+SAX.characters(
+ , 7)
+SAX.endElement(h3)
+SAX.characters(
+ , 7)
+SAX.startElement(div)
+SAX.characters(
+ , 9)
+SAX.error: Comment incorrectly closed by '--!>'SAX.comment(incorrectly closed comment)
+SAX.startElement(span, id='under-test')
+SAX.characters(whatwg guidance is that this s, 49)
+SAX.endElement(span)
+SAX.comment(correctly closed comment)
+SAX.characters(
+ , 7)
+SAX.endElement(div)
+SAX.characters(
+ , 5)
+SAX.endElement(div)
+SAX.characters(
+ , 3)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+ <body>
+ <div>
+ <h3>
+ <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+ Incorrectly closed comment without a correctly closed comment
+ </a>
+ </h3>
+ <div>
+ <!--incorrectly closed comment--><span id="under-test">whatwg guidance is that this should be a DOM node</span>
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+./test/HTML/comments2.html:10: HTML parser error : Comment incorrectly closed by '--!>'
+ <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is
+ ^
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+ , 3)
+SAX.startElement(body)
+SAX.characters(
+ , 5)
+SAX.startElement(div)
+SAX.characters(
+ , 7)
+SAX.startElement(h3)
+SAX.characters(
+ , 9)
+SAX.startElement(a, href='https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment')
+SAX.characters(
+ Incorrectly closed , 81)
+SAX.endElement(a)
+SAX.characters(
+ , 7)
+SAX.endElement(h3)
+SAX.characters(
+ , 7)
+SAX.startElement(div)
+SAX.characters(
+ , 9)
+SAX.error: Comment incorrectly closed by '--!>'SAX.comment(incorrectly closed comment)
+SAX.startElement(span, id='under-test')
+SAX.characters(whatwg guidance is that this s, 49)
+SAX.endElement(span)
+SAX.characters(
+ , 7)
+SAX.endElement(div)
+SAX.characters(
+ , 5)
+SAX.endElement(div)
+SAX.characters(
+ , 3)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
document.write("ype=js&size=100x90&url=http://www.goto.com/");\r
document.write("d/search/ssn/&target=_blank&Partner=SSN8042");\r
document.write("DF8478957377>");\r
- document.write("RIPT>");\r
} else {\r
document.write("<A TARGET=_blank ");\r
document.write("HREF=http://www.goto.com/d/search/ssn/?from");\r
./test/HTML/doc3.htm:803: HTML parser error : End tag : expected '>'
document.write("DF8478957377></SC");
^
-./test/HTML/doc3.htm:803: HTML parser error : Unexpected end tag : sc
- document.write("DF8478957377></SC");
- ^
+./test/HTML/doc3.htm:804: HTML parser error : Unexpected end tag : sc
+ document.write("RIPT>");
+ ^
./test/HTML/doc3.htm:811: HTML parser error : Unexpected end tag : a
document.write("ype=gif&size=100x90></A>");
^
SAX.error: End tag : expected '>'
SAX.error: Unexpected end tag : sc
SAX.cdata(");\r
- document.write("RI, 361)
+ } else {\r
+ d, 328)
SAX.error: Unexpected end tag : a
SAX.cdata(");\r
}\r
<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/school/0,1383,,00.html">Making the Grade</a></b></font><br><font size="2" face="Arial, Helvetica, sans-serif"><font size="1" face="Arial, Geneva, sans-serif" color="#000000">Reading, writing, and ROM. <br><i>Sponsored by <a href="http://r.hotwired.com/r/wn_sch_r_nav_uop/http://ads25.focalink.com/SmartBanner/page?12630.53" style="text-decoration:none"><font color="#000000">U of Phoenix</font></a></i></font><br><br>
-<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/infostructure/0,1377,,00.html">Infostructure</a></b></font><br><font size="1" face="Arial, Helvetica, sans-serif" color="#000000">An IS/IT resource <br><i>Sponsored by <a href="http://r.wired.com/r/wn_is_r_ssec/http://ad.doubleclick.net/clk;653163;3599571;s?http://www.sprintbiz.com/s%0Aervlet/appservlet?from=/wired/sprint/&template=/security/security.html&SITE=%0Awired.com&BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</font></a></i></font></font><br><br>
+<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/infostructure/0,1377,,00.html">Infostructure</a></b></font><br><font size="1" face="Arial, Helvetica, sans-serif" color="#000000">An IS/IT resource <br><i>Sponsored by <a href="http://r.wired.com/r/wn_is_r_ssec/http://ad.doubleclick.net/clk;653163;3599571;s?http://www.sprintbiz.com/s%0Aervlet/appservlet?from=/wired/sprint/&template=/security/security.html&SITE=%0Awired.com&BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</font></a></i></font><br><br>
<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/y2k/0,1360,,00.html">Y2K Watch</a></b></font><br><font size="2" face="Arial, Helvetica, sans-serif"><font size="1" face="Arial, Geneva, sans-serif" color="#000000">Tick... Tick... Tick...</font><br><br>
<font face="Arial, Helvetica, sans-serif" size="2"><b><i><a href="/news/special_reports/1,1293,,00.html">More Hoo-Ha</a></i></b></font><br> <br>
-</font></font></font></font></font></font></font></font>
+</font></font></font></font></font></font></font></font></font>
</td>
</tr>
<!-- start of Gen News -->
./test/HTML/wired.html:414: HTML parser error : Opening and ending tag mismatch: td and font
</td>
^
+./test/HTML/wired.html:414: HTML parser error : Opening and ending tag mismatch: td and font
+</td>
+ ^
./test/HTML/wired.html:432: HTML parser error : htmlParseEntityRef: expecting ';'
href="http://www.lycos.com/news/flash/hitlerbunker.html?v=wn1015&lpv=1">Lycos</a
^
SAX.endElement(i)
SAX.error: End tag : expected '>'
SAX.endElement(font)
-SAX.endElement(font)
SAX.startElement(br)
SAX.endElement(br)
SAX.startElement(br)
SAX.endElement(font)
SAX.error: Opening and ending tag mismatch: td and font
SAX.endElement(font)
+SAX.error: Opening and ending tag mismatch: td and font
+SAX.endElement(font)
SAX.endElement(td)
SAX.characters(
, 1)
--- /dev/null
+<?xml version="1.0"?>
+<a>
+ <doc xml:base="../ents/something.xml">
+<p>something</p>
+<p>really</p>
+<p>simple</p>
+</doc>
+</a>
--- /dev/null
+0 1 a 0 0
+1 14 #text 0 1
+
+1 1 doc 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 something
+2 15 p 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 really
+2 15 p 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 simple
+2 15 p 0 0
+2 14 #text 0 1
+
+1 15 doc 0 0
+1 14 #text 0 1
+
+0 15 a 0 0
--- /dev/null
+<?xml version="1.0"?>
+<a>
+
+ <doc xml:base="../ents/something.xml">
+<p>something</p>
+<p>really</p>
+<p>simple</p>
+</doc>
+
+</a>
--- /dev/null
+0 1 a 0 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 doc 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 something
+2 15 p 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 really
+2 15 p 0 0
+2 14 #text 0 1
+
+2 1 p 0 0
+3 3 #text 0 1 simple
+2 15 p 0 0
+2 14 #text 0 1
+
+1 15 doc 0 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+0 15 a 0 0
--- /dev/null
+<?xml version="1.0"?>
+<a>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+ <elem/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</a>
--- /dev/null
+0 1 a 0 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+0 15 a 0 0
--- /dev/null
+<?xml version="1.0"?>
--- /dev/null
+<?xml version="1.0"?>
+<doc xmlns:xi="http://www.w3.org/2001/XInclude">
+ <ns:elem xmlns:ns="urn:foo" xml:id="a"/>
+ <elem xmlns:ns="urn:foo">
+ <ns:elem xml:id="a"/>
+ </elem>
+
+ <ns:elem xmlns:ns="urn:bar"/>
+
+</doc>
--- /dev/null
+0 1 doc 0 0
+1 14 #text 0 1
+
+1 1 ns:elem 1 0
+1 14 #text 0 1
+
+1 1 elem 0 0
+2 14 #text 0 1
+
+2 1 ns:elem 1 0
+2 14 #text 0 1
+
+1 15 elem 0 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+1 1 ns:elem 1 0
+1 14 #text 0 1
+
+1 14 #text 0 1
+
+0 15 doc 0 0
1 1 test 1 0
1 14 #text 0 1
-1 1 test 0 0
-1 15 test 0 0
+1 1 test 1 0
1 14 #text 0 1
0 15 x 0 0
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY lt "&#x3c;">
+<!ENTITY gt "&#x3E;">
+<!ENTITY amp "&#x26;">
+<!ENTITY apos "&#x27;">
+<!ENTITY quot "&#x22;">
+]>
+<doc/>
--- /dev/null
+0 10 doc 0 0
+0 1 doc 1 0
--- /dev/null
+0 10 doc 0 0
+0 1 doc 1 0
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), <)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), >)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), ')
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), ")
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElement(doc)
+SAX.endElement(doc)
+SAX.endDocument()
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), <)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), >)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), ')
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), ")
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElementNs(doc, NULL, NULL, 0, 0, 0)
+SAX.endElementNs(doc, NULL, NULL)
+SAX.endDocument()
2 1 c 0 0
2 15 c 0 0
2 3 #text 0 1 ,
-2 1 d 0 0
-2 15 d 0 0
+2 1 d 1 0
1 15 ent 0 0
1 14 #text 0 1
2 1 c 0 0
2 15 c 0 0
2 3 #text 0 1 ,
-2 1 d 0 0
-2 15 d 0 0
+2 1 d 1 0
1 15 ent 0 0
1 14 #text 0 1
--- /dev/null
+./test/errors/754946.xml:3: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+ %SYSTEM;
+ ^
+Entity: line 1:
+A<lbbbbbbbbbbbbbbbbbbb_
+^
+./test/errors/754946.xml:4: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+ <![
+ ^
+./test/errors/754946.xml:4: parser error : DOCTYPE improperly terminated
+ <![
+ ^
+./test/errors/754946.xml:4: parser error : StartTag: invalid element name
+ <![
+ ^
+./test/errors/754946.xml:4: parser error : Extra content at the end of the document
+ <![
+ ^
--- /dev/null
+./test/errors/754947.xml:1: parser error : Input is not proper UTF-8, indicate encoding !
+Bytes: 0xEE 0x5D 0x5D 0x3E
+<d><![CDATA[0000000000000î]]>
+ ^
+./test/errors/754947.xml:1: parser error : Premature end of data in tag d line 1
+<d><![CDATA[0000000000000î]]>
+ ^
Bytes: 0xEE 0x5D 0x5D 0x3E
<d><![CDATA[0000000000000î]]>
^
-./test/errors/754947.xml:1: parser error : EndTag: '</' not found
+./test/errors/754947.xml:1: parser error : Premature end of data in tag d line 1
<d><![CDATA[0000000000000î]]>
^
--- /dev/null
+./test/errors/758588.xml:1: namespace error : Namespace prefix a-340282366920938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867261d on a is not defined
+63472597946867209384634725979468672093846347259794686720938463472597946867261d:a
+ ^
+./test/errors/758588.xml:1: parser error : expected '>'
+2597946867209384634725979468672093846347259794686720938463472597946867261d:a></a
+ ^
+./test/errors/758588.xml:1: parser error : Opening and ending tag mismatch: a line 1 and a
+2597946867209384634725979468672093846347259794686720938463472597946867261d:a></a
+ ^
--- /dev/null
+./test/errors/759020.xml:3: namespace warning : xmlns: URI 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is not absolute
+0000000000000000000000000000000000000000000000000000000000000000000000000000000'
+ ^
+./test/errors/759020.xml:46: parser error : Couldn't find end of Start Tag s00 line 2
+
+ ^
--- /dev/null
+./test/errors/759398.xml:210: parser error : StartTag: invalid element name
+need to worry about parsers whi<! don't expand PErefs finding
+ ^
+./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 308 and termdef
+and provide access to their content and structure.</termdef> <termdef
+ ^
+./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 50 and p
+data and the information it must provide to the application.</p>
+ ^
+./test/errors/759398.xml:316: parser error : Extra content at the end of the document
+<div2 id='sec-origin-goals'>
+^
./test/errors/759398.xml:210: parser error : StartTag: invalid element name
need to worry about parsers whi<! don't expand PErefs finding
^
-./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 205 and termdef
+./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 308 and termdef
and provide access to their content and structure.</termdef> <termdef
^
-./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 205 and p
+./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 50 and p
data and the information it must provide to the application.</p>
^
./test/errors/759398.xml:316: parser error : Extra content at the end of the document
./test/errors/759398.xml:210: parser error : internal error: detected an error in element content
-need to worry about parsers whi<! don't expand
+need to worry about parsers whi<! don't expand PErefs finding
^
./test/errors/759398.xml : failed to parse
--- /dev/null
+Entity: line 1: parser error : Space required after '<!ENTITY'
+%zz;
+ ^
+Entity: line 1:
+<!ENTITY<?xDOCTYPEm~?>
+ ^
+Entity: line 1: parser error : xmlParseEntityDecl: no name
+%zz;
+ ^
+Entity: line 1:
+<!ENTITY<?xDOCTYPEm~?>
+ ^
+Entity: line 1: parser error : ParsePI: PI xDOCTYPEm space expected
+%zz;
+ ^
+Entity: line 1:
+<!ENTITY<?xDOCTYPEm~?>
+ ^
+./test/errors/759573-2.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%xx;\ 3ÿggKENSMYNT#MENTDŴzz;'>
+ ^
+Entity: line 2:
+<![INCLUDE[
+^
+./test/errors/759573-2.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%xx;\ 3ÿggKENSMYNT#MENTDŴzz;'>
+ ^
+./test/errors/759573-2.xml:6: parser error : DOCTYPE improperly terminated
+%xx;\ 3ÿggKENSMYNT#MENTDŴzz;'>
+ ^
+./test/errors/759573-2.xml:6: parser error : Start tag expected, '<' not found
+%xx;\ 3ÿggKENSMYNT#MENTDŴzz;'>
+ ^
--- /dev/null
+./test/errors/759573.xml:1: parser error : Space required after '<!ENTITY'
+ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITY
+ ^
+./test/errors/759573.xml:1: parser error : Space required after the entity name
+LEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz
+ ^
+./test/errors/759573.xml:1: parser error : Entity value required
+LEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz
+ ^
+./test/errors/759573.xml:1: parser error : PEReference: no name
+T t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz>%xx;
+ ^
+Entity: line 1:
+%<![INCLUDE[000%ஸ000%z;
+ ^
+./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+T t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz>%xx;
+ ^
+Entity: line 1:
+%<![INCLUDE[000%ஸ000%z;
+ ^
+./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+T t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz>%xx;
+ ^
+./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
+T t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz>%xx;
+ ^
+./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
+T t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ000%z;'><!ENTITYz>%xx;
+ ^
--- /dev/null
+Entity: line 2: parser error : Detected an entity reference loop
+ %z; %z; %z; %z; %z;
+ ^
+Entity: line 2:
+ %z; %z; %z; %z; %z;
+ ^
--- /dev/null
+./test/errors/attr1.xml:2: parser error : AttValue: ' expected
+
+^
+./test/errors/attr1.xml:2: parser error : attributes construct error
+
+^
+./test/errors/attr1.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
--- /dev/null
+./test/errors/attr2.xml:2: parser error : AttValue: ' expected
+
+^
+./test/errors/attr2.xml:2: parser error : attributes construct error
+
+^
+./test/errors/attr2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
--- /dev/null
+./test/errors/attr3.xml:4: validity warning : Attribute a1 of element doc: already defined
+<!ATTLIST doc a1 CDATA "z1">
+ ^
--- /dev/null
+./test/errors/attr4.xml:1: parser error : invalid character in attribute value
+<ROOT attr="XY\16"/>
+ ^
+./test/errors/attr4.xml:1: parser error : attributes construct error
+<ROOT attr="XY\16"/>
+ ^
+./test/errors/attr4.xml:1: parser error : Couldn't find end of Start Tag ROOT line 1
+<ROOT attr="XY\16"/>
+ ^
+./test/errors/attr4.xml:1: parser error : Extra content at the end of the document
+<ROOT attr="XY\16"/>
+ ^
--- /dev/null
+./test/errors/cdata.xml:2: parser error : Input is not proper UTF-8, indicate encoding !
+Bytes: 0xE1 0x72 0x5D 0x5D
+<A><![CDATA[Cár]]></A>
+ ^
--- /dev/null
+./test/errors/charref1.xml:1: parser error : xmlParseCharRef: character reference out of bounds
+<bla>�</bla>
+ ^
--- /dev/null
+./test/errors/comment1.xml:5: parser error : xmlParseComment: invalid xmlChar value 14
+ in p02: \ e -->
+ ^
+./test/errors/comment1.xml:5: parser error : Start tag expected, '<' not found
+ in p02: \ e -->
+ ^
--- /dev/null
+./test/errors/content1.xml:7: parser error : ContentDecl : ',' '|' or ')' expected
+<!ELEMENT aElement (a |b * >
+ ^
+./test/errors/content1.xml:7: parser error : expected '>'
+<!ELEMENT aElement (a |b * >
+ ^
+./test/errors/content1.xml:7: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+<!ELEMENT aElement (a |b * >
+ ^
+./test/errors/content1.xml:7: parser error : DOCTYPE improperly terminated
+<!ELEMENT aElement (a |b * >
+ ^
+./test/errors/content1.xml:7: parser error : Start tag expected, '<' not found
+<!ELEMENT aElement (a |b * >
+ ^
--- /dev/null
+I/O warning : failed to load external entity "/etc/doesnotexist"
--- /dev/null
+./test/errors/name.xml:2: parser error : Couldn't find end of Start Tag foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo line 1
+
+^
--- /dev/null
+./test/errors/name2.xml:2: parser error : Specification mandates value for attribute foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+
+^
+./test/errors/name2.xml:2: parser error : attributes construct error
+
+^
+./test/errors/name2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "rec_ext.ent">
+]>
+<doc>&e; &e; &e; &e;</doc>
--- /dev/null
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+ ^
+./test/errors/rec_ext_ent.xml:4: parser error : Detected an entity reference loop
+<doc>&e; &e; &e; &e;</doc>
+ ^
SAX.endElementNs(title, NULL, NULL)
SAX.characters(
, 1)
-SAX.ignorableWhitespace(
-, 1)
-SAX.startElementNs(title, NULL, NULL, 0, 0, 0)
-SAX.characters(my title, 8)
-SAX.endElementNs(title, NULL, NULL)
-SAX.characters(
-, 1)
SAX.characters(
This text is about XML, the, 31)
SAX.getEntity(xml)
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY lt "&#x3c;">
+<!ENTITY gt "&#x3E;">
+<!ENTITY amp "&#x26;">
+<!ENTITY apos "&#x27;">
+<!ENTITY quot "&#x22;">
+]>
+<doc/>
--- /dev/null
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), <)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), >)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), ')
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), ")
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElementNs(doc, NULL, NULL, 0, 0, 0)
+SAX.endElementNs(doc, NULL, NULL)
+SAX.endDocument()
--- /dev/null
+Regexp: [;^((-
+ failed to compile
--- /dev/null
+regexp error : failed to compile: Expecting the end of a char range
+regexp error : failed to compile: xmlFAParseCharClass: ']' expected
--- /dev/null
+Regexp: .{2147483647}
+input: Fail
+Regexp: .{2147483648}
+ failed to compile
--- /dev/null
+regexp error : failed to compile: Improper quantifier
<!ENTITY draft.month "February">
<!ENTITY draft.year "1998">
<!ENTITY WebSGML "WebSGML Adaptations Annex to ISO 8879">
-<!ENTITY lt "<">
+<!ENTITY lt "&#60;">
<!ENTITY gt ">">
<!ENTITY xmlpio "'<?xml'">
<!ENTITY pic "'?>'">
};
static int update_results = 0;
+static char* temp_directory = NULL;
static int checkTestFile(const char *filename);
#if defined(_WIN32) && !defined(__CYGWIN__)
char *temp;
nb_tests++;
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "out of memory\n");
fatalError();
#endif
if (doc == NULL)
return(1);
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "out of memory\n");
fatalError();
doc = xmlReadFile(filename, NULL, options);
if (doc == NULL)
return(1);
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
xmlDocDumpMemory(doc, (xmlChar **) &base, &size);
}
res = compareFileMem(result, base, size);
- if (res != 0) {
- fprintf(stderr, "Result for %s failed in %s\n", filename, result);
- return(-1);
- }
}
if (doc != NULL) {
if (base != NULL)
xmlFree((char *)base);
xmlFreeDoc(doc);
}
+ if (res != 0) {
+ fprintf(stderr, "Result for %s failed in %s\n", filename, result);
+ return(-1);
+ }
if (err != NULL) {
res = compareFileMem(err, testErrors, testErrorsSize);
if (res != 0) {
nb_tests++;
if (result != NULL) {
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
int len, ret = 0;
char *temp;
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
return(-1);
}
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
char str[1024];
int res = 0, i, ret;
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
return(-1);
}
- temp = resultFilename(result, "", ".res");
+ temp = resultFilename(result, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
return(-1);
}
- temp = resultFilename(result, "", ".res");
+ temp = resultFilename(result, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
fprintf(stderr, "Failed to open %s\n", filename);
return(-1);
}
- temp = resultFilename(filename, "", ".res");
+ temp = resultFilename(filename, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
{ "Error cases regression tests",
errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err",
0 },
+ { "Error cases regression tests with entity substitution",
+ errParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".ent",
+ XML_PARSE_NOENT },
{ "Error cases regression tests (old 1.0)",
errParseTest, "./test/errors10/*.xml", "result/errors10/", "", ".err",
XML_PARSE_OLD10 },
update_results = 1;
else if (!strcmp(argv[a], "-quiet"))
tests_quiet = 1;
+ else if (!strcmp(argv[a], "--out"))
+ temp_directory = argv[++a];
else {
for (i = 0; testDescriptions[i].func != NULL; i++) {
if (strstr(testDescriptions[i].desc, argv[a])) {
fprintf(stderr, " you need to fetch and extract the\n");
fprintf(stderr, " latest XML Conformance Test Suites\n");
fprintf(stderr, " http://www.w3.org/XML/Test/xmlts20080827.tar.gz\n");
- fprintf(stderr, " see http://www.w3.org/XML/Test/ for informations\n");
+ fprintf(stderr, " see http://www.w3.org/XML/Test/ for information\n");
}
static int
/**
* xmlSchematronPErrMemory:
* @node: a context node
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
/**
* xmlSchematronVTypeErrMemory:
* @node: a context node
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
--- /dev/null
+<html>
+<!--
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+-->
+<body>
+<p>
+Filler bytes follow:
+
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 1000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 2000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+ 800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+xxx
+</p>
+<div
+ fill1="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ onmouseover="x<b>text</b>x"
+ fill2="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ fill3="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ fill4="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ fill5="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ fill6="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+>
+</div>
+</body>
+</html>
--- /dev/null
+<html>
+ <body>
+ <div>
+ <h3>
+ <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+ Incorrectly closed comment
+ </a>
+ </h3>
+ <div>
+ <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is that this should be a DOM node</span><!--correctly closed comment-->
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+<html>
+ <body>
+ <div>
+ <h3>
+ <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+ Incorrectly closed comment without a correctly closed comment
+ </a>
+ </h3>
+ <div>
+ <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is that this should be a DOM node</span>
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+<a>
+ <xi:include href="../ents/something.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback>
+ <xi:include href="c.xml">
+ <xi:fallback>There is no c.xml ... </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+</a>
--- /dev/null
+<a>
+ <xi:include href="c.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback>
+ <xi:include href="../ents/something.xml"/>
+ </xi:fallback>
+ </xi:include>
+</a>
--- /dev/null
+<a>
+ <xi:include href="a01.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a02.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a03.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a04.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a05.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a06.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a07.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a08.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a09.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a10.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a11.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a12.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a13.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a14.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a15.xml">
+ <xi:fallback>
+ <elem/>
+ <xi:include href="a16.xml">
+ <xi:fallback>
+ <elem/>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
+ </xi:include>
+</a>
+
--- /dev/null
+<?xml version="1.0"?>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="b.xml">
+ <xi:fallback><xi:include href="c.xml">
+ <xi:fallback/>
+ </xi:include></xi:fallback>
+</xi:include>
--- /dev/null
+<?xml version="1.0"?>
+<doc xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="#a"/>
+ <elem xmlns:ns="urn:foo">
+ <ns:elem xml:id="a"/>
+ </elem>
+ <xi:include href="b.xml">
+ <xi:fallback xmlns:ns="urn:bar">
+ <ns:elem/>
+ </xi:fallback>
+ </xi:include>
+</doc>
--- /dev/null
+<!DOCTYPE doc [
+<!ENTITY lt "&#x3c;">
+<!ENTITY gt "&#x3E;">
+<!ENTITY amp "&#x26;">
+<!ENTITY apos "&#x27;">
+<!ENTITY quot "&#x22;">
+]>
+<doc/>
<!ENTITY WebSGML
'WebSGML Adaptations Annex to ISO 8879'>
-<!ENTITY lt "<">
+<!ENTITY lt "&#60;">
<!ENTITY gt ">">
<!ENTITY xmlpio "'<?xml'">
<!ENTITY pic "'?>'">
--- /dev/null
+<ent>&e; &e; &e; &e;</ent>
--- /dev/null
+<!DOCTYPE doc [
+ <!ENTITY e SYSTEM "rec_ext.ent">
+]>
+<doc>&e; &e; &e; &e;</doc>
--- /dev/null
+# This assumes 32-bit ints.
+=>.{2147483647}
+input
+=>.{2147483648}
<!ENTITY WebSGML
'WebSGML Adaptations Annex to ISO 8879'>
-<!ENTITY lt "<">
+<!ENTITY lt "&#60;">
<!ENTITY gt ">">
<!ENTITY xmlpio "'<?xml'">
<!ENTITY pic "'?>'">
<!ENTITY WebSGML
'WebSGML Adaptations Annex to ISO 8879'>
-<!ENTITY lt "<">
+<!ENTITY lt "&#60;">
<!ENTITY gt ">">
<!ENTITY xmlpio "'<?xml'">
<!ENTITY pic "'?>'">
int n_buf;
xmlDocPtr cur; /* the document */
int n_cur;
- char * encoding; /* the encoding string */
+ char * encoding; /* the encoding string (unused) */
int n_encoding;
int format; /* should formatting spaces been added */
int n_format;
int n_buf;
xmlDocPtr cur; /* the document */
int n_cur;
- char * encoding; /* the encoding string */
+ char * encoding; /* the encoding string (unused) */
int n_encoding;
for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
int n_doc;
xmlNodePtr cur; /* the current node */
int n_cur;
- char * encoding; /* the encoding string */
+ char * encoding; /* the encoding string (unused) */
int n_encoding;
int format; /* should formatting spaces been added */
int n_format;
int n_doc;
xmlNodePtr cur; /* the current node */
int n_cur;
- char * encoding; /* the encoding string */
+ char * encoding; /* the encoding string (unused) */
int n_encoding;
for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
#ifdef LIBXML_SAX1_ENABLED
int mem_base;
int ret_val;
- xmlDocPtr doc; /* the document the chunk pertains to */
+ xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
int n_doc;
- xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+ xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
int n_sax;
void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
int n_user_data;
#ifdef LIBXML_SAX1_ENABLED
int mem_base;
int ret_val;
- xmlDocPtr doc; /* the document the chunk pertains to */
+ xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
int n_doc;
- xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+ xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
int n_sax;
void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
int n_user_data;
int ret_val;
xmlDocPtr doc; /* the document the chunk pertains to */
int n_doc;
- xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+ xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
int n_sax;
void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
int n_user_data;
int mem_base;
xmlParserCtxtPtr ctxt; /* an XML parser context */
int n_ctxt;
- char * extra; /* extra informations */
+ char * extra; /* extra information */
int n_extra;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
static int
+test_xmlPopOutputCallbacks(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_OUTPUT_ENABLED)
+ int mem_base;
+ int ret_val;
+
+ mem_base = xmlMemBlocks();
+
+ ret_val = xmlPopOutputCallbacks();
+ desret_int(ret_val);
+ call_tests++;
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlPopOutputCallbacks",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf("\n");
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
test_xmlRegisterDefaultInputCallbacks(void) {
int test_ret = 0;
test_xmlIO(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
+ if (quiet == 0) printf("Testing xmlIO : 41 of 51 functions ...\n");
test_ret += test_xmlAllocOutputBuffer();
test_ret += test_xmlAllocParserInputBuffer();
test_ret += test_xmlCheckFilename();
test_ret += test_xmlParserInputBufferPush();
test_ret += test_xmlParserInputBufferRead();
test_ret += test_xmlPopInputCallbacks();
+ test_ret += test_xmlPopOutputCallbacks();
test_ret += test_xmlRegisterDefaultInputCallbacks();
test_ret += test_xmlRegisterDefaultOutputCallbacks();
test_ret += test_xmlRegisterHTTPPostCallbacks();
long ret_val;
xmlSaveCtxtPtr ctxt; /* a document saving context */
int n_ctxt;
- xmlNodePtr node; /* the top node of the subtree to save */
- int n_node;
+ xmlNodePtr cur; /* */
+ int n_cur;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
- node = gen_xmlNodePtr(n_node, 1);
+ cur = gen_xmlNodePtr(n_cur, 1);
- ret_val = xmlSaveTree(ctxt, node);
+ ret_val = xmlSaveTree(ctxt, cur);
desret_long(ret_val);
call_tests++;
des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
- des_xmlNodePtr(n_node, node, 1);
+ des_xmlNodePtr(n_cur, cur, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlSaveTree",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
- printf(" %d", n_node);
+ printf(" %d", n_cur);
printf("\n");
}
}
}
}
#endif /* XML_PTHREAD_WEAK */
-#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
- InitializeCriticalSection(&cleanup_helpers_cs);
#endif
}
if (!run_once.done) {
if (InterlockedIncrement(&run_once.control) == 1) {
#if !defined(HAVE_COMPILER_TLS)
+#if !defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)
+ InitializeCriticalSection(&cleanup_helpers_cs);
+#endif
globalkey = TlsAlloc();
#endif
mainthread = GetCurrentThreadId();
************************************************************************/
/**
* xmlTreeErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
/**
* xmlTreeErr:
* @code: the error number
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* @str: a string
*
* Copy a string using a "dict" dictionary in the current scope,
- * if availabe.
+ * if available.
*/
#define DICT_COPY(str, cpy) \
if (str) { \
* @str: a string
*
* Copy a string using a "dict" dictionary in the current scope,
- * if availabe.
+ * if available.
*/
#define DICT_CONST_COPY(str, cpy) \
if (str) { \
xmlNodePtr ret = NULL, last = NULL;
xmlNodePtr node;
xmlChar *val;
- const xmlChar *cur = value, *end = cur + len;
+ const xmlChar *cur, *end;
const xmlChar *q;
xmlEntityPtr ent;
xmlBufPtr buf;
if (value == NULL) return(NULL);
+ cur = value;
+ end = cur + len;
buf = xmlBufCreateSize(0);
if (buf == NULL) return(NULL);
else
tmp = 0;
while (tmp != ';') { /* Non input consuming loop */
+ /*
+ * If you find an integer overflow here when fuzzing,
+ * the bug is probably elsewhere. This function should
+ * only receive entities that were already validated by
+ * the parser, typically by xmlParseAttValueComplex
+ * calling xmlStringDecodeEntities.
+ *
+ * So it's better *not* to check for overflow to
+ * potentially discover new bugs.
+ */
if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 16 + (tmp - '0');
else if ((tmp >= 'a') && (tmp <= 'f'))
else
tmp = 0;
while (tmp != ';') { /* Non input consuming loops */
+ /* Don't check for integer overflow, see above. */
if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 10 + (tmp - '0');
else {
cur += 3;
tmp = *cur;
while (tmp != ';') { /* Non input consuming loop */
+ /* Don't check for integer overflow, see above. */
if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 16 + (tmp - '0');
else if ((tmp >= 'a') && (tmp <= 'f'))
cur += 2;
tmp = *cur;
while (tmp != ';') { /* Non input consuming loops */
+ /* Don't check for integer overflow, see above. */
if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 10 + (tmp - '0');
else {
if (!xmlBufIsEmpty(buf)) {
node = xmlNewDocText(doc, NULL);
+ if (node == NULL) {
+ xmlBufFree(buf);
+ return(NULL);
+ }
node->content = xmlBufDetach(buf);
if (last == NULL) {
if (value != NULL) {
xmlNodePtr tmp;
- if(!xmlCheckUTF8(value)) {
- xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) doc,
- NULL);
- if (doc != NULL)
- doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
- }
cur->children = xmlNewDocText(doc, value);
cur->last = NULL;
tmp = cur->children;
* @value: the value of the attribute
*
* Create a new property carried by a document.
+ * NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity
+ * references, but XML special chars need to be escaped first by using
+ * xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need
+ * entities support.
+ *
* Returns a pointer to the attribute
*/
xmlAttrPtr
(cur->type != XML_XINCLUDE_START) &&
(cur->type != XML_XINCLUDE_END) &&
(cur->type != XML_ENTITY_REF_NODE) &&
+ (cur->type != XML_DOCUMENT_NODE) &&
+#ifdef LIBXML_DOCB_ENABLED
+ (cur->type != XML_DOCB_DOCUMENT_NODE) &&
+#endif
+ (cur->type != XML_HTML_DOCUMENT_NODE) &&
(cur->content != (xmlChar *) &(cur->properties))) {
DICT_FREE(cur->content)
}
} else {
/*
* we have to find something appropriate here since
- * we cant be sure, that the namespace we found is identified
+ * we can't be sure, that the namespace we found is identified
* by the prefix
*/
if (xmlStrEqual(ns->href, cur->ns->href)) {
if (doc == NULL) return(NULL);
ret = xmlNewDoc(doc->version);
if (ret == NULL) return(NULL);
+ ret->type = doc->type;
if (doc->name != NULL)
ret->name = xmlMemStrdup(doc->name);
if (doc->encoding != NULL)
}
next = ((xmlAttrPtr) cur)->parent;
} else {
- next = cur->parent;
+ xmlFree(buf);
+ xmlFree(buffer);
+ return (NULL);
}
/*
attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
elemQName, name, NULL);
}
+ } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
+ /*
+ * The XML namespace must be bound to prefix 'xml'.
+ */
+ attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
+ elemQName, name, BAD_CAST "xml");
+ if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
+ attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
+ elemQName, name, BAD_CAST "xml");
+ }
} else {
xmlNsPtr *nsList, *cur;
if (value != NULL) {
xmlNodePtr tmp;
- if(!xmlCheckUTF8(value)) {
- xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) node->doc,
- NULL);
- if (node->doc != NULL)
- node->doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
- }
prop->children = xmlNewDocText(node->doc, value);
prop->last = NULL;
tmp = prop->children;
((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL))) {
/*
* we just move the content pointer, but also make sure
- * the perceived buffer size has shrinked accordingly
+ * the perceived buffer size has shrunk accordingly
*/
buf->content += len;
buf->size -= len;
if (size < buf->size)
return 1;
+ if (size > UINT_MAX - 10) {
+ xmlTreeErrMemory("growing buffer");
+ return 0;
+ }
+
/* figure out new size */
switch (buf->alloc){
case XML_BUFFER_ALLOC_IO:
case XML_BUFFER_ALLOC_DOUBLEIT:
/*take care of empty case*/
- newSize = (buf->size ? buf->size*2 : size + 10);
+ newSize = (buf->size ? buf->size : size + 10);
while (size > newSize) {
if (newSize > UINT_MAX / 2) {
xmlTreeErrMemory("growing buffer");
if (buf->use < BASE_BUFFER_SIZE)
newSize = size;
else {
- newSize = buf->size * 2;
+ newSize = buf->size;
while (size > newSize) {
if (newSize > UINT_MAX / 2) {
xmlTreeErrMemory("growing buffer");
if (start_buf > (unsigned int) len) {
/*
- * We can add it in the space previously shrinked
+ * We can add it in the space previously shrunk
*/
buf->content -= len;
memmove(&buf->content[0], str, len);
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
*************************************************************************
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
*************************************************************************
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************
* integer, becomes 0x0706050403020100 (we could have used a 64-bit
* integer value instead of a double, but not all platforms supports
* that type). The value is automatically encoded with the correct
- * endianess by the compiler, which means that we can support any
- * kind of endianess. The individual bytes are then used as an index
+ * endianness by the compiler, which means that we can support any
+ * kind of endianness. The individual bytes are then used as an index
* for the IEEE 754 bit-patterns and masks.
*/
#define TRIO_DOUBLE_INDEX(x) (((unsigned char *)&internalEndianMagic)[7-(x)])
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
#define IN_LIBXML
#include "libxml.h"
+#include <limits.h>
#include <string.h>
#include <libxml/xmlmemory.h>
if (ISA_DIGIT(cur)) {
while (ISA_DIGIT(cur)) {
- port = port * 10 + (*cur - '0');
- if (port > 99999999)
- port = 99999999;
+ int digit = *cur - '0';
+
+ if (port > INT_MAX / 10)
+ return(1);
+ port *= 10;
+ if (port > INT_MAX - digit)
+ return(1);
+ port += digit;
cur++;
}
* @uri: pointer to an URI structure
* @str: the string to analyze
*
- * Parse an user informations part and fills in the appropriate fields
+ * Parse an user information part and fills in the appropriate fields
* of the @uri structure
*
* userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
xmlURIPtr uri;
int ret2;
-#define NULLCHK(p) if(!p) { \
- xmlURIErrMemory("escaping URI value\n"); \
- xmlFreeURI(uri); \
- return NULL; } \
-
if (str == NULL)
return (NULL);
ret = NULL;
+#define NULLCHK(p) if(!p) { \
+ xmlURIErrMemory("escaping URI value\n"); \
+ xmlFreeURI(uri); \
+ xmlFree(ret); \
+ return NULL; } \
+
if (uri->scheme) {
segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
NULLCHK(segment)
if (uri->user) {
segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
NULLCHK(segment)
- ret = xmlStrcat(ret,BAD_CAST "//");
+ ret = xmlStrcat(ret,BAD_CAST "//");
ret = xmlStrcat(ret, segment);
ret = xmlStrcat(ret, BAD_CAST "@");
xmlFree(segment);
if (uri->server) {
segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
NULLCHK(segment)
- if (uri->user == NULL)
- ret = xmlStrcat(ret, BAD_CAST "//");
+ if (uri->user == NULL)
+ ret = xmlStrcat(ret, BAD_CAST "//");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
/**
* xmlVErrMemory:
* @ctxt: an XML validation parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory error
*/
* xmlErrValid:
* @ctxt: an XML validation parser context
* @error: the error number
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a validation error
*/
* @ctxt: an XML validation parser context
* @node: the node raising the error
* @error: the error number
- * @str1: extra informations
- * @str2: extra informations
- * @str3: extra informations
+ * @str1: extra information
+ * @str2: extra information
+ * @str3: extra information
*
- * Handle a validation error, provide contextual informations
+ * Handle a validation error, provide contextual information
*/
static void LIBXML_ATTR_FORMAT(4,0)
xmlErrValidNode(xmlValidCtxtPtr ctxt,
* @ctxt: an XML validation parser context
* @node: the node raising the error
* @error: the error number
- * @str1: extra informations
- * @int2: extra informations
- * @str3: extra informations
+ * @str1: extra information
+ * @int2: extra information
+ * @str3: extra information
*
- * Handle a validation error, provide contextual informations
+ * Handle a validation error, provide contextual information
*/
static void LIBXML_ATTR_FORMAT(4,0)
xmlErrValidNodeNr(xmlValidCtxtPtr ctxt,
* @buf: An XML buffer
* @cur: An element table
*
- * Dump the occurence operator of an element.
+ * Dump the occurrence operator of an element.
*/
static void
xmlDumpElementOccur(xmlBufferPtr buf, xmlElementContentPtr cur) {
} else if (ret == -2) {
/*
* An entities reference appeared at this level.
- * Buid a minimal representation of this node content
+ * Build a minimal representation of this node content
* sufficient to run the validation process on it
*/
DEBUG_VALID_MSG("Found an entity reference, linearizing");
break;
case XML_ELEMENT_TYPE_MIXED:
break;
- case XML_ELEMENT_TYPE_ELEMENT:
- if (len > 0) {
- int i;
-
- for (i = 0;i < len;i++) {
- if (!IS_BLANK_CH(data[i])) {
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_CONTENT_MODEL,
- "Element %s content does not follow the DTD, Text not allowed\n",
- state->node->name, NULL, NULL);
- ret = 0;
- goto done;
- }
- }
- /*
- * TODO:
- * VC: Standalone Document Declaration
- * element types with element content, if white space
- * occurs directly within any instance of those types.
- */
- }
- break;
+ case XML_ELEMENT_TYPE_ELEMENT: {
+ int i;
+
+ for (i = 0;i < len;i++) {
+ if (!IS_BLANK_CH(data[i])) {
+ xmlErrValidNode(ctxt, state->node,
+ XML_DTD_CONTENT_MODEL,
+ "Element %s content does not follow the DTD, Text not allowed\n",
+ state->node->name, NULL, NULL);
+ ret = 0;
+ goto done;
+ }
+ }
+ /*
+ * TODO:
+ * VC: Standalone Document Declaration
+ * element types with element content, if white space
+ * occurs directly within any instance of those types.
+ */
+ break;
+ }
}
}
}
LDFLAGS = $(LDFLAGS)
!endif
+# append CFLAGS etc. passed on command line
+CPPFLAGS = $(CPPFLAGS) $(EXTRA_CPPFLAGS)
+CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
+LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS)
+
# Libxml object files.
XML_OBJS = $(XML_INTDIR)\buf.obj\
$(XML_INTDIR)\c14n.obj\
2.1 GNU C/C++, Mingw Edition
2.2 Borland C++ Builder
2.2.1 Building with iconv support
- 2.2.2 Compatability problems with MSVC (and probably CYGWIN)
+ 2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
2.2.3 Other caveats
not found). This should not have any disastrous side effects beyond possibly
displaying a misleading error message in certain situations.
-2.2.2 Compatability problems with MSVC (and probably CYGWIN)
+2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
A libxml2 DLL generated by BCB is callable from MSVC programs, but there is a
minor problem with the names of the symbols exported from the library. The
----------------------------------------------\r
\r
to clarify: This is not the readme file for the whole libxml2 project. \r
-Rather, it's a readme for the VC10 project files, attached to the libxml2 proejct.\r
+Rather, it's a readme for the VC10 project files, attached to the libxml2 project.\r
\r
Quick Start\r
-----------\r
\r
1) To use, load the libxml2.sln solution file into visual studio\r
-2) check and correct paths for dependent "iconv" project which most certaily \r
+2) check and correct paths for dependent "iconv" project which most certainly \r
are wrong on your environment.\r
3) Compile all projects\r
\r
txt += " installed (" + buildLibPrefix + ")\n";
txt += " sodir: Directory where shared libraries should be installed\n";
txt += " (" + buildSoPrefix + ")\n";
- txt += " include: Additional search path for the compiler, particularily\n";
+ txt += " include: Additional search path for the compiler, particularly\n";
txt += " where iconv headers can be found (" + buildInclude + ")\n";
- txt += " lib: Additional search path for the linker, particularily\n";
+ txt += " lib: Additional search path for the linker, particularly\n";
txt += " where iconv library can be found (" + buildLib + ")\n";
WScript.Echo(txt);
}
while (cf.AtEndOfStream != true) {
ln = cf.ReadLine();
s = new String(ln);
- if (s.search(/^LIBXML_MAJOR_VERSION=/) != -1) {
- vf.WriteLine(s);
- verMajor = s.substring(s.indexOf("=") + 1, s.length)
- } else if(s.search(/^LIBXML_MINOR_VERSION=/) != -1) {
- vf.WriteLine(s);
- verMinor = s.substring(s.indexOf("=") + 1, s.length)
- } else if(s.search(/^LIBXML_MICRO_VERSION=/) != -1) {
- vf.WriteLine(s);
- verMicro = s.substring(s.indexOf("=") + 1, s.length)
+ if (m = s.match(/^m4_define\(\[MAJOR_VERSION\], (\w+)\)/)) {
+ vf.WriteLine("LIBXML_MAJOR_VERSION=" + m[1]);
+ verMajor = m[1];
+ } else if(m = s.match(/^m4_define\(\[MINOR_VERSION\], (\w+)\)/)) {
+ vf.WriteLine("LIBXML_MINOR_VERSION=" + m[1]);
+ verMinor = m[1];
+ } else if(m = s.match(/^m4_define\(\[MICRO_VERSION\], (\w+)\)/)) {
+ vf.WriteLine("LIBXML_MICRO_VERSION=" + m[1]);
+ verMicro = m[1];
} else if(s.search(/^LIBXML_MICRO_VERSION_SUFFIX=/) != -1) {
vf.WriteLine(s);
- verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length)
+ verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length);
}
}
cf.Close();
vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
}
vf.Close();
- versionFile = "rcVersion.h"
+ versionFile = "rcVersion.h";
vf = fso.CreateTextFile(versionFile, true);
vf.WriteLine("/*");
vf.WriteLine(" " + versionFile);
vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + "\"");
- vf.Close()
+ vf.Close();
}
/* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
f.WriteLine("platform.");
f.WriteBlankLines(1);
f.WriteLine(" The files in this package do not require any special installation");
- f.WriteLine("steps. Extract the contents of the archive whereever you wish and");
+ f.WriteLine("steps. Extract the contents of the archive wherever you wish and");
f.WriteLine("make sure that your tools which use " + bname + " can find it.");
f.WriteBlankLines(1);
f.WriteLine(" For example, if you want to run the supplied utilities from the command");
buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "prefix")
buildPrefix = arg.substring(opt.length + 1, arg.length);
- else if (opt == "incdir")
- buildIncPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "bindir")
buildBinPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "libdir")
xmlNodePtr inc; /* the included copy */
int xml; /* xml or txt */
int count; /* how many refs use that specific doc */
- xmlXPathObjectPtr xptr; /* the xpointer if needed */
+ int fallback; /* fallback was loaded */
int emptyFb; /* flag to show fallback empty */
};
int txtNr; /* number of unparsed documents */
int txtMax; /* size of unparsed documents tab */
- xmlNodePtr *txtTab; /* array of unparsed text nodes */
+ xmlChar * *txtTab; /* array of unparsed text strings */
xmlURL *txturlTab; /* array of unparsed text URLs */
xmlChar * url; /* the current URL processed */
xmlChar * base; /* the current xml:base */
void *_private; /* application data */
+
+ unsigned long incTotal; /* total number of processed inclusions */
};
static int
-xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree);
+xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
+ int skipRoot);
/************************************************************************
xmlFree(ref->URI);
if (ref->fragment != NULL)
xmlFree(ref->fragment);
- if (ref->xptr != NULL)
- xmlXPathFreeObject(ref->xptr);
xmlFree(ref);
}
if (ctxt->incTab[i] != NULL)
xmlXIncludeFreeRef(ctxt->incTab[i]);
}
+ if (ctxt->incTab != NULL)
+ xmlFree(ctxt->incTab);
+ if (ctxt->txtTab != NULL) {
+ for (i = 0;i < ctxt->txtNr;i++) {
+ if (ctxt->txtTab[i] != NULL)
+ xmlFree(ctxt->txtTab[i]);
+ }
+ xmlFree(ctxt->txtTab);
+ }
if (ctxt->txturlTab != NULL) {
for (i = 0;i < ctxt->txtNr;i++) {
if (ctxt->txturlTab[i] != NULL)
xmlFree(ctxt->txturlTab[i]);
}
- }
- if (ctxt->incTab != NULL)
- xmlFree(ctxt->incTab);
- if (ctxt->txtTab != NULL)
- xmlFree(ctxt->txtTab);
- if (ctxt->txturlTab != NULL)
xmlFree(ctxt->txturlTab);
+ }
if (ctxt->base != NULL) {
xmlFree(ctxt->base);
}
xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
"detected a local recursion with no xpointer in %s\n",
URL);
- if (fragment != NULL)
- xmlFree(fragment);
+ xmlFree(URL);
+ xmlFree(fragment);
return(-1);
}
if (xmlStrEqual(URL, ctxt->urlTab[i])) {
xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
"detected a recursion in %s\n", URL);
+ xmlFree(URL);
+ xmlFree(fragment);
return(-1);
}
}
}
ref = xmlXIncludeNewRef(ctxt, URL, cur);
+ xmlFree(URL);
if (ref == NULL) {
return(-1);
}
ref->doc = NULL;
ref->xml = xml;
ref->count = 1;
- xmlFree(URL);
return(0);
}
* (bug 132597)
*/
newctxt->parseFlags = ctxt->parseFlags;
- xmlXIncludeDoProcess(newctxt, doc, xmlDocGetRootElement(doc));
+ newctxt->incTotal = ctxt->incTotal;
+ xmlXIncludeDoProcess(newctxt, doc, xmlDocGetRootElement(doc), 0);
+ ctxt->incTotal = newctxt->incTotal;
for (i = 0;i < ctxt->incNr;i++) {
newctxt->incTab[i]->count--;
newctxt->incTab[i] = NULL;
* Add a new text node to the list
*/
static void
-xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) {
+xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *txt,
+ const xmlURL url) {
#ifdef DEBUG_XINCLUDE
xmlGenericError(xmlGenericErrorContext, "Adding text %s\n", url);
#endif
if (ctxt->txtMax == 0) {
ctxt->txtMax = 4;
- ctxt->txtTab = (xmlNodePtr *) xmlMalloc(ctxt->txtMax *
+ ctxt->txtTab = (xmlChar **) xmlMalloc(ctxt->txtMax *
sizeof(ctxt->txtTab[0]));
if (ctxt->txtTab == NULL) {
xmlXIncludeErrMemory(ctxt, NULL, "processing text");
}
if (ctxt->txtNr >= ctxt->txtMax) {
ctxt->txtMax *= 2;
- ctxt->txtTab = (xmlNodePtr *) xmlRealloc(ctxt->txtTab,
+ ctxt->txtTab = (xmlChar **) xmlRealloc(ctxt->txtTab,
ctxt->txtMax * sizeof(ctxt->txtTab[0]));
if (ctxt->txtTab == NULL) {
xmlXIncludeErrMemory(ctxt, NULL, "processing text");
return;
}
}
- ctxt->txtTab[ctxt->txtNr] = txt;
+ ctxt->txtTab[ctxt->txtNr] = xmlStrdup(txt);
ctxt->txturlTab[ctxt->txtNr] = xmlStrdup(url);
ctxt->txtNr++;
}
case XML_ELEMENT_DECL:
case XML_ATTRIBUTE_DECL:
case XML_ENTITY_NODE:
- /* Do not copy DTD informations */
+ /* Do not copy DTD information */
break;
case XML_ENTITY_DECL:
/* handle crossing entities -> stack needed */
*/
if ((URL[0] == 0) || (URL[0] == '#') ||
((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) {
- doc = NULL;
+ doc = ctxt->doc;
goto loaded;
}
/*
* Add the top children list as the replacement copy.
*/
- if (doc == NULL)
- {
- /* Hopefully a DTD declaration won't be copied from
- * the same document */
- ctxt->incTab[nr]->inc = xmlCopyNodeList(ctxt->doc->children);
- } else {
- ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc,
- doc, doc->children);
- }
+ ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc,
+ doc, doc->children);
}
#ifdef LIBXML_XPTR_ENABLED
else {
xmlXPathContextPtr xptrctxt;
xmlNodeSetPtr set;
- if (doc == NULL) {
- xptrctxt = xmlXPtrNewContext(ctxt->doc, ctxt->incTab[nr]->ref,
- NULL);
- } else {
- xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
- }
+ xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
if (xptrctxt == NULL) {
xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
XML_XINCLUDE_XPTR_FAILED,
XML_XINCLUDE_XPTR_RESULT,
"XPointer is not a range: #%s\n",
fragment);
+ xmlXPathFreeObject(xptr);
xmlXPathFreeContext(xptrctxt);
xmlFree(URL);
xmlFree(fragment);
case XPATH_NODESET:
if ((xptr->nodesetval == NULL) ||
(xptr->nodesetval->nodeNr <= 0)) {
+ xmlXPathFreeObject(xptr);
xmlXPathFreeContext(xptrctxt);
xmlFree(URL);
xmlFree(fragment);
}
}
}
- if (doc == NULL) {
- ctxt->incTab[nr]->xptr = xptr;
- ctxt->incTab[nr]->inc = NULL;
- } else {
- ctxt->incTab[nr]->inc =
- xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr);
- xmlXPathFreeObject(xptr);
- }
+ ctxt->incTab[nr]->inc =
+ xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr);
+ xmlXPathFreeObject(xptr);
xmlXPathFreeContext(xptrctxt);
xmlFree(fragment);
}
*/
for (i = 0; i < ctxt->txtNr; i++) {
if (xmlStrEqual(URL, ctxt->txturlTab[i])) {
- node = xmlCopyNode(ctxt->txtTab[i], 1);
+ node = xmlNewText(ctxt->txtTab[i]);
goto loaded;
}
}
xmlBufShrink(buf->buffer, len);
}
xmlFreeParserCtxt(pctxt);
- xmlXIncludeAddTxt(ctxt, node, URL);
+ xmlXIncludeAddTxt(ctxt, node->content, URL);
xmlFreeInputStream(inputStream);
loaded:
newctxt->_private = ctxt->_private;
newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */
xmlXIncludeSetFlags(newctxt, ctxt->parseFlags);
- ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children);
+ newctxt->incTotal = ctxt->incTotal;
+ if (xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback, 1) < 0)
+ ret = -1;
+ ctxt->incTotal = newctxt->incTotal;
if (ctxt->nbErrors > oldNbErrors)
ret = -1;
- else if (ret > 0)
- ret = 0; /* xmlXIncludeDoProcess can return +ve number */
xmlXIncludeFreeContext(newctxt);
ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc,
fallback->children);
+ if (ctxt->incTab[nr]->inc == NULL)
+ ctxt->incTab[nr]->emptyFb = 1;
} else {
ctxt->incTab[nr]->inc = NULL;
ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */
}
+ ctxt->incTab[nr]->fallback = 1;
return(ret);
}
((xmlStrEqual(children->ns->href, XINCLUDE_NS)) ||
(xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) {
ret = xmlXIncludeLoadFallback(ctxt, children, nr);
- if (ret == 0)
- break;
+ break;
}
children = children->next;
}
if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
return(-1);
- /*
- * If we stored an XPointer a late computation may be needed
- */
- if ((ctxt->incTab[nr]->inc == NULL) &&
- (ctxt->incTab[nr]->xptr != NULL)) {
- ctxt->incTab[nr]->inc =
- xmlXIncludeCopyXPointer(ctxt, ctxt->doc, ctxt->doc,
- ctxt->incTab[nr]->xptr);
- xmlXPathFreeObject(ctxt->incTab[nr]->xptr);
- ctxt->incTab[nr]->xptr = NULL;
- }
list = ctxt->incTab[nr]->inc;
ctxt->incTab[nr]->inc = NULL;
+ ctxt->incTab[nr]->emptyFb = 0;
/*
* Check against the risk of generating a multi-rooted document
XML_XINCLUDE_MULTIPLE_ROOT,
"XInclude error: would result in multiple root nodes\n",
NULL);
+ xmlFreeNodeList(list);
return(-1);
}
}
xmlUnlinkNode(cur);
xmlFreeNode(cur);
} else {
+ xmlNodePtr child, next;
+
/*
* Change the current node as an XInclude start one, and add an
* XInclude end one
*/
+ if (ctxt->incTab[nr]->fallback)
+ xmlUnsetProp(cur, BAD_CAST "href");
cur->type = XML_XINCLUDE_START;
+ /* Remove fallback children */
+ for (child = cur->children; child != NULL; child = next) {
+ next = child->next;
+ xmlUnlinkNode(child);
+ xmlFreeNode(child);
+ }
end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
if (end == NULL) {
xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
XML_XINCLUDE_BUILD_FAILED,
"failed to build node\n", NULL);
+ xmlFreeNodeList(list);
return(-1);
}
end->type = XML_XINCLUDE_END;
* @ctxt: the XInclude processing context
* @doc: an XML document
* @tree: the top of the tree to process
+ * @skipRoot: don't process the root node of the tree
*
* Implement the XInclude substitution on the XML document @doc
*
* or the number of substitutions done.
*/
static int
-xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) {
+xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
+ int skipRoot) {
xmlNodePtr cur;
int ret = 0;
int i, start;
if ((doc == NULL) || (tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
return(-1);
+ if ((skipRoot) && (tree->children == NULL))
+ return(-1);
if (ctxt == NULL)
return(-1);
start = ctxt->incNr;
/*
+ * TODO: The phases must run separately for recursive inclusions.
+ *
+ * - Phase 1 should start with top-level XInclude nodes, load documents,
+ * execute XPointer expressions, then process only the result nodes
+ * (not whole document, see bug #324081) and only for phase 1
+ * recursively. We will need a backreference from xmlNodes to
+ * xmlIncludeRefs to detect references that were already visited.
+ * This can also be used for proper cycle detection, see bug #344240.
+ *
+ * - Phase 2 should visit all top-level XInclude nodes and expand
+ * possible subreferences in the replacement recursively.
+ *
+ * - Phase 3 should finally replace the top-level XInclude nodes.
+ * It could also be run together with phase 2.
+ */
+
+ /*
* First phase: lookup the elements in the document
*/
- cur = tree;
- if (xmlXIncludeTestNode(ctxt, cur) == 1)
- xmlXIncludePreProcessNode(ctxt, cur);
- while ((cur != NULL) && (cur != tree->parent)) {
+ if (skipRoot)
+ cur = tree->children;
+ else
+ cur = tree;
+ do {
/* TODO: need to work on entities -> stack */
- if ((cur->children != NULL) &&
- (cur->children->type != XML_ENTITY_DECL) &&
- (cur->children->type != XML_XINCLUDE_START) &&
- (cur->children->type != XML_XINCLUDE_END)) {
- cur = cur->children;
- if (xmlXIncludeTestNode(ctxt, cur))
- xmlXIncludePreProcessNode(ctxt, cur);
- } else if (cur->next != NULL) {
- cur = cur->next;
- if (xmlXIncludeTestNode(ctxt, cur))
- xmlXIncludePreProcessNode(ctxt, cur);
- } else {
- if (cur == tree)
- break;
- do {
- cur = cur->parent;
- if ((cur == NULL) || (cur == tree->parent))
- break; /* do */
- if (cur->next != NULL) {
- cur = cur->next;
- if (xmlXIncludeTestNode(ctxt, cur))
- xmlXIncludePreProcessNode(ctxt, cur);
- break; /* do */
- }
- } while (cur != NULL);
- }
- }
+ if (xmlXIncludeTestNode(ctxt, cur) == 1) {
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ /*
+ * Avoid superlinear expansion by limiting the total number
+ * of replacements.
+ */
+ if (ctxt->incTotal >= 20)
+ return(-1);
+#endif
+ ctxt->incTotal++;
+ xmlXIncludePreProcessNode(ctxt, cur);
+ } else if ((cur->children != NULL) &&
+ ((cur->type == XML_DOCUMENT_NODE) ||
+ (cur->type == XML_ELEMENT_NODE))) {
+ cur = cur->children;
+ continue;
+ }
+ do {
+ if (cur == tree)
+ break;
+ if (cur->next != NULL) {
+ cur = cur->next;
+ break;
+ }
+ cur = cur->parent;
+ } while (cur != NULL);
+ } while ((cur != NULL) && (cur != tree));
/*
* Second Phase : collect the infosets fragments
*/
for (i = ctxt->incBase;i < ctxt->incNr; i++) {
if ((ctxt->incTab[i]->inc != NULL) ||
- (ctxt->incTab[i]->xptr != NULL) ||
- (ctxt->incTab[i]->emptyFb != 0)) /* (empty fallback) */
+ (ctxt->incTab[i]->emptyFb != 0)) /* (empty fallback) */
xmlXIncludeIncludeNode(ctxt, i);
}
ctxt->_private = data;
ctxt->base = xmlStrdup((xmlChar *)tree->doc->URL);
xmlXIncludeSetFlags(ctxt, flags);
- ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree);
+ ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0);
if ((ret >= 0) && (ctxt->nbErrors > 0))
ret = -1;
return(-1);
ctxt->base = xmlNodeGetBase(tree->doc, tree);
xmlXIncludeSetFlags(ctxt, flags);
- ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree);
+ ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0);
if ((ret >= 0) && (ctxt->nbErrors > 0))
ret = -1;
* @node: a node in an XML document
*
* Implement the XInclude substitution for the given subtree reusing
- * the informations and data coming from the given context.
+ * the information and data coming from the given context.
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
(node->doc == NULL) || (ctxt == NULL))
return(-1);
- ret = xmlXIncludeDoProcess(ctxt, node->doc, node);
+ ret = xmlXIncludeDoProcess(ctxt, node->doc, node, 0);
if ((ret >= 0) && (ctxt->nbErrors > 0))
ret = -1;
return(ret);
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
+cflags=
+libs=
usage()
{
;;
*)
- usage
- exit 1
+ usage 1
;;
esac
shift
done
-if test "$cflags" -o "$libs"; then
+if test -n "$cflags$libs"; then
echo $cflags $libs
fi
/**
* xmlIOErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* __xmlIOErr:
* @code: the error number
* @
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an I/O error
*/
/**
* xmlIOErr:
* @code: the error number
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an I/O error
*/
/**
* __xmlLoaderErr:
* @ctx: the parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a resource access error
*/
xmlOutputCallbackNr = 0;
xmlOutputCallbackInitialized = 0;
}
+
+/**
+ * xmlPopOutputCallbacks:
+ *
+ * Remove the top output callbacks from the output stack. This includes the
+ * compiled-in I/O.
+ *
+ * Returns the number of output callback registered or -1 in case of error.
+ */
+int
+xmlPopOutputCallbacks(void)
+{
+ if (!xmlOutputCallbackInitialized)
+ return(-1);
+
+ if (xmlOutputCallbackNr <= 0)
+ return(-1);
+
+ xmlOutputCallbackNr--;
+ xmlOutputCallbackTable[xmlOutputCallbackNr].matchcallback = NULL;
+ xmlOutputCallbackTable[xmlOutputCallbackNr].opencallback = NULL;
+ xmlOutputCallbackTable[xmlOutputCallbackNr].writecallback = NULL;
+ xmlOutputCallbackTable[xmlOutputCallbackNr].closecallback = NULL;
+
+ return(xmlOutputCallbackNr);
+}
+
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
out->error = XML_IO_ENCODER;
return(-1);
}
- if (out->writecallback)
- nbchars = xmlBufUse(out->conv);
- else
- nbchars = ret;
+ nbchars = ret >= 0 ? ret : 0;
} else {
ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk);
if (ret != 0)
return(-1);
- if (out->writecallback)
- nbchars = xmlBufUse(out->buffer);
- else
- nbchars = chunk;
+ nbchars = chunk;
}
buf += chunk;
len -= chunk;
out->error = XML_IO_ENCODER;
return(-1);
}
- if (out->writecallback)
- nbchars = xmlBufUse(out->conv);
- else
- nbchars = ret;
+ nbchars = ret >= 0 ? ret : 0;
} else {
ret = escaping(xmlBufEnd(out->buffer), &chunk, str, &cons);
if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
return(-1);
xmlBufAddLen(out->buffer, chunk);
- if (out->writecallback)
- nbchars = xmlBufUse(out->buffer);
- else
- nbchars = chunk;
+ nbchars = chunk;
}
str += cons;
len -= cons;
\t used with --add or --del, it saves the catalog changes\n\
\t and with --sgml it automatically updates the super catalog\n\
\t--no-super-update: do not update the SGML super catalog\n\
-\t-v --verbose : provide debug informations\n");
+\t-v --verbose : provide debug information\n");
}
int main(int argc, char **argv) {
int i;
static int dtdattrs = 0;
static int loaddtd = 0;
static xmllintReturnCode progresult = XMLLINT_RETURN_OK;
+static int quiet = 0;
static int timing = 0;
static int generate = 0;
static int dropdtd = 0;
xmlHTMLEncodeSend(void) {
char *result;
+ /*
+ * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might
+ * end with a truncated UTF-8 sequence. This is a hack to at least avoid
+ * an out-of-bounds read.
+ */
+ memset(&buffer[sizeof(buffer)-4], 0, 4);
result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
if (result) {
xmlGenericError(xmlGenericErrorContext, "%s", result);
* xmlHTMLPrintFileInfo:
* @input: an xmlParserInputPtr input
*
- * Displays the associated file and line informations for the current input
+ * Displays the associated file and line information for the current input
*/
static void
(void *)user_data);
if (repeat == 0) {
if (ret == 0) {
- fprintf(stderr, "%s validates\n", filename);
+ if (!quiet) {
+ fprintf(stderr, "%s validates\n", filename);
+ }
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
- fprintf(stderr, "%s validates\n", filename);
+ if (!quiet) {
+ fprintf(stderr, "%s validates\n", filename);
+ }
}
}
#endif
else if ((html) && (push)) {
FILE *f;
+ if ((filename[0] == '-') && (filename[1] == 0)) {
+ f = stdin;
+ } else {
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
- f = fopen(filename, "rb");
+ f = fopen(filename, "rb");
#elif defined(__OS400__)
- f = fopen(filename, "rb");
+ f = fopen(filename, "rb");
#else
- f = fopen(filename, "r");
+ f = fopen(filename, "r");
#endif
+ }
if (f != NULL) {
int res;
char chars[4096];
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
- xmlCtxtUseOptions(ctxt, options);
+ htmlCtxtUseOptions(ctxt, options);
while ((res = fread(chars, 1, pushsize, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
doc = ctxt->myDoc;
ret = ctxt->wellFormed;
xmlFreeParserCtxt(ctxt);
- if (!ret) {
+ if ((!ret) && (!recovery)) {
xmlFreeDoc(doc);
doc = NULL;
}
dtd = xmlGetIntSubset(doc);
if (dtd != NULL) {
xmlUnlinkNode((xmlNodePtr)dtd);
+ doc->intSubset = NULL;
xmlFreeDtd(dtd);
}
}
#endif
ret = xmlSchematronValidateDoc(ctxt, doc);
if (ret == 0) {
- fprintf(stderr, "%s validates\n", filename);
+ if (!quiet) {
+ fprintf(stderr, "%s validates\n", filename);
+ }
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
xmlRelaxNGSetValidErrors(ctxt, xmlGenericError, xmlGenericError, NULL);
ret = xmlRelaxNGValidateDoc(ctxt, doc);
if (ret == 0) {
- fprintf(stderr, "%s validates\n", filename);
+ if (!quiet) {
+ fprintf(stderr, "%s validates\n", filename);
+ }
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
xmlSchemaSetValidErrors(ctxt, xmlGenericError, xmlGenericError, NULL);
ret = xmlSchemaValidateDoc(ctxt, doc);
if (ret == 0) {
- fprintf(stderr, "%s validates\n", filename);
+ if (!quiet) {
+ fprintf(stderr, "%s validates\n", filename);
+ }
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
fprintf(f, "\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
fprintf(f, "\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
#endif /* LIBXML_VALID_ENABLED */
+ fprintf(f, "\t--quiet : be quiet when succeeded\n");
fprintf(f, "\t--timing : print some timings\n");
fprintf(f, "\t--output file or -o file: save to a given file\n");
fprintf(f, "\t--repeat : repeat 100 times, for timing or profiling\n");
else if ((!strcmp(argv[i], "-insert")) ||
(!strcmp(argv[i], "--insert")))
insert++;
+ else if ((!strcmp(argv[i], "-quiet")) ||
+ (!strcmp(argv[i], "--quiet")))
+ quiet++;
else if ((!strcmp(argv[i], "-timing")) ||
(!strcmp(argv[i], "--timing")))
timing++;
#endif
/*
- * Each of the blocks allocated begin with a header containing informations
+ * Each of the blocks allocated begin with a header containing information
*/
#define MEMTAG 0x5aa5
#define MAX_ERR_MSG_SIZE 64000
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+/* Keeping free objects can hide memory errors. */
+#define MAX_FREE_NODES 1
+#else
+#define MAX_FREE_NODES 100
+#endif
+
/*
* The following VA_COPY was coded following an example in
* the Samba project. It may not be sufficient for some
}
/**
+ * xmlTextReaderWalkRemoveRef:
+ * @data: Contents of current link
+ * @user: Value supplied by the user
+ *
+ * Returns 0 to abort the walk or 1 to continue
+ */
+static int
+xmlTextReaderWalkRemoveRef(const void *data, void *user)
+{
+ xmlRefPtr ref = (xmlRefPtr)data;
+ xmlAttrPtr attr = (xmlAttrPtr)user;
+
+ if (ref->attr == attr) { /* Matched: remove and terminate walk */
+ ref->name = xmlStrdup(attr->name);
+ ref->attr = NULL;
+ return 0;
+ }
+ return 1;
+}
+
+/**
+ * xmlTextReaderRemoveRef:
+ * @doc: the document
+ * @attr: the attribute
+ *
+ * Remove the given attribute from the Ref table maintained internally.
+ *
+ * Returns -1 if the lookup failed and 0 otherwise
+ */
+static int
+xmlTextReaderRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) {
+ xmlListPtr ref_list;
+ xmlRefTablePtr table;
+ xmlChar *ID;
+
+ if (doc == NULL) return(-1);
+ if (attr == NULL) return(-1);
+ table = (xmlRefTablePtr) doc->refs;
+ if (table == NULL)
+ return(-1);
+
+ ID = xmlNodeListGetString(doc, attr->children, 1);
+ if (ID == NULL)
+ return(-1);
+ ref_list = xmlHashLookup(table, ID);
+ xmlFree(ID);
+ if(ref_list == NULL)
+ return (-1);
+ xmlListWalk(ref_list, xmlTextReaderWalkRemoveRef, attr);
+ return(0);
+}
+
+/**
* xmlTextReaderFreeProp:
* @reader: the xmlTextReaderPtr used
* @cur: the node
xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
/* Check for ID removal -> leading to invalid references ! */
- if ((cur->parent != NULL) && (cur->parent->doc != NULL) &&
- ((cur->parent->doc->intSubset != NULL) ||
- (cur->parent->doc->extSubset != NULL))) {
+ if ((cur->parent != NULL) && (cur->parent->doc != NULL)) {
if (xmlIsID(cur->parent->doc, cur->parent, cur))
xmlTextReaderRemoveID(cur->parent->doc, cur);
+ if (((cur->parent->doc->intSubset != NULL) ||
+ (cur->parent->doc->extSubset != NULL)) &&
+ (xmlIsRef(cur->parent->doc, cur->parent, cur)))
+ xmlTextReaderRemoveRef(cur->parent->doc, cur);
}
if (cur->children != NULL)
xmlTextReaderFreeNodeList(reader, cur->children);
DICT_FREE(cur->name);
if ((reader != NULL) && (reader->ctxt != NULL) &&
- (reader->ctxt->freeAttrsNr < 100)) {
+ (reader->ctxt->freeAttrsNr < MAX_FREE_NODES)) {
cur->next = reader->ctxt->freeAttrs;
reader->ctxt->freeAttrs = cur;
reader->ctxt->freeAttrsNr++;
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_TEXT_NODE)) &&
(reader != NULL) && (reader->ctxt != NULL) &&
- (reader->ctxt->freeElemsNr < 100)) {
+ (reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
cur->next = reader->ctxt->freeElems;
reader->ctxt->freeElems = cur;
reader->ctxt->freeElemsNr++;
if (((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_TEXT_NODE)) &&
(reader != NULL) && (reader->ctxt != NULL) &&
- (reader->ctxt->freeElemsNr < 100)) {
+ (reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
cur->next = reader->ctxt->freeElems;
reader->ctxt->freeElems = cur;
reader->ctxt->freeElemsNr++;
xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
xmlNodePtr oldnode = reader->node;
xmlNodePtr node = reader->node;
- xmlParserCtxtPtr ctxt = reader->ctxt;
do {
if (node->type == XML_ENTITY_REF_NODE) {
- /*
- * Case where the underlying tree is not available, lookup the entity
- * and walk it.
- */
- if ((node->children == NULL) && (ctxt->sax != NULL) &&
- (ctxt->sax->getEntity != NULL)) {
- node->children = (xmlNodePtr)
- ctxt->sax->getEntity(ctxt, node->name);
- }
-
if ((node->children != NULL) &&
(node->children->type == XML_ENTITY_DECL) &&
(node->children->children != NULL)) {
(reader->node->prev->type != XML_DTD_NODE)) {
xmlNodePtr tmp = reader->node->prev;
if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
+ if (oldnode == tmp)
+ oldnode = NULL;
xmlUnlinkNode(tmp);
xmlTextReaderFreeNode(reader, tmp);
}
/*
* Handle XInclude if asked for
*/
- if ((reader->xinclude) && (reader->node != NULL) &&
+ if ((reader->xinclude) && (reader->in_xinclude == 0) &&
+ (reader->node != NULL) &&
(reader->node->type == XML_ELEMENT_NODE) &&
(reader->node->ns != NULL) &&
((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
if ((reader->node != NULL) &&
(reader->node->type == XML_ENTITY_REF_NODE) &&
(reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
- /*
- * Case where the underlying tree is not available, lookup the entity
- * and walk it.
- */
- if ((reader->node->children == NULL) && (reader->ctxt->sax != NULL) &&
- (reader->ctxt->sax->getEntity != NULL)) {
- reader->node->children = (xmlNodePtr)
- reader->ctxt->sax->getEntity(reader->ctxt, reader->node->name);
- }
-
if ((reader->node->children != NULL) &&
(reader->node->children->type == XML_ENTITY_DECL) &&
(reader->node->children->children != NULL)) {
if (reader->ctxt != NULL) {
if (reader->dict == reader->ctxt->dict)
reader->dict = NULL;
+#ifdef LIBXML_VALID_ENABLED
if ((reader->ctxt->vctxt.vstateTab != NULL) &&
(reader->ctxt->vctxt.vstateMax > 0)){
+#ifdef LIBXML_REGEXP_ENABLED
while (reader->ctxt->vctxt.vstateNr > 0)
xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
+#endif /* LIBXML_REGEXP_ENABLED */
xmlFree(reader->ctxt->vctxt.vstateTab);
reader->ctxt->vctxt.vstateTab = NULL;
reader->ctxt->vctxt.vstateMax = 0;
}
+#endif /* LIBXML_VALID_ENABLED */
if (reader->ctxt->myDoc != NULL) {
if (reader->preserve == 0)
xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
/************************************************************************
* *
- * Acces API to the current node *
+ * Access API to the current node *
* *
************************************************************************/
/**
*
* The value indicating whether to normalize white space and attribute values.
* Since attribute value and end of line normalizations are a MUST in the XML
- * specification only the value true is accepted. The broken bahaviour of
+ * specification only the value true is accepted. The broken behaviour of
* accepting out of range character entities like � is of course not
* supported either.
*
return(0);
case XML_PARSER_VALIDATE:
if (value != 0) {
+ ctxt->options |= XML_PARSE_DTDVALID;
ctxt->validate = 1;
reader->validate = XML_TEXTREADER_VALIDATE_DTD;
} else {
+ ctxt->options &= ~XML_PARSE_DTDVALID;
ctxt->validate = 0;
}
return(0);
case XML_PARSER_SUBST_ENTITIES:
if (value != 0) {
+ ctxt->options |= XML_PARSE_NOENT;
ctxt->replaceEntities = 1;
} else {
+ ctxt->options &= ~XML_PARSE_NOENT;
ctxt->replaceEntities = 0;
}
return(0);
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <libxml/tree.h>
#include <libxml/parserInternals.h>
#ifndef INT_MAX
#define INT_MAX 123456789 /* easy to flag and big enough for our needs */
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t) -1)
+#endif
/* #define DEBUG_REGEXP_GRAPH */
/* #define DEBUG_REGEXP_EXEC */
int determinist;
int negs;
int flags;
+
+ int depth;
};
struct _xmlRegexp {
************************************************************************/
static int xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt);
+
+/**
+ * xmlRegCalloc2:
+ * @dim1: size of first dimension
+ * @dim2: size of second dimension
+ * @elemSize: size of element
+ *
+ * Allocate a two-dimensional array and set all elements to zero.
+ *
+ * Returns the new array or NULL in case of error.
+ */
+static void*
+xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
+ size_t totalSize;
+ void *ret;
+
+ /* Check for overflow */
+ if (dim1 > SIZE_MAX / dim2 / elemSize)
+ return (NULL);
+ totalSize = dim1 * dim2 * elemSize;
+ ret = xmlMalloc(totalSize);
+ if (ret != NULL)
+ memset(ret, 0, totalSize);
+ return (ret);
+}
+
/**
* xmlRegEpxFromParse:
* @ctxt: the parser context used to build it
#ifdef DEBUG_COMPACTION
printf("Final: %d atoms\n", nbatoms);
#endif
- transitions = (int *) xmlMalloc((nbstates + 1) *
- (nbatoms + 1) * sizeof(int));
+ transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
+ sizeof(int));
if (transitions == NULL) {
xmlFree(stateRemap);
xmlFree(stringRemap);
xmlFree(ret);
return(NULL);
}
- memset(transitions, 0, (nbstates + 1) * (nbatoms + 1) * sizeof(int));
/*
* Allocate the transition table. The first entry for each
continue;
atomno = stringRemap[trans->atom->no];
if ((trans->atom->data != NULL) && (transdata == NULL)) {
- transdata = (void **) xmlMalloc(nbstates * nbatoms *
- sizeof(void *));
- if (transdata != NULL)
- memset(transdata, 0,
- nbstates * nbatoms * sizeof(void *));
- else {
+ transdata = (void **) xmlRegCalloc2(nbstates, nbatoms,
+ sizeof(void *));
+ if (transdata == NULL) {
xmlRegexpErrMemory(ctxt, "compiling regexp");
break;
}
state->markd = XML_REGEXP_MARK_VISITED;
res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
to, atom);
- state->markd = 0;
if (res == 0) {
ret = 0;
/* t1->nd = 1; */
}
/**
+ * xmlFAFinishRecurseDeterminism:
+ * @ctxt: a regexp parser context
+ *
+ * Reset flags after checking determinism.
+ */
+static void
+xmlFAFinishRecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state) {
+ int transnr, nbTrans;
+
+ if (state == NULL)
+ return;
+ if (state->markd != XML_REGEXP_MARK_VISITED)
+ return;
+ state->markd = 0;
+
+ nbTrans = state->nbTrans;
+ for (transnr = 0; transnr < nbTrans; transnr++) {
+ xmlRegTransPtr t1 = &state->trans[transnr];
+ if ((t1->atom == NULL) && (t1->to >= 0))
+ xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t1->to]);
+ }
+}
+
+/**
* xmlFAComputesDeterminism:
* @ctxt: a regexp parser context
*
*/
ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
t2->to, t2->atom);
+ xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t1->to]);
/* don't shortcut the computation so all non deterministic
transition get marked down
if (ret == 0)
* @values: pointer to the array of acceptable values
* @terminal: return value if this was a terminal state
*
- * Extract informations from the regexp execution, internal routine to
+ * Extract information from the regexp execution, internal routine to
* implement xmlRegExecNextValues() and xmlRegExecErrInfo()
*
* Returns: 0 in case of success or -1 in case of error.
* @values: pointer to the array of acceptable values
* @terminal: return value if this was a terminal state
*
- * Extract informations from the regexp execution,
+ * Extract information from the regexp execution,
* the parameter @values must point to an array of @nbval string pointers
* on return nbval will contain the number of possible strings in that
* state and the @values array will be updated with them. The string values
* @values: pointer to the array of acceptable values
* @terminal: return value if this was a terminal state
*
- * Extract error informations from the regexp execution, the parameter
+ * Extract error information from the regexp execution, the parameter
* @string will be updated with the value pushed and not accepted,
* the parameter @values must point to an array of @nbval string pointers
* on return nbval will contain the number of possible strings in that
} else {
xmlFAParseCharRange(ctxt);
}
- } while ((CUR != ']') && (CUR != '^') && (CUR != '-') &&
+ } while ((CUR != ']') && (CUR != '-') &&
(CUR != 0) && (ctxt->error == 0));
}
*/
static void
xmlFAParseCharGroup(xmlRegParserCtxtPtr ctxt) {
- int n = ctxt->neg;
- while ((CUR != ']') && (ctxt->error == 0)) {
- if (CUR == '^') {
- int neg = ctxt->neg;
+ int neg = ctxt->neg;
- NEXT;
- ctxt->neg = !ctxt->neg;
- xmlFAParsePosCharGroup(ctxt);
- ctxt->neg = neg;
- } else if ((CUR == '-') && (NXT(1) == '[')) {
- int neg = ctxt->neg;
- ctxt->neg = 2;
+ if (CUR == '^') {
+ NEXT;
+ ctxt->neg = !ctxt->neg;
+ xmlFAParsePosCharGroup(ctxt);
+ ctxt->neg = neg;
+ }
+ while ((CUR != ']') && (ctxt->error == 0)) {
+ if ((CUR == '-') && (NXT(1) == '[')) {
NEXT; /* eat the '-' */
NEXT; /* eat the '[' */
+ ctxt->neg = 2;
xmlFAParseCharGroup(ctxt);
+ ctxt->neg = neg;
if (CUR == ']') {
NEXT;
} else {
ERROR("charClassExpr: ']' expected");
- break;
}
- ctxt->neg = neg;
break;
- } else if (CUR != ']') {
+ } else {
xmlFAParsePosCharGroup(ctxt);
}
}
- ctxt->neg = n;
}
/**
xmlFAParseQuantExact(xmlRegParserCtxtPtr ctxt) {
int ret = 0;
int ok = 0;
+ int overflow = 0;
while ((CUR >= '0') && (CUR <= '9')) {
- ret = ret * 10 + (CUR - '0');
+ if (ret > INT_MAX / 10) {
+ overflow = 1;
+ } else {
+ int digit = CUR - '0';
+
+ ret *= 10;
+ if (ret > INT_MAX - digit)
+ overflow = 1;
+ else
+ ret += digit;
+ }
ok = 1;
NEXT;
}
- if (ok != 1) {
+ if ((ok != 1) || (overflow == 1)) {
return(-1);
}
return(ret);
cur = xmlFAParseQuantExact(ctxt);
if (cur >= 0)
min = cur;
+ else {
+ ERROR("Improper quantifier");
+ }
if (CUR == ',') {
NEXT;
if (CUR == '}')
xmlRegStatePtr start, oldend, start0;
NEXT;
+ if (ctxt->depth >= 50) {
+ ERROR("xmlFAParseAtom: maximum nesting depth exceeded");
+ return(-1);
+ }
/*
* this extra Epsilon transition is needed if we count with 0 allowed
* unfortunately this can't be known at that point
oldend = ctxt->end;
ctxt->end = NULL;
ctxt->atom = NULL;
+ ctxt->depth++;
xmlFAParseRegExp(ctxt, 0);
+ ctxt->depth--;
if (CUR == ')') {
NEXT;
} else {
return(NULL);
if (min < 1)
return(NULL);
- if ((max < min) || (max < 1))
+ if (max < min)
return(NULL);
atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
if (atom == NULL)
return(NULL);
if (min < 1)
return(NULL);
- if ((max < min) || (max < 1))
+ if (max < min)
return(NULL);
atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
if (atom == NULL)
************************************************************************/
/**
* xmlSaveErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
* xmlSaveErr:
* @code: the error number
* @node: the location of the error.
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
static void
xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
#endif
-static void xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
static void xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
static int xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur);
static void
xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
xmlOutputBufferPtr buf;
+ xmlNodePtr cur;
int format, level;
if (dtd == NULL) return;
level = ctxt->level;
ctxt->format = 0;
ctxt->level = -1;
- xmlNodeListDumpOutput(ctxt, dtd->children);
+ for (cur = dtd->children; cur != NULL; cur = cur->next) {
+ xmlNodeDumpOutputInternal(ctxt, cur);
+ }
ctxt->format = format;
ctxt->level = level;
xmlOutputBufferWrite(buf, 2, "]>");
xmlOutputBufferWrite(buf, 1, "\"");
}
-/**
- * xmlAttrListDumpOutput:
- * @buf: the XML buffer output
- * @doc: the document
- * @cur: the first attribute pointer
- * @encoding: an optional encoding string
- *
- * Dump a list of XML attributes
- */
-static void
-xmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
- if (cur == NULL) return;
- while (cur != NULL) {
- xmlAttrDumpOutput(ctxt, cur);
- cur = cur->next;
- }
-}
-
-
-
-/**
- * xmlNodeListDumpOutput:
- * @cur: the first node
- *
- * Dump an XML node list, recursive behaviour, children are printed too.
- */
-static void
-xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- xmlOutputBufferPtr buf;
-
- if (cur == NULL) return;
- buf = ctxt->buf;
- while (cur != NULL) {
- if ((ctxt->format == 1) && (xmlIndentTreeOutput) &&
- ((cur->type == XML_ELEMENT_NODE) ||
- (cur->type == XML_COMMENT_NODE) ||
- (cur->type == XML_PI_NODE)))
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level),
- ctxt->indent);
- xmlNodeDumpOutputInternal(ctxt, cur);
- if (ctxt->format == 1) {
- xmlOutputBufferWrite(buf, 1, "\n");
- }
- cur = cur->next;
- }
-}
-
#ifdef LIBXML_HTML_ENABLED
/**
- * xmlNodeDumpOutputInternal:
+ * htmlNodeDumpOutputInternal:
* @cur: the current node
*
* Dump an HTML node, recursive behaviour, children are printed too.
*/
static void
xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- int format;
- xmlNodePtr tmp;
+ int format = ctxt->format;
+ xmlNodePtr tmp, root, unformattedNode = NULL;
+ xmlAttrPtr attr;
xmlChar *start, *end;
xmlOutputBufferPtr buf;
if (cur == NULL) return;
buf = ctxt->buf;
- if (cur->type == XML_XINCLUDE_START)
- return;
- if (cur->type == XML_XINCLUDE_END)
- return;
- if ((cur->type == XML_DOCUMENT_NODE) ||
- (cur->type == XML_HTML_DOCUMENT_NODE)) {
- xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
- return;
- }
-#ifdef LIBXML_HTML_ENABLED
- if (ctxt->options & XML_SAVE_XHTML) {
- xhtmlNodeDumpOutput(ctxt, cur);
- return;
- }
- if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) &&
- (cur->doc->type == XML_HTML_DOCUMENT_NODE) &&
- ((ctxt->options & XML_SAVE_AS_XML) == 0)) ||
- (ctxt->options & XML_SAVE_AS_HTML)) {
- htmlNodeDumpOutputInternal(ctxt, cur);
- return;
- }
-#endif
- if (cur->type == XML_DTD_NODE) {
- xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
- return;
- }
- if (cur->type == XML_DOCUMENT_FRAG_NODE) {
- xmlNodeListDumpOutput(ctxt, cur->children);
- return;
- }
- if (cur->type == XML_ELEMENT_DECL) {
- xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
- return;
- }
- if (cur->type == XML_ATTRIBUTE_DECL) {
- xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
- return;
- }
- if (cur->type == XML_ENTITY_DECL) {
- xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
- return;
- }
- if (cur->type == XML_TEXT_NODE) {
- if (cur->content != NULL) {
+
+ root = cur;
+ while (1) {
+ switch (cur->type) {
+ case XML_DOCUMENT_NODE:
+ case XML_HTML_DOCUMENT_NODE:
+ xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
+ break;
+
+ case XML_DTD_NODE:
+ xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
+ break;
+
+ case XML_DOCUMENT_FRAG_NODE:
+ if (cur->children != NULL) {
+ cur = cur->children;
+ continue;
+ }
+ break;
+
+ case XML_ELEMENT_DECL:
+ xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
+ break;
+
+ case XML_ATTRIBUTE_DECL:
+ xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
+ break;
+
+ case XML_ENTITY_DECL:
+ xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
+ break;
+
+ case XML_ELEMENT_NODE:
+ if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ xmlOutputBufferWrite(buf, 1, "<");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->nsDef)
+ xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
+ for (attr = cur->properties; attr != NULL; attr = attr->next)
+ xmlAttrDumpOutput(ctxt, attr);
+
+ if (cur->children == NULL) {
+ if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 0);
+ xmlOutputBufferWrite(buf, 2, "/>");
+ } else {
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 1);
+ xmlOutputBufferWrite(buf, 3, "></");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 0);
+ xmlOutputBufferWrite(buf, 1, ">");
+ }
+ } else {
+ if (ctxt->format == 1) {
+ tmp = cur->children;
+ while (tmp != NULL) {
+ if ((tmp->type == XML_TEXT_NODE) ||
+ (tmp->type == XML_CDATA_SECTION_NODE) ||
+ (tmp->type == XML_ENTITY_REF_NODE)) {
+ ctxt->format = 0;
+ unformattedNode = cur;
+ break;
+ }
+ tmp = tmp->next;
+ }
+ }
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 1);
+ xmlOutputBufferWrite(buf, 1, ">");
+ if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+ if (ctxt->level >= 0) ctxt->level++;
+ cur = cur->children;
+ continue;
+ }
+
+ break;
+
+ case XML_TEXT_NODE:
+ if (cur->content == NULL)
+ break;
if (cur->name != xmlStringTextNoenc) {
xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
} else {
*/
xmlOutputBufferWriteString(buf, (const char *) cur->content);
}
- }
+ break;
- return;
- }
- if (cur->type == XML_PI_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWrite(buf, 2, "<?");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->content != NULL) {
- if (ctxt->format == 2)
- xmlOutputBufferWriteWSNonSig(ctxt, 0);
- else
- xmlOutputBufferWrite(buf, 1, " ");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- }
- xmlOutputBufferWrite(buf, 2, "?>");
- } else {
- xmlOutputBufferWrite(buf, 2, "<?");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (ctxt->format == 2)
- xmlOutputBufferWriteWSNonSig(ctxt, 0);
- xmlOutputBufferWrite(buf, 2, "?>");
- }
- return;
- }
- if (cur->type == XML_COMMENT_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWrite(buf, 4, "<!--");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- xmlOutputBufferWrite(buf, 3, "-->");
- }
- return;
- }
- if (cur->type == XML_ENTITY_REF_NODE) {
- xmlOutputBufferWrite(buf, 1, "&");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWrite(buf, 1, ";");
- return;
- }
- if (cur->type == XML_CDATA_SECTION_NODE) {
- if (cur->content == NULL || *cur->content == '\0') {
- xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
- } else {
- start = end = cur->content;
- while (*end != '\0') {
- if ((*end == ']') && (*(end + 1) == ']') &&
- (*(end + 2) == '>')) {
- end = end + 2;
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWrite(buf, end - start, (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- start = end;
- }
- end++;
- }
- if (start != end) {
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWriteString(buf, (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- }
- }
- return;
- }
- if (cur->type == XML_ATTRIBUTE_NODE) {
- xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
- return;
- }
- if (cur->type == XML_NAMESPACE_DECL) {
- xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
- return;
- }
+ case XML_PI_NODE:
+ if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ if (cur->content != NULL) {
+ xmlOutputBufferWrite(buf, 2, "<?");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->content != NULL) {
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 0);
+ else
+ xmlOutputBufferWrite(buf, 1, " ");
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->content);
+ }
+ xmlOutputBufferWrite(buf, 2, "?>");
+ } else {
+ xmlOutputBufferWrite(buf, 2, "<?");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 0);
+ xmlOutputBufferWrite(buf, 2, "?>");
+ }
+ break;
+
+ case XML_COMMENT_NODE:
+ if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ if (cur->content != NULL) {
+ xmlOutputBufferWrite(buf, 4, "<!--");
+ xmlOutputBufferWriteString(buf, (const char *)cur->content);
+ xmlOutputBufferWrite(buf, 3, "-->");
+ }
+ break;
+
+ case XML_ENTITY_REF_NODE:
+ xmlOutputBufferWrite(buf, 1, "&");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWrite(buf, 1, ";");
+ break;
+
+ case XML_CDATA_SECTION_NODE:
+ if (cur->content == NULL || *cur->content == '\0') {
+ xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
+ } else {
+ start = end = cur->content;
+ while (*end != '\0') {
+ if ((*end == ']') && (*(end + 1) == ']') &&
+ (*(end + 2) == '>')) {
+ end = end + 2;
+ xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+ xmlOutputBufferWrite(buf, end - start,
+ (const char *)start);
+ xmlOutputBufferWrite(buf, 3, "]]>");
+ start = end;
+ }
+ end++;
+ }
+ if (start != end) {
+ xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+ xmlOutputBufferWriteString(buf, (const char *)start);
+ xmlOutputBufferWrite(buf, 3, "]]>");
+ }
+ }
+ break;
- format = ctxt->format;
- if (format == 1) {
- tmp = cur->children;
- while (tmp != NULL) {
- if ((tmp->type == XML_TEXT_NODE) ||
- (tmp->type == XML_CDATA_SECTION_NODE) ||
- (tmp->type == XML_ENTITY_REF_NODE)) {
- ctxt->format = 0;
- break;
- }
- tmp = tmp->next;
- }
- }
- xmlOutputBufferWrite(buf, 1, "<");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWrite(buf, 1, ":");
- }
+ case XML_ATTRIBUTE_NODE:
+ xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
+ break;
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->nsDef)
- xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
- if (cur->properties != NULL)
- xmlAttrListDumpOutput(ctxt, cur->properties);
-
- if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
- (cur->children == NULL) && ((ctxt->options & XML_SAVE_NO_EMPTY) == 0)) {
- if (ctxt->format == 2)
- xmlOutputBufferWriteWSNonSig(ctxt, 0);
- xmlOutputBufferWrite(buf, 2, "/>");
- ctxt->format = format;
- return;
- }
- if (ctxt->format == 2)
- xmlOutputBufferWriteWSNonSig(ctxt, 1);
- xmlOutputBufferWrite(buf, 1, ">");
- if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
- xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
- }
- if (cur->children != NULL) {
- if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
- if (ctxt->level >= 0) ctxt->level++;
- xmlNodeListDumpOutput(ctxt, cur->children);
- if (ctxt->level > 0) ctxt->level--;
- if ((xmlIndentTreeOutput) && (ctxt->format == 1))
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level),
- ctxt->indent);
- }
- xmlOutputBufferWrite(buf, 2, "</");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWrite(buf, 1, ":");
- }
+ case XML_NAMESPACE_DECL:
+ xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
+ break;
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (ctxt->format == 2)
- xmlOutputBufferWriteWSNonSig(ctxt, 0);
- xmlOutputBufferWrite(buf, 1, ">");
- ctxt->format = format;
+ default:
+ break;
+ }
+
+ while (1) {
+ if (cur == root)
+ return;
+ if ((ctxt->format == 1) &&
+ (cur->type != XML_XINCLUDE_START) &&
+ (cur->type != XML_XINCLUDE_END))
+ xmlOutputBufferWrite(buf, 1, "\n");
+ if (cur->next != NULL) {
+ cur = cur->next;
+ break;
+ }
+
+ /*
+ * The parent should never be NULL here but we want to handle
+ * corrupted documents gracefully.
+ */
+ if (cur->parent == NULL)
+ return;
+ cur = cur->parent;
+
+ if (cur->type == XML_ELEMENT_NODE) {
+ if (ctxt->level > 0) ctxt->level--;
+ if ((xmlIndentTreeOutput) && (ctxt->format == 1))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ xmlOutputBufferWrite(buf, 2, "</");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
+
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (ctxt->format == 2)
+ xmlOutputBufferWriteWSNonSig(ctxt, 0);
+ xmlOutputBufferWrite(buf, 1, ">");
+
+ if (cur == unformattedNode) {
+ ctxt->format = format;
+ unformattedNode = NULL;
+ }
+ }
+ }
+ }
}
/**
else
#endif
xmlNodeDumpOutputInternal(ctxt, child);
- xmlOutputBufferWrite(buf, 1, "\n");
+ if ((child->type != XML_XINCLUDE_START) &&
+ (child->type != XML_XINCLUDE_END))
+ xmlOutputBufferWrite(buf, 1, "\n");
child = child->next;
}
}
}
/**
- * xhtmlNodeListDumpOutput:
- * @buf: the XML buffer output
- * @doc: the XHTML document
- * @cur: the first node
- * @level: the imbrication level for indenting
- * @format: is formatting allowed
- * @encoding: an optional encoding string
- *
- * Dump an XML node list, recursive behaviour, children are printed too.
- * Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
- * or xmlKeepBlanksDefault(0) was called
- */
-static void
-xhtmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- xmlOutputBufferPtr buf;
-
- if (cur == NULL) return;
- buf = ctxt->buf;
- while (cur != NULL) {
- if ((ctxt->format == 1) && (xmlIndentTreeOutput) &&
- (cur->type == XML_ELEMENT_NODE))
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level),
- ctxt->indent);
- xhtmlNodeDumpOutput(ctxt, cur);
- if (ctxt->format == 1) {
- xmlOutputBufferWrite(buf, 1, "\n");
- }
- cur = cur->next;
- }
-}
-
-/**
* xhtmlNodeDumpOutput:
* @buf: the XML buffer output
* @doc: the XHTML document
*/
static void
xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- int format, addmeta = 0;
- xmlNodePtr tmp;
+ int format = ctxt->format, addmeta;
+ xmlNodePtr tmp, root, unformattedNode = NULL;
xmlChar *start, *end;
- xmlOutputBufferPtr buf;
+ xmlOutputBufferPtr buf = ctxt->buf;
if (cur == NULL) return;
- if ((cur->type == XML_DOCUMENT_NODE) ||
- (cur->type == XML_HTML_DOCUMENT_NODE)) {
- xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
- return;
- }
- if (cur->type == XML_XINCLUDE_START)
- return;
- if (cur->type == XML_XINCLUDE_END)
- return;
- if (cur->type == XML_NAMESPACE_DECL) {
- xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
- return;
- }
- if (cur->type == XML_DTD_NODE) {
- xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
- return;
- }
- if (cur->type == XML_DOCUMENT_FRAG_NODE) {
- xhtmlNodeListDumpOutput(ctxt, cur->children);
- return;
- }
- buf = ctxt->buf;
- if (cur->type == XML_ELEMENT_DECL) {
- xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
- return;
- }
- if (cur->type == XML_ATTRIBUTE_DECL) {
- xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
- return;
- }
- if (cur->type == XML_ENTITY_DECL) {
- xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
- return;
- }
- if (cur->type == XML_TEXT_NODE) {
- if (cur->content != NULL) {
+
+ root = cur;
+ while (1) {
+ switch (cur->type) {
+ case XML_DOCUMENT_NODE:
+ case XML_HTML_DOCUMENT_NODE:
+ xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
+ break;
+
+ case XML_NAMESPACE_DECL:
+ xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
+ break;
+
+ case XML_DTD_NODE:
+ xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
+ break;
+
+ case XML_DOCUMENT_FRAG_NODE:
+ if (cur->children) {
+ cur = cur->children;
+ continue;
+ }
+ break;
+
+ case XML_ELEMENT_DECL:
+ xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
+ break;
+
+ case XML_ATTRIBUTE_DECL:
+ xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
+ break;
+
+ case XML_ENTITY_DECL:
+ xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
+ break;
+
+ case XML_ELEMENT_NODE:
+ addmeta = 0;
+
+ if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ xmlOutputBufferWrite(buf, 1, "<");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
+
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->nsDef)
+ xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
+ if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
+ (cur->ns == NULL) && (cur->nsDef == NULL))) {
+ /*
+ * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
+ */
+ xmlOutputBufferWriteString(buf,
+ " xmlns=\"http://www.w3.org/1999/xhtml\"");
+ }
+ if (cur->properties != NULL)
+ xhtmlAttrListDumpOutput(ctxt, cur->properties);
+
+ if ((cur->parent != NULL) &&
+ (cur->parent->parent == (xmlNodePtr) cur->doc) &&
+ xmlStrEqual(cur->name, BAD_CAST"head") &&
+ xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
+
+ tmp = cur->children;
+ while (tmp != NULL) {
+ if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
+ xmlChar *httpequiv;
+
+ httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv");
+ if (httpequiv != NULL) {
+ if (xmlStrcasecmp(httpequiv,
+ BAD_CAST"Content-Type") == 0) {
+ xmlFree(httpequiv);
+ break;
+ }
+ xmlFree(httpequiv);
+ }
+ }
+ tmp = tmp->next;
+ }
+ if (tmp == NULL)
+ addmeta = 1;
+ }
+
+ if (cur->children == NULL) {
+ if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
+ ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
+ /*
+ * C.2. Empty Elements
+ */
+ xmlOutputBufferWrite(buf, 3, " />");
+ } else {
+ if (addmeta == 1) {
+ xmlOutputBufferWrite(buf, 1, ">");
+ if (ctxt->format == 1) {
+ xmlOutputBufferWrite(buf, 1, "\n");
+ if (xmlIndentTreeOutput)
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level + 1 > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level + 1),
+ ctxt->indent);
+ }
+ xmlOutputBufferWriteString(buf,
+ "<meta http-equiv=\"Content-Type\" "
+ "content=\"text/html; charset=");
+ if (ctxt->encoding) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)ctxt->encoding);
+ } else {
+ xmlOutputBufferWrite(buf, 5, "UTF-8");
+ }
+ xmlOutputBufferWrite(buf, 4, "\" />");
+ if (ctxt->format == 1)
+ xmlOutputBufferWrite(buf, 1, "\n");
+ } else {
+ xmlOutputBufferWrite(buf, 1, ">");
+ }
+ /*
+ * C.3. Element Minimization and Empty Element Content
+ */
+ xmlOutputBufferWrite(buf, 2, "</");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWrite(buf, 1, ">");
+ }
+ } else {
+ xmlOutputBufferWrite(buf, 1, ">");
+ if (addmeta == 1) {
+ if (ctxt->format == 1) {
+ xmlOutputBufferWrite(buf, 1, "\n");
+ if (xmlIndentTreeOutput)
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level + 1 > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level + 1),
+ ctxt->indent);
+ }
+ xmlOutputBufferWriteString(buf,
+ "<meta http-equiv=\"Content-Type\" "
+ "content=\"text/html; charset=");
+ if (ctxt->encoding) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)ctxt->encoding);
+ } else {
+ xmlOutputBufferWrite(buf, 5, "UTF-8");
+ }
+ xmlOutputBufferWrite(buf, 4, "\" />");
+ }
+
+ if (ctxt->format == 1) {
+ tmp = cur->children;
+ while (tmp != NULL) {
+ if ((tmp->type == XML_TEXT_NODE) ||
+ (tmp->type == XML_ENTITY_REF_NODE)) {
+ unformattedNode = cur;
+ ctxt->format = 0;
+ break;
+ }
+ tmp = tmp->next;
+ }
+ }
+
+ if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+ if (ctxt->level >= 0) ctxt->level++;
+ cur = cur->children;
+ continue;
+ }
+
+ break;
+
+ case XML_TEXT_NODE:
+ if (cur->content == NULL)
+ break;
if ((cur->name == xmlStringText) ||
(cur->name != xmlStringTextNoenc)) {
xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
*/
xmlOutputBufferWriteString(buf, (const char *) cur->content);
}
- }
-
- return;
- }
- if (cur->type == XML_PI_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWrite(buf, 2, "<?");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->content != NULL) {
- xmlOutputBufferWrite(buf, 1, " ");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- }
- xmlOutputBufferWrite(buf, 2, "?>");
- } else {
- xmlOutputBufferWrite(buf, 2, "<?");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWrite(buf, 2, "?>");
- }
- return;
- }
- if (cur->type == XML_COMMENT_NODE) {
- if (cur->content != NULL) {
- xmlOutputBufferWrite(buf, 4, "<!--");
- xmlOutputBufferWriteString(buf, (const char *)cur->content);
- xmlOutputBufferWrite(buf, 3, "-->");
- }
- return;
- }
- if (cur->type == XML_ENTITY_REF_NODE) {
- xmlOutputBufferWrite(buf, 1, "&");
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWrite(buf, 1, ";");
- return;
- }
- if (cur->type == XML_CDATA_SECTION_NODE) {
- if (cur->content == NULL || *cur->content == '\0') {
- xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
- } else {
- start = end = cur->content;
- while (*end != '\0') {
- if (*end == ']' && *(end + 1) == ']' && *(end + 2) == '>') {
- end = end + 2;
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWrite(buf, end - start, (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- start = end;
- }
- end++;
- }
- if (start != end) {
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWriteString(buf, (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- }
- }
- return;
- }
- if (cur->type == XML_ATTRIBUTE_NODE) {
- xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
- return;
- }
+ break;
- format = ctxt->format;
- if (format == 1) {
- tmp = cur->children;
- while (tmp != NULL) {
- if ((tmp->type == XML_TEXT_NODE) ||
- (tmp->type == XML_ENTITY_REF_NODE)) {
- format = 0;
- break;
- }
- tmp = tmp->next;
- }
- }
- xmlOutputBufferWrite(buf, 1, "<");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWrite(buf, 1, ":");
- }
+ case XML_PI_NODE:
+ if (cur->content != NULL) {
+ xmlOutputBufferWrite(buf, 2, "<?");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ if (cur->content != NULL) {
+ xmlOutputBufferWrite(buf, 1, " ");
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->content);
+ }
+ xmlOutputBufferWrite(buf, 2, "?>");
+ } else {
+ xmlOutputBufferWrite(buf, 2, "<?");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWrite(buf, 2, "?>");
+ }
+ break;
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- if (cur->nsDef)
- xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
- if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
- (cur->ns == NULL) && (cur->nsDef == NULL))) {
- /*
- * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
- */
- xmlOutputBufferWriteString(buf,
- " xmlns=\"http://www.w3.org/1999/xhtml\"");
- }
- if (cur->properties != NULL)
- xhtmlAttrListDumpOutput(ctxt, cur->properties);
-
- if ((cur->type == XML_ELEMENT_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->parent == (xmlNodePtr) cur->doc) &&
- xmlStrEqual(cur->name, BAD_CAST"head") &&
- xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
-
- tmp = cur->children;
- while (tmp != NULL) {
- if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
- xmlChar *httpequiv;
-
- httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv");
- if (httpequiv != NULL) {
- if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) {
- xmlFree(httpequiv);
- break;
+ case XML_COMMENT_NODE:
+ if (cur->content != NULL) {
+ xmlOutputBufferWrite(buf, 4, "<!--");
+ xmlOutputBufferWriteString(buf, (const char *)cur->content);
+ xmlOutputBufferWrite(buf, 3, "-->");
+ }
+ break;
+
+ case XML_ENTITY_REF_NODE:
+ xmlOutputBufferWrite(buf, 1, "&");
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWrite(buf, 1, ";");
+ break;
+
+ case XML_CDATA_SECTION_NODE:
+ if (cur->content == NULL || *cur->content == '\0') {
+ xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
+ } else {
+ start = end = cur->content;
+ while (*end != '\0') {
+ if (*end == ']' && *(end + 1) == ']' &&
+ *(end + 2) == '>') {
+ end = end + 2;
+ xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+ xmlOutputBufferWrite(buf, end - start,
+ (const char *)start);
+ xmlOutputBufferWrite(buf, 3, "]]>");
+ start = end;
}
- xmlFree(httpequiv);
+ end++;
+ }
+ if (start != end) {
+ xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+ xmlOutputBufferWriteString(buf, (const char *)start);
+ xmlOutputBufferWrite(buf, 3, "]]>");
}
}
- tmp = tmp->next;
+ break;
+
+ case XML_ATTRIBUTE_NODE:
+ xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
+ break;
+
+ default:
+ break;
}
- if (tmp == NULL)
- addmeta = 1;
- }
- if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) {
- if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
- ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
- /*
- * C.2. Empty Elements
- */
- xmlOutputBufferWrite(buf, 3, " />");
- } else {
- if (addmeta == 1) {
- xmlOutputBufferWrite(buf, 1, ">");
- if (ctxt->format == 1) {
- xmlOutputBufferWrite(buf, 1, "\n");
- if (xmlIndentTreeOutput)
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level + 1 > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level + 1), ctxt->indent);
- }
- xmlOutputBufferWriteString(buf,
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
- if (ctxt->encoding) {
- xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
- } else {
- xmlOutputBufferWrite(buf, 5, "UTF-8");
- }
- xmlOutputBufferWrite(buf, 4, "\" />");
- if (ctxt->format == 1)
- xmlOutputBufferWrite(buf, 1, "\n");
- } else {
- xmlOutputBufferWrite(buf, 1, ">");
- }
- /*
- * C.3. Element Minimization and Empty Element Content
- */
- xmlOutputBufferWrite(buf, 2, "</");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWrite(buf, 1, ":");
- }
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWrite(buf, 1, ">");
- }
- return;
- }
- xmlOutputBufferWrite(buf, 1, ">");
- if (addmeta == 1) {
- if (ctxt->format == 1) {
- xmlOutputBufferWrite(buf, 1, "\n");
- if (xmlIndentTreeOutput)
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level + 1 > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level + 1), ctxt->indent);
- }
- xmlOutputBufferWriteString(buf,
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
- if (ctxt->encoding) {
- xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
- } else {
- xmlOutputBufferWrite(buf, 5, "UTF-8");
- }
- xmlOutputBufferWrite(buf, 4, "\" />");
- }
- if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
- xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
- }
+ while (1) {
+ if (cur == root)
+ return;
+ if (ctxt->format == 1)
+ xmlOutputBufferWrite(buf, 1, "\n");
+ if (cur->next != NULL) {
+ cur = cur->next;
+ break;
+ }
-#if 0
- /*
- * This was removed due to problems with HTML processors.
- * See bug #345147.
- */
- /*
- * 4.8. Script and Style elements
- */
- if ((cur->type == XML_ELEMENT_NODE) &&
- ((xmlStrEqual(cur->name, BAD_CAST "script")) ||
- (xmlStrEqual(cur->name, BAD_CAST "style"))) &&
- ((cur->ns == NULL) ||
- (xmlStrEqual(cur->ns->href, XHTML_NS_NAME)))) {
- xmlNodePtr child = cur->children;
-
- while (child != NULL) {
- if (child->type == XML_TEXT_NODE) {
- if ((xmlStrchr(child->content, '<') == NULL) &&
- (xmlStrchr(child->content, '&') == NULL) &&
- (xmlStrstr(child->content, BAD_CAST "]]>") == NULL)) {
- /* Nothing to escape, so just output as is... */
- /* FIXME: Should we do something about "--" also? */
- int level = ctxt->level;
- int indent = ctxt->format;
-
- ctxt->level = 0;
- ctxt->format = 0;
- xmlOutputBufferWriteString(buf, (const char *) child->content);
- /* (We cannot use xhtmlNodeDumpOutput() here because
- * we wish to leave '>' unescaped!) */
- ctxt->level = level;
- ctxt->format = indent;
- } else {
- /* We must use a CDATA section. Unfortunately,
- * this will break CSS and JavaScript when read by
- * a browser in HTML4-compliant mode. :-( */
- start = end = child->content;
- while (*end != '\0') {
- if (*end == ']' &&
- *(end + 1) == ']' &&
- *(end + 2) == '>') {
- end = end + 2;
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWrite(buf, end - start,
- (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- start = end;
- }
- end++;
- }
- if (start != end) {
- xmlOutputBufferWrite(buf, 9, "<![CDATA[");
- xmlOutputBufferWrite(buf, end - start,
- (const char *)start);
- xmlOutputBufferWrite(buf, 3, "]]>");
- }
- }
- } else {
- int level = ctxt->level;
- int indent = ctxt->format;
+ /*
+ * The parent should never be NULL here but we want to handle
+ * corrupted documents gracefully.
+ */
+ if (cur->parent == NULL)
+ return;
+ cur = cur->parent;
+
+ if (cur->type == XML_ELEMENT_NODE) {
+ if (ctxt->level > 0) ctxt->level--;
+ if ((xmlIndentTreeOutput) && (ctxt->format == 1))
+ xmlOutputBufferWrite(buf, ctxt->indent_size *
+ (ctxt->level > ctxt->indent_nr ?
+ ctxt->indent_nr : ctxt->level),
+ ctxt->indent);
+
+ xmlOutputBufferWrite(buf, 2, "</");
+ if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+ xmlOutputBufferWriteString(buf,
+ (const char *)cur->ns->prefix);
+ xmlOutputBufferWrite(buf, 1, ":");
+ }
- ctxt->level = 0;
- ctxt->format = 0;
- xhtmlNodeDumpOutput(ctxt, child);
- ctxt->level = level;
- ctxt->format = indent;
- }
- child = child->next;
- }
- }
-#endif
+ xmlOutputBufferWriteString(buf, (const char *)cur->name);
+ xmlOutputBufferWrite(buf, 1, ">");
- if (cur->children != NULL) {
- int indent = ctxt->format;
-
- if (format == 1) xmlOutputBufferWrite(buf, 1, "\n");
- if (ctxt->level >= 0) ctxt->level++;
- ctxt->format = format;
- xhtmlNodeListDumpOutput(ctxt, cur->children);
- if (ctxt->level > 0) ctxt->level--;
- ctxt->format = indent;
- if ((xmlIndentTreeOutput) && (format == 1))
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level),
- ctxt->indent);
- }
- xmlOutputBufferWrite(buf, 2, "</");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
- xmlOutputBufferWrite(buf, 1, ":");
+ if (cur == unformattedNode) {
+ ctxt->format = format;
+ unformattedNode = NULL;
+ }
+ }
+ }
}
-
- xmlOutputBufferWriteString(buf, (const char *)cur->name);
- xmlOutputBufferWrite(buf, 1, ">");
}
#endif
if (ret == NULL) return(NULL);
ret->buf = xmlOutputBufferCreateFd(fd, ret->handler);
if (ret->buf == NULL) {
+ xmlCharEncCloseFunc(ret->handler);
xmlFreeSaveCtxt(ret);
return(NULL);
}
ret->buf = xmlOutputBufferCreateFilename(filename, ret->handler,
compression);
if (ret->buf == NULL) {
+ xmlCharEncCloseFunc(ret->handler);
xmlFreeSaveCtxt(ret);
return(NULL);
}
xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options)
{
xmlSaveCtxtPtr ret;
- xmlOutputBufferPtr out_buff;
- xmlCharEncodingHandlerPtr handler;
ret = xmlNewSaveCtxt(encoding, options);
if (ret == NULL) return(NULL);
-
- if (encoding != NULL) {
- handler = xmlFindCharEncodingHandler(encoding);
- if (handler == NULL) {
- xmlFree(ret);
- return(NULL);
- }
- } else
- handler = NULL;
- out_buff = xmlOutputBufferCreateBuffer(buffer, handler);
- if (out_buff == NULL) {
- xmlFree(ret);
- if (handler) xmlCharEncCloseFunc(handler);
- return(NULL);
+ ret->buf = xmlOutputBufferCreateBuffer(buffer, ret->handler);
+ if (ret->buf == NULL) {
+ xmlCharEncCloseFunc(ret->handler);
+ xmlFreeSaveCtxt(ret);
+ return(NULL);
}
-
- ret->buf = out_buff;
return(ret);
}
if (ret == NULL) return(NULL);
ret->buf = xmlOutputBufferCreateIO(iowrite, ioclose, ioctx, ret->handler);
if (ret->buf == NULL) {
+ xmlCharEncCloseFunc(ret->handler);
xmlFreeSaveCtxt(ret);
return(NULL);
}
* Returns the number of byte written or -1 in case of error
*/
long
-xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr node)
+xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur)
{
long ret = 0;
- if ((ctxt == NULL) || (node == NULL)) return(-1);
- xmlNodeDumpOutputInternal(ctxt, node);
+ if ((ctxt == NULL) || (cur == NULL)) return(-1);
+#ifdef LIBXML_HTML_ENABLED
+ if (ctxt->options & XML_SAVE_XHTML) {
+ xhtmlNodeDumpOutput(ctxt, cur);
+ return(ret);
+ }
+ if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) &&
+ (cur->doc->type == XML_HTML_DOCUMENT_NODE) &&
+ ((ctxt->options & XML_SAVE_AS_XML) == 0)) ||
+ (ctxt->options & XML_SAVE_AS_HTML)) {
+ htmlNodeDumpOutputInternal(ctxt, cur);
+ return(ret);
+ }
+#endif
+ xmlNodeDumpOutputInternal(ctxt, cur);
return(ret);
}
int format)
{
xmlBufPtr buffer;
- int ret;
+ size_t ret;
if ((buf == NULL) || (cur == NULL))
return(-1);
int sizeKeySeqs;
xmlSchemaItemListPtr targets; /* list of target-node
(xmlSchemaPSVIIDCNodePtr) entries */
+ xmlHashTablePtr htab;
};
/*
int xsiAssemble;
int depth;
- xmlSchemaNodeInfoPtr *elemInfos; /* array of element informations */
+ xmlSchemaNodeInfoPtr *elemInfos; /* array of element information */
int sizeElemInfos;
xmlSchemaNodeInfoPtr inode; /* the current element information */
- xmlSchemaIDCAugPtr aidcs; /* a list of augmented IDC informations */
+ xmlSchemaIDCAugPtr aidcs; /* a list of augmented IDC information */
xmlSchemaIDCStateObjPtr xpathStates; /* first active state object. */
xmlSchemaIDCStateObjPtr xpathStatePool; /* first stored state object. */
xmlSchemaItemListPtr members;
};
+/**
+ * xmlIDCHashEntry:
+ *
+ * an entry in hash tables to quickly look up keys/uniques
+ */
+typedef struct _xmlIDCHashEntry xmlIDCHashEntry;
+typedef xmlIDCHashEntry *xmlIDCHashEntryPtr;
+struct _xmlIDCHashEntry {
+ xmlIDCHashEntryPtr next; /* next item with same hash */
+ int index; /* index into associated item list */
+};
+
/************************************************************************
* *
* Some predeclarations *
* @val: the precomputed value
* @retValue: the returned value
* @ws: the whitespace type of the value
+ * @for_hash: non-zero if this is supposed to generate a string for hashing
*
* Get a the canonical representation of the value.
* The caller has to free the returned retValue.
* API errors or if the value type is not supported yet.
*/
static int
-xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
- xmlSchemaWhitespaceValueType ws,
- xmlChar **retValue)
+xmlSchemaGetCanonValueWhtspExt_1(xmlSchemaValPtr val,
+ xmlSchemaWhitespaceValueType ws,
+ xmlChar **retValue,
+ int for_hash)
{
int list;
xmlSchemaValType valType;
xmlFree((xmlChar *) value2);
goto internal_error;
}
+ if (for_hash && valType == XML_SCHEMAS_DECIMAL) {
+ /* We can mostly use the canonical value for hashing,
+ except in the case of decimal. There the canonical
+ representation requires a trailing '.0' even for
+ non-fractional numbers, but for the derived integer
+ types it forbids any decimal point. Nevertheless they
+ compare equal if the value is equal. We need to generate
+ the same hash value for this to work, and it's easiest
+ to just cut off the useless '.0' suffix for the
+ decimal type. */
+ int len = xmlStrlen(value2);
+ if (len > 2 && value2[len-1] == '0' && value2[len-2] == '.')
+ ((xmlChar*)value2)[len-2] = 0;
+ }
value = value2;
}
if (*retValue == NULL)
return (-1);
}
+static int
+xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
+ xmlSchemaWhitespaceValueType ws,
+ xmlChar **retValue)
+{
+ return xmlSchemaGetCanonValueWhtspExt_1(val, ws, retValue, 0);
+}
+
+static int
+xmlSchemaGetCanonValueHash(xmlSchemaValPtr val,
+ xmlChar **retValue)
+{
+ return xmlSchemaGetCanonValueWhtspExt_1(val, XML_SCHEMA_WHITESPACE_COLLAPSE,
+ retValue, 1);
+}
+
/**
* xmlSchemaFormatItemForReport:
* @buf: the string buffer
/**
* xmlSchemaPErrMemory:
* @node: a context node
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
/**
* xmlSchemaVTypeErrMemory:
* @node: a context node
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
/**
* xmlGetMaxOccurs:
* @ctxt: a schema validation context
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Get the maxOccurs property
*
return (def);
}
while ((*cur >= '0') && (*cur <= '9')) {
- ret = ret * 10 + (*cur - '0');
+ if (ret > INT_MAX / 10) {
+ ret = INT_MAX;
+ } else {
+ int digit = *cur - '0';
+ ret *= 10;
+ if (ret > INT_MAX - digit)
+ ret = INT_MAX;
+ else
+ ret += digit;
+ }
cur++;
}
while (IS_BLANK_CH(*cur))
/**
* xmlGetMinOccurs:
* @ctxt: a schema validation context
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Get the minOccurs property
*
return (def);
}
while ((*cur >= '0') && (*cur <= '9')) {
- ret = ret * 10 + (*cur - '0');
+ if (ret > INT_MAX / 10) {
+ ret = INT_MAX;
+ } else {
+ int digit = *cur - '0';
+ ret *= 10;
+ if (ret > INT_MAX - digit)
+ ret = INT_MAX;
+ else
+ ret += digit;
+ }
cur++;
}
while (IS_BLANK_CH(*cur))
/**
* xmlGetBooleanProp:
* @ctxt: a schema validation context
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
* @name: the attribute name
* @def: the default value
*
* xmlSchemaParseLocalAttributes:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
* @type: the hosting type where the attributes will be anchored
*
* Parses attribute uses and attribute declarations and
* xmlSchemaParseAnnotation:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Attribute declaration
* *WARNING* this interface is highly subject to change
* xmlSchemaParseFacet:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Facet declaration
* *WARNING* this interface is highly subject to change
* xmlSchemaParseWildcardNs:
* @ctxt: a schema parser context
* @wildc: the wildcard, already created
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parses the attribute "processContents" and "namespace"
* of a xsd:anyAttribute and xsd:any.
* xmlSchemaParseAny:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parsea a XML schema <any> element. A particle and wildcard
* will be created (except if minOccurs==maxOccurs==0, in this case
* xmlSchemaParseNotation:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Notation declaration
*
* xmlSchemaParseAnyAttribute:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema AnyAttribute declaration
* *WARNING* this interface is highly subject to change
* xmlSchemaParseAttribute:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Attribute declaration
* *WARNING* this interface is highly subject to change
* xmlSchemaParseAttributeGroupRef:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parse an attribute group definition reference.
* Note that a reference to an attribute group does not
* xmlSchemaParseAttributeGroupDefinition:
* @pctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Attribute Group declaration
* *WARNING* this interface is highly subject to change
* xmlSchemaParseIDCSelectorAndField:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parses a XML Schema identity-constraint definition's
* <selector> and <field> elements.
* xmlSchemaParseIDC:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parses a XML Schema identity-constraint definition.
*
* xmlSchemaParseElement:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
* @topLevel: indicates if this is global declaration
*
* Parses a XML schema element declaration.
* xmlSchemaParseUnion:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Union definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseList:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema List definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseSimpleType:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Simple Type definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseModelGroupDefinition:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parses a XML schema model group definition.
*
* xmlSchemaAddSchemaDoc:
* @pctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parse an included (and to-be-redefined) XML schema document.
*
* xmlSchemaParseImport:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Import definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseModelGroup:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
* @type: the "compositor" type
* @particleNeeded: if a a model group with a particle
*
* xmlSchemaParseRestriction:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Restriction definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseExtension:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* Parses an <extension>, which is found inside a
* <simpleContent> or <complexContent>.
* xmlSchemaParseSimpleContent:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema SimpleContent definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseComplexContent:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema ComplexContent definition
* *WARNING* this interface is highly subject to change
* xmlSchemaParseComplexType:
* @ctxt: a schema validation context
* @schema: the schema being built
- * @node: a subtree containing XML Schema informations
+ * @node: a subtree containing XML Schema information
*
* parse a XML schema Complex Type definition
* *WARNING* this interface is highly subject to change
return (NULL);
}
+#if 0
/**
* xmlSchemaGetParticleTotalRangeMin:
* @particle: the particle
}
}
-#if 0
/**
* xmlSchemaGetParticleTotalRangeMax:
* @particle: the particle
#endif
/**
+ * xmlSchemaGetParticleEmptiable:
+ * @particle: the particle
+ *
+ * Returns 1 if emptiable, 0 otherwise.
+ */
+static int
+xmlSchemaGetParticleEmptiable(xmlSchemaParticlePtr particle)
+{
+ xmlSchemaParticlePtr part;
+ int emptiable;
+
+ if ((particle->children == NULL) || (particle->minOccurs == 0))
+ return (1);
+
+ part = (xmlSchemaParticlePtr) particle->children->children;
+ if (part == NULL)
+ return (1);
+
+ while (part != NULL) {
+ if ((part->children->type == XML_SCHEMA_TYPE_ELEMENT) ||
+ (part->children->type == XML_SCHEMA_TYPE_ANY))
+ emptiable = (part->minOccurs == 0);
+ else
+ emptiable = xmlSchemaGetParticleEmptiable(part);
+ if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
+ if (emptiable)
+ return (1);
+ } else {
+ /* <all> and <sequence> */
+ if (!emptiable)
+ return (0);
+ }
+ part = (xmlSchemaParticlePtr) part->next;
+ }
+
+ if (particle->children->type == XML_SCHEMA_TYPE_CHOICE)
+ return (0);
+ else
+ return (1);
+}
+
+/**
* xmlSchemaIsParticleEmptiable:
* @particle: the particle
*
* SPEC (2) "Its {term} is a group and the minimum part of the
* effective total range of that group, [...] is 0."
*/
- if (WXS_IS_MODEL_GROUP(particle->children)) {
- if (xmlSchemaGetParticleTotalRangeMin(particle) == 0)
- return (1);
- }
+ if (WXS_IS_MODEL_GROUP(particle->children))
+ return (xmlSchemaGetParticleEmptiable(particle));
return (0);
}
}
if (ancestor->flags & XML_SCHEMAS_TYPE_MARKED) {
/*
- * Avoid inifinite recursion on circular types not yet checked.
+ * Avoid infinite recursion on circular types not yet checked.
*/
return (0);
}
break;
case XML_SCHEMA_EXTRA_ATTR_USE_PROHIB:
/*
- * Handle attribue prohibition which had a
+ * Handle attribute prohibition which had a
* "ref" attribute.
*/
xmlSchemaResolveAttrUseProhibReferences(
}
}
+static void
+xmlFreeIDCHashEntry (void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
+{
+ xmlIDCHashEntryPtr e = payload, n;
+ while (e) {
+ n = e->next;
+ xmlFree(e);
+ e = n;
+ }
+}
+
/**
* xmlSchemaIDCFreeMatcherList:
* @matcher: the first IDC matcher in the list
}
xmlSchemaItemListFree(matcher->targets);
}
+ if (matcher->htab != NULL)
+ xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
xmlFree(matcher);
matcher = next;
}
xmlSchemaItemListFree(matcher->targets);
matcher->targets = NULL;
}
+ if (matcher->htab != NULL) {
+ xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
+ matcher->htab = NULL;
+ }
matcher->next = NULL;
/*
* Cache the matcher.
}
static const xmlChar *
-xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
- xmlChar **buf,
- xmlSchemaPSVIIDCKeyPtr *seq,
- int count)
+xmlSchemaFormatIDCKeySequence_1(xmlSchemaValidCtxtPtr vctxt,
+ xmlChar **buf,
+ xmlSchemaPSVIIDCKeyPtr *seq,
+ int count, int for_hash)
{
int i, res;
xmlChar *value = NULL;
*buf = xmlStrdup(BAD_CAST "[");
for (i = 0; i < count; i++) {
*buf = xmlStrcat(*buf, BAD_CAST "'");
- res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
- xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
- &value);
+ if (!for_hash)
+ res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
+ xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
+ &value);
+ else {
+ res = xmlSchemaGetCanonValueHash(seq[i]->val, &value);
+ }
if (res == 0)
*buf = xmlStrcat(*buf, BAD_CAST value);
else {
return (BAD_CAST *buf);
}
+static const xmlChar *
+xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
+ xmlChar **buf,
+ xmlSchemaPSVIIDCKeyPtr *seq,
+ int count)
+{
+ return xmlSchemaFormatIDCKeySequence_1(vctxt, buf, seq, count, 0);
+}
+
+static const xmlChar *
+xmlSchemaHashKeySequence(xmlSchemaValidCtxtPtr vctxt,
+ xmlChar **buf,
+ xmlSchemaPSVIIDCKeyPtr *seq,
+ int count)
+{
+ return xmlSchemaFormatIDCKeySequence_1(vctxt, buf, seq, count, 1);
+}
+
/**
* xmlSchemaXPathPop:
* @vctxt: the WXS validation context
if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
(targets->nbItems != 0)) {
xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq;
+ xmlIDCHashEntryPtr e;
- i = 0;
res = 0;
+
+ if (!matcher->htab)
+ e = NULL;
+ else {
+ xmlChar *value = NULL;
+ xmlSchemaHashKeySequence(vctxt, &value, *keySeq, nbKeys);
+ e = xmlHashLookup(matcher->htab, value);
+ FREE_AND_NULL(value);
+ }
+
/*
* Compare the key-sequences, key by key.
*/
- do {
+ for (;e; e = e->next) {
bkeySeq =
- ((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys;
+ ((xmlSchemaPSVIIDCNodePtr) targets->items[e->index])->keys;
for (j = 0; j < nbKeys; j++) {
ckey = (*keySeq)[j];
bkey = bkeySeq[j];
*/
break;
}
- i++;
- } while (i < targets->nbItems);
- if (i != targets->nbItems) {
+ }
+ if (e) {
xmlChar *str = NULL, *strB = NULL;
/*
* TODO: Try to report the key-sequence.
}
return (-1);
}
+ if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) {
+ xmlChar *value = NULL;
+ xmlIDCHashEntryPtr r, e;
+ if (!matcher->htab)
+ matcher->htab = xmlHashCreate(4);
+ xmlSchemaHashKeySequence(vctxt, &value, ntItem->keys, nbKeys);
+ e = xmlMalloc(sizeof *e);
+ e->index = targets->nbItems - 1;
+ r = xmlHashLookup(matcher->htab, value);
+ if (r) {
+ e->next = r->next;
+ r->next = e;
+ } else {
+ e->next = NULL;
+ xmlHashAddEntry(matcher->htab, value, e);
+ }
+ FREE_AND_NULL(value);
+ }
goto selector_leave;
selector_key_error:
matcher->targets->items = NULL;
matcher->targets->sizeItems = 0;
matcher->targets->nbItems = 0;
+ if (matcher->htab) {
+ xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
+ matcher->htab = NULL;
+ }
} else {
/*
* Compare the key-sequences and add to the IDC node-table.
int i, j, k, res, nbFields, hasDupls;
xmlSchemaPSVIIDCKeyPtr *refKeys, *keys;
xmlSchemaPSVIIDCNodePtr refNode = NULL;
+ xmlHashTablePtr table = NULL;
nbFields = matcher->aidc->def->nbFields;
/*
* Search for a matching key-sequences.
*/
+ if (bind) {
+ table = xmlHashCreate(bind->nbNodes * 2);
+ for (j = 0; j < bind->nbNodes; j++) {
+ xmlChar *value;
+ xmlIDCHashEntryPtr r, e;
+ keys = bind->nodeTable[j]->keys;
+ xmlSchemaHashKeySequence(vctxt, &value, keys, nbFields);
+ e = xmlMalloc(sizeof *e);
+ e->index = j;
+ r = xmlHashLookup(table, value);
+ if (r) {
+ e->next = r->next;
+ r->next = e;
+ } else {
+ e->next = NULL;
+ xmlHashAddEntry(table, value, e);
+ }
+ FREE_AND_NULL(value);
+ }
+ }
for (i = 0; i < matcher->targets->nbItems; i++) {
res = 0;
refNode = matcher->targets->items[i];
if (bind != NULL) {
+ xmlChar *value;
+ xmlIDCHashEntryPtr e;
refKeys = refNode->keys;
- for (j = 0; j < bind->nbNodes; j++) {
- keys = bind->nodeTable[j]->keys;
+ xmlSchemaHashKeySequence(vctxt, &value, refKeys, nbFields);
+ e = xmlHashLookup(table, value);
+ FREE_AND_NULL(value);
+ res = 0;
+ for (;e; e = e->next) {
+ keys = bind->nodeTable[e->index]->keys;
for (k = 0; k < nbFields; k++) {
res = xmlSchemaAreValuesEqual(keys[k]->val,
- refKeys[k]->val);
+ refKeys[k]->val);
if (res == 0)
- break;
+ break;
else if (res == -1) {
return (-1);
}
}
if (res == 1) {
/*
- * Match found.
- */
+ * Match found.
+ */
break;
}
}
FREE_AND_NULL(strB);
}
}
+ if (table) {
+ xmlHashFree(table, xmlFreeIDCHashEntry);
+ }
}
matcher = matcher->next;
}
unsigned long length,
int fireErrors)
{
- int ret, error = 0;
+ int ret, error = 0, found;
xmlSchemaTypePtr tmpType;
xmlSchemaFacetLinkPtr facetLink;
}
pattern_and_enum:
- if (error >= 0) {
- int found = 0;
- /*
- * Process enumerations. Facet values are in the value space
- * of the defining type's base type. This seems to be a bug in the
- * XML Schema 1.0 spec. Use the whitespace type of the base type.
- * Only the first set of enumerations in the ancestor-or-self axis
- * is used for validation.
- */
- ret = 0;
- tmpType = type;
- do {
- for (facet = tmpType->facets; facet != NULL; facet = facet->next) {
- if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
- continue;
- found = 1;
- ret = xmlSchemaAreValuesEqual(facet->val, val);
- if (ret == 1)
- break;
- else if (ret < 0) {
- AERROR_INT("xmlSchemaValidateFacets",
- "validating against an enumeration facet");
- return (-1);
- }
- }
- if (ret != 0)
- break;
- /*
- * Break on the first set of enumerations. Any additional
- * enumerations which might be existent on the ancestors
- * of the current type are restricted by this set; thus
- * *must* *not* be taken into account.
- */
- if (found)
- break;
- tmpType = tmpType->baseType;
- } while ((tmpType != NULL) &&
- (tmpType->type != XML_SCHEMA_TYPE_BASIC));
- if (found && (ret == 0)) {
- ret = XML_SCHEMAV_CVC_ENUMERATION_VALID;
- if (fireErrors) {
- xmlSchemaFacetErr(actxt, ret, node,
- value, 0, type, NULL, NULL, NULL, NULL);
- } else
- return (ret);
- if (error == 0)
- error = ret;
- }
- }
-
- if (error >= 0) {
- int found;
- /*
- * Process patters. Pattern facets are ORed at type level
- * and ANDed if derived. Walk the base type axis.
- */
- tmpType = type;
- facet = NULL;
- do {
- found = 0;
- for (facetLink = tmpType->facetSet; facetLink != NULL;
- facetLink = facetLink->next) {
- if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
- continue;
- found = 1;
- /*
- * NOTE that for patterns, @value needs to be the
- * normalized value.
- */
- ret = xmlRegexpExec(facetLink->facet->regexp, value);
- if (ret == 1)
- break;
- else if (ret < 0) {
- AERROR_INT("xmlSchemaValidateFacets",
- "validating against a pattern facet");
- return (-1);
- } else {
- /*
- * Save the last non-validating facet.
- */
- facet = facetLink->facet;
- }
- }
- if (found && (ret != 1)) {
- ret = XML_SCHEMAV_CVC_PATTERN_VALID;
- if (fireErrors) {
- xmlSchemaFacetErr(actxt, ret, node,
- value, 0, type, facet, NULL, NULL, NULL);
- } else
- return (ret);
- if (error == 0)
- error = ret;
- break;
- }
- tmpType = tmpType->baseType;
- } while ((tmpType != NULL) && (tmpType->type != XML_SCHEMA_TYPE_BASIC));
- }
+ found = 0;
+ /*
+ * Process enumerations. Facet values are in the value space
+ * of the defining type's base type. This seems to be a bug in the
+ * XML Schema 1.0 spec. Use the whitespace type of the base type.
+ * Only the first set of enumerations in the ancestor-or-self axis
+ * is used for validation.
+ */
+ ret = 0;
+ tmpType = type;
+ do {
+ for (facet = tmpType->facets; facet != NULL; facet = facet->next) {
+ if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
+ continue;
+ found = 1;
+ ret = xmlSchemaAreValuesEqual(facet->val, val);
+ if (ret == 1)
+ break;
+ else if (ret < 0) {
+ AERROR_INT("xmlSchemaValidateFacets",
+ "validating against an enumeration facet");
+ return (-1);
+ }
+ }
+ if (ret != 0)
+ break;
+ /*
+ * Break on the first set of enumerations. Any additional
+ * enumerations which might be existent on the ancestors
+ * of the current type are restricted by this set; thus
+ * *must* *not* be taken into account.
+ */
+ if (found)
+ break;
+ tmpType = tmpType->baseType;
+ } while ((tmpType != NULL) &&
+ (tmpType->type != XML_SCHEMA_TYPE_BASIC));
+ if (found && (ret == 0)) {
+ ret = XML_SCHEMAV_CVC_ENUMERATION_VALID;
+ if (fireErrors) {
+ xmlSchemaFacetErr(actxt, ret, node,
+ value, 0, type, NULL, NULL, NULL, NULL);
+ } else
+ return (ret);
+ if (error == 0)
+ error = ret;
+ }
+
+ /*
+ * Process patters. Pattern facets are ORed at type level
+ * and ANDed if derived. Walk the base type axis.
+ */
+ tmpType = type;
+ facet = NULL;
+ do {
+ found = 0;
+ for (facetLink = tmpType->facetSet; facetLink != NULL;
+ facetLink = facetLink->next) {
+ if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
+ continue;
+ found = 1;
+ /*
+ * NOTE that for patterns, @value needs to be the
+ * normalized value.
+ */
+ ret = xmlRegexpExec(facetLink->facet->regexp, value);
+ if (ret == 1)
+ break;
+ else if (ret < 0) {
+ AERROR_INT("xmlSchemaValidateFacets",
+ "validating against a pattern facet");
+ return (-1);
+ } else {
+ /*
+ * Save the last non-validating facet.
+ */
+ facet = facetLink->facet;
+ }
+ }
+ if (found && (ret != 1)) {
+ ret = XML_SCHEMAV_CVC_PATTERN_VALID;
+ if (fireErrors) {
+ xmlSchemaFacetErr(actxt, ret, node,
+ value, 0, type, facet, NULL, NULL, NULL);
+ } else
+ return (ret);
+ if (error == 0)
+ error = ret;
+ break;
+ }
+ tmpType = tmpType->baseType;
+ } while ((tmpType != NULL) && (tmpType->type != XML_SCHEMA_TYPE_BASIC));
return (error);
}
* @warn: the warning function
* @ctx: the functions context
*
- * Set the error and warning callback informations
+ * Set the error and warning callback information
*/
void
xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt,
* @warn: the warning function result
* @ctx: the functions context result
*
- * Get the error and warning callback informations
+ * Get the error and warning callback information
*
* Returns -1 in case of error and 0 otherwise
*/
VERROR(1, NULL, "The document has no document element");
return (1);
}
+ for (node = valRoot->next; node != NULL; node = node->next) {
+ if (node->type == XML_ELEMENT_NODE)
+ VERROR(1, NULL, "The document has more than one top element");
+ }
vctxt->depth = -1;
vctxt->validationRoot = valRoot;
node = valRoot;
vctxt->nberrors = 0;
vctxt->depth = -1;
vctxt->skipDepth = -1;
- vctxt->xsiAssemble = 0;
vctxt->hasKeyrefs = 0;
#ifdef ENABLE_IDC_NODE_TABLES_TEST
vctxt->createIDCNodeTables = 1;
struct _xmlSchemaSAXPlug {
unsigned int magic;
- /* the original callbacks informations */
+ /* the original callbacks information */
xmlSAXHandlerPtr *user_sax_ptr;
xmlSAXHandlerPtr user_sax;
void **user_data_ptr;
void *user_data;
- /* the block plugged back and validation informations */
+ /* the block plugged back and validation information */
xmlSAXHandler schemas_sax;
xmlSchemaValidCtxtPtr ctxt;
};
************************************************************************/
/**
* xmlSchemaTypeErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle an out of memory condition
*/
#define VALID_DATETIME(dt) \
(VALID_DATE(dt) && VALID_TIME(dt))
-#define SECS_PER_MIN (60)
-#define SECS_PER_HOUR (60 * SECS_PER_MIN)
-#define SECS_PER_DAY (24 * SECS_PER_HOUR)
+#define SECS_PER_MIN 60
+#define MINS_PER_HOUR 60
+#define HOURS_PER_DAY 24
+#define SECS_PER_HOUR (MINS_PER_HOUR * SECS_PER_MIN)
+#define SECS_PER_DAY (HOURS_PER_DAY * SECS_PER_HOUR)
+#define MINS_PER_DAY (HOURS_PER_DAY * MINS_PER_HOUR)
static const long dayInYearByMonth[12] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
firstChar = cur;
while ((*cur >= '0') && (*cur <= '9')) {
- dt->year = dt->year * 10 + (*cur - '0');
+ int digit = *cur - '0';
+
+ if (dt->year > LONG_MAX / 10)
+ return 2;
+ dt->year *= 10;
+ if (dt->year > LONG_MAX - digit)
+ return 2;
+ dt->year += digit;
cur++;
digcnt++;
}
xmlSchemaValPtr dur;
int isneg = 0;
unsigned int seq = 0;
- double num;
- int num_type = 0; /* -1 = invalid, 0 = int, 1 = floating */
- const xmlChar desig[] = {'Y', 'M', 'D', 'H', 'M', 'S'};
- const double multi[] = { 0.0, 0.0, 86400.0, 3600.0, 60.0, 1.0, 0.0};
+ long days, secs = 0;
+ double sec_frac = 0.0;
if (duration == NULL)
return -1;
return -1;
while (*cur != 0) {
+ long num = 0;
+ size_t has_digits = 0;
+ int has_frac = 0;
+ const xmlChar desig[] = {'Y', 'M', 'D', 'H', 'M', 'S'};
/* input string should be empty or invalid date/time item */
if (seq >= sizeof(desig))
/* T designator must be present for time items */
if (*cur == 'T') {
- if (seq <= 3) {
- seq = 3;
- cur++;
- } else
- return 1;
+ if (seq > 3)
+ goto error;
+ cur++;
+ seq = 3;
} else if (seq == 3)
goto error;
- /* parse the number portion of the item */
- PARSE_NUM(num, cur, num_type);
-
- if ((num_type == -1) || (*cur == 0))
- goto error;
-
- /* update duration based on item type */
- while (seq < sizeof(desig)) {
- if (*cur == desig[seq]) {
+ /* Parse integral part. */
+ while (*cur >= '0' && *cur <= '9') {
+ long digit = *cur - '0';
- /* verify numeric type; only seconds can be float */
- if ((num_type != 0) && (seq < (sizeof(desig)-1)))
- goto error;
+ if (num > LONG_MAX / 10)
+ goto error;
+ num *= 10;
+ if (num > LONG_MAX - digit)
+ goto error;
+ num += digit;
- switch (seq) {
- case 0:
- dur->value.dur.mon = (long)num * 12;
- break;
- case 1:
- dur->value.dur.mon += (long)num;
- break;
- default:
- /* convert to seconds using multiplier */
- dur->value.dur.sec += num * multi[seq];
- seq++;
- break;
- }
+ has_digits = 1;
+ cur++;
+ }
- break; /* exit loop */
+ if (*cur == '.') {
+ /* Parse fractional part. */
+ double mult = 1.0;
+ cur++;
+ has_frac = 1;
+ while (*cur >= '0' && *cur <= '9') {
+ mult /= 10.0;
+ sec_frac += (*cur - '0') * mult;
+ has_digits = 1;
+ cur++;
}
- /* no date designators found? */
- if ((++seq == 3) || (seq == 6))
+ }
+
+ while (*cur != desig[seq]) {
+ seq++;
+ /* No T designator or invalid char. */
+ if (seq == 3 || seq == sizeof(desig))
goto error;
}
cur++;
- if (collapse)
- while IS_WSP_BLANK_CH(*cur) cur++;
+
+ if (!has_digits || (has_frac && (seq != 5)))
+ goto error;
+
+ switch (seq) {
+ case 0:
+ /* Year */
+ if (num > LONG_MAX / 12)
+ goto error;
+ dur->value.dur.mon = num * 12;
+ break;
+ case 1:
+ /* Month */
+ if (dur->value.dur.mon > LONG_MAX - num)
+ goto error;
+ dur->value.dur.mon += num;
+ break;
+ case 2:
+ /* Day */
+ dur->value.dur.day = num;
+ break;
+ case 3:
+ /* Hour */
+ days = num / HOURS_PER_DAY;
+ if (dur->value.dur.day > LONG_MAX - days)
+ goto error;
+ dur->value.dur.day += days;
+ secs = (num % HOURS_PER_DAY) * SECS_PER_HOUR;
+ break;
+ case 4:
+ /* Minute */
+ days = num / MINS_PER_DAY;
+ if (dur->value.dur.day > LONG_MAX - days)
+ goto error;
+ dur->value.dur.day += days;
+ secs += (num % MINS_PER_DAY) * SECS_PER_MIN;
+ break;
+ case 5:
+ /* Second */
+ days = num / SECS_PER_DAY;
+ if (dur->value.dur.day > LONG_MAX - days)
+ goto error;
+ dur->value.dur.day += days;
+ secs += num % SECS_PER_DAY;
+ break;
+ }
+
+ seq++;
}
+ days = secs / SECS_PER_DAY;
+ if (dur->value.dur.day > LONG_MAX - days)
+ goto error;
+ dur->value.dur.day += days;
+ dur->value.dur.sec = (secs % SECS_PER_DAY) + sec_frac;
+
if (isneg) {
dur->value.dur.mon = -dur->value.dur.mon;
dur->value.dur.day = -dur->value.dur.day;
return(ret);
}
+/*
+ * xmlSchemaCheckLanguageType
+ * @value: the value to check
+ *
+ * Check that a value conforms to the lexical space of the language datatype.
+ * Must conform to [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*
+ *
+ * Returns 1 if this validates, 0 otherwise.
+ */
+static int
+xmlSchemaCheckLanguageType(const xmlChar* value) {
+ int first = 1, len = 0;
+ const xmlChar* cur = value;
+
+ if (value == NULL)
+ return (0);
+
+ while (cur[0] != 0) {
+ if (!( ((cur[0] >= 'a') && (cur[0] <= 'z')) || ((cur[0] >= 'A') && (cur[0] <= 'Z'))
+ || (cur[0] == '-')
+ || ((first == 0) && (xmlIsDigit_ch(cur[0]))) ))
+ return (0);
+ if (cur[0] == '-') {
+ if ((len < 1) || (len > 8))
+ return (0);
+ len = 0;
+ first = 0;
+ }
+ else
+ len++;
+ cur++;
+ }
+ if ((len < 1) || (len > 8))
+ return (0);
+
+ return (1);
+}
+
/**
* xmlSchemaValAtomicType:
* @type: the predefined type
goto return0;
}
case XML_SCHEMAS_LANGUAGE:
- if (normOnTheFly) {
+ if ((norm == NULL) && (normOnTheFly)) {
norm = xmlSchemaCollapseString(value);
if (norm != NULL)
value = norm;
}
- if (xmlCheckLanguageID(value) == 1) {
+
+ if (xmlSchemaCheckLanguageType(value) == 1) {
if (val != NULL) {
v = xmlSchemaNewValue(XML_SCHEMAS_LANGUAGE);
if (v != NULL) {
minday = 0;
maxday = 0;
} else {
+ if (myear > LONG_MAX / 366)
+ return -2;
/* FIXME: This doesn't take leap year exceptions every 100/400 years
into account. */
maxday = 365 * myear + (myear + 3) / 4;
if ((x == NULL) || (y == NULL))
return -2;
+ if ((x->value.date.year > LONG_MAX / 366) ||
+ (x->value.date.year < LONG_MIN / 366) ||
+ (y->value.date.year > LONG_MAX / 366) ||
+ (y->value.date.year < LONG_MIN / 366)) {
+ /* Possible overflow when converting to days. */
+ return -2;
+ }
+
if (x->value.date.tz_flag) {
if (!y->value.date.tz_flag) {
/*
* TODO: Check if this is a decimal.
*/
- if (facet == NULL)
+ if (facet == NULL || facet->val == NULL)
return 0;
return ((unsigned long) facet->val->value.decimal.lo);
}
* recoverable timezone and not "Z".
*/
snprintf(buf, 30,
- "%04ld:%02u:%02uZ",
+ "%04ld-%02u-%02uZ",
norm->value.date.year, norm->value.date.mon,
norm->value.date.day);
xmlSchemaFreeValue(norm);
} else {
snprintf(buf, 30,
- "%04ld:%02u:%02u",
+ "%04ld-%02u-%02u",
val->value.date.year, val->value.date.mon,
val->value.date.day);
}
* TODO: Check if "%.14g" is portable.
*/
snprintf(buf, 50,
- "%04ld:%02u:%02uT%02u:%02u:%02.14gZ",
+ "%04ld-%02u-%02uT%02u:%02u:%02.14gZ",
norm->value.date.year, norm->value.date.mon,
norm->value.date.day, norm->value.date.hour,
norm->value.date.min, norm->value.date.sec);
xmlSchemaFreeValue(norm);
} else {
snprintf(buf, 50,
- "%04ld:%02u:%02uT%02u:%02u:%02.14g",
+ "%04ld-%02u-%02uT%02u:%02u:%02.14g",
val->value.date.year, val->value.date.mon,
val->value.date.day, val->value.date.hour,
val->value.date.min, val->value.date.sec);
int
xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
- register int tmp;
-
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ return(strcmp((const char *)str1, (const char *)str2));
+#else
do {
- tmp = *str1++ - *str2;
+ int tmp = *str1++ - *str2;
if (tmp != 0) return(tmp);
} while (*str2++ != 0);
return 0;
+#endif
}
/**
if (str1 == str2) return(1);
if (str1 == NULL) return(0);
if (str2 == NULL) return(0);
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ return(strcmp((const char *)str1, (const char *)str2) == 0);
+#else
do {
if (*str1++ != *str2) return(0);
} while (*str2++);
return(1);
+#endif
}
/**
int
xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
- register int tmp;
-
if (len <= 0) return(0);
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
-#ifdef __GNUC__
- tmp = strncmp((const char *)str1, (const char *)str2, len);
- return tmp;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ return(strncmp((const char *)str1, (const char *)str2, len));
#else
do {
- tmp = *str1++ - *str2;
+ int tmp = *str1++ - *str2;
if (tmp != 0 || --len == 0) return(tmp);
} while (*str2++ != 0);
return 0;
#define XPATH_MAX_NODESET_LENGTH 10000000
/*
+ * XPATH_MAX_RECRUSION_DEPTH:
+ * Maximum amount of nested functions calls when parsing or evaluating
+ * expressions
+ */
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+#define XPATH_MAX_RECURSION_DEPTH 500
+#else
+#define XPATH_MAX_RECURSION_DEPTH 5000
+#endif
+
+/*
* TODO:
* There are a few spots where some tests are done which depend upon ascii
* data. These should be enhanced for full UTF8 support (see particularly
* *
************************************************************************/
-#ifndef INFINITY
-#define INFINITY (DBL_MAX * DBL_MAX)
-#endif
-
-#ifndef NAN
-#define NAN (INFINITY / INFINITY)
-#endif
-
double xmlXPathNAN;
double xmlXPathPINF;
double xmlXPathNINF;
*
* Initialize the XPath environment
*/
+ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
void
xmlXPathInit(void) {
- xmlXPathNAN = NAN;
- xmlXPathPINF = INFINITY;
- xmlXPathNINF = -INFINITY;
+ /* MSVC doesn't allow division by zero in constant expressions. */
+ double zero = 0.0;
+ xmlXPathNAN = 0.0 / zero;
+ xmlXPathPINF = 1.0 / zero;
+ xmlXPathNINF = -xmlXPathPINF;
}
/**
#ifdef isinf
return isinf(val) ? (val > 0 ? 1 : -1) : 0;
#else
- if (val >= INFINITY)
+ if (val >= xmlXPathPINF)
return 1;
- if (val <= -INFINITY)
+ if (val <= -xmlXPathPINF)
return -1;
return 0;
#endif
/**
* xmlXPathErrMemory:
* @ctxt: an XPath context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
/**
* xmlXPathPErrMemory:
* @ctxt: an XPath parser context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
static int xmlXPathDebugObjMaxXSLTTree = 0;
static int xmlXPathDebugObjMaxAll = 0;
-/* REVISIT TODO: Make this static when committing */
static void
xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
{
xmlXPathDebugObjCounterAll--;
}
-/* REVISIT TODO: Make this static when committing */
static void
xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
{
double ret;
if (node == NULL)
- return(NAN);
+ return(xmlXPathNAN);
strval = xmlXPathCastNodeToString(node);
if (strval == NULL)
- return(NAN);
+ return(xmlXPathNAN);
ret = xmlXPathCastStringToNumber(strval);
xmlFree(strval);
double ret;
if (ns == NULL)
- return(NAN);
+ return(xmlXPathNAN);
str = xmlXPathCastNodeSetToString(ns);
ret = xmlXPathCastStringToNumber(str);
xmlFree(str);
double ret = 0.0;
if (val == NULL)
- return(NAN);
+ return(xmlXPathNAN);
switch (val->type) {
case XPATH_UNDEFINED:
#ifdef DEBUG_EXPR
xmlGenericError(xmlGenericErrorContext, "NUMBER: undefined\n");
#endif
- ret = NAN;
+ ret = xmlXPathNAN;
break;
case XPATH_NODESET:
case XPATH_XSLT_TREE:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
TODO;
- ret = NAN;
+ ret = xmlXPathNAN;
break;
}
return(ret);
ret->contextSize = -1;
ret->proximityPosition = -1;
- ret->maxDepth = INT_MAX;
- ret->maxParserDepth = INT_MAX;
-
#ifdef XP_DEFAULT_CACHE_ON
if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
xmlXPathFreeContext(ret);
CHECK_TYPE(XPATH_NUMBER);
arg1 = ctxt->value->floatval;
if (arg2 == 0)
- ctxt->value->floatval = NAN;
+ ctxt->value->floatval = xmlXPathNAN;
else {
ctxt->value->floatval = fmod(arg1, arg2);
}
if (cur == NULL) return(0);
while (IS_BLANK_CH(*cur)) cur++;
if ((*cur != '.') && ((*cur < '0') || (*cur > '9')) && (*cur != '-')) {
- return(NAN);
+ return(xmlXPathNAN);
}
if (*cur == '-') {
isneg = 1;
cur++;
if (((*cur < '0') || (*cur > '9')) && (!ok)) {
- return(NAN);
+ return(xmlXPathNAN);
}
while (*cur == '0') {
frac = frac + 1;
}
}
while (IS_BLANK_CH(*cur)) cur++;
- if (*cur != 0) return(NAN);
+ if (*cur != 0) return(xmlXPathNAN);
if (isneg) ret = -ret;
if (is_exponent_negative) exponent = -exponent;
ret *= pow(10.0, (double)exponent);
int ok = 0;
int exponent = 0;
int is_exponent_negative = 0;
+ xmlXPathObjectPtr num;
#ifdef __GNUC__
unsigned long tmp = 0;
double temp;
exponent = -exponent;
ret *= pow(10.0, (double) exponent);
}
- PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0,
- xmlXPathCacheNewFloat(ctxt->context, ret), NULL);
+ num = xmlXPathCacheNewFloat(ctxt->context, ret);
+ if (num == NULL) {
+ ctxt->error = XPATH_MEMORY_ERROR;
+ } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
+ NULL) == -1) {
+ xmlXPathReleaseObject(ctxt->context, num);
+ }
}
/**
xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
const xmlChar *q;
xmlChar *ret = NULL;
+ xmlXPathObjectPtr lit;
if (CUR == '"') {
NEXT;
XP_ERROR(XPATH_START_LITERAL_ERROR);
}
if (ret == NULL) return;
- PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0,
- xmlXPathCacheNewString(ctxt->context, ret), NULL);
+ lit = xmlXPathCacheNewString(ctxt->context, ret);
+ if (lit == NULL) {
+ ctxt->error = XPATH_MEMORY_ERROR;
+ } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
+ NULL) == -1) {
+ xmlXPathReleaseObject(ctxt->context, lit);
+ }
xmlFree(ret);
}
XP_ERROR(XPATH_VARIABLE_REF_ERROR);
}
ctxt->comp->last = -1;
- PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0,
- name, prefix);
+ if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
+ xmlFree(prefix);
+ xmlFree(name);
+ }
SKIP_BLANKS;
if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
SKIP_BLANKS;
}
}
- PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0,
- name, prefix);
+ if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
+ xmlFree(prefix);
+ xmlFree(name);
+ }
NEXT;
SKIP_BLANKS;
}
xmlXPathContextPtr xpctxt = ctxt->context;
if (xpctxt != NULL) {
- if (xpctxt->depth >= xpctxt->maxParserDepth)
+ if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
- xpctxt->depth += 1;
+ /*
+ * Parsing a single '(' pushes about 10 functions on the call stack
+ * before recursing!
+ */
+ xpctxt->depth += 10;
}
xmlXPathCompAndExpr(ctxt);
*/
static xmlChar *
xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
- xmlXPathTypeVal *type, const xmlChar **prefix,
+ xmlXPathTypeVal *type, xmlChar **prefix,
xmlChar *name) {
int blanks;
SKIP_BLANKS;
} else {
xmlChar *name = NULL;
- const xmlChar *prefix = NULL;
+ xmlChar *prefix = NULL;
xmlXPathTestVal test = (xmlXPathTestVal) 0;
xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
PUSH_BINARY_EXPR(XPATH_OP_RANGETO, op2, op1, 0, 0);
} else
#endif
- PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
- test, type, (void *)prefix, (void *)name);
-
+ if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
+ test, type, (void *)prefix, (void *)name) == -1) {
+ xmlFree(prefix);
+ xmlFree(name);
+ }
}
#ifdef DEBUG_STEP
xmlGenericError(xmlGenericErrorContext, "Step : ");
res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
if (ctxt->error != XPATH_EXPRESSION_OK)
- goto exit;
+ break;
if (res < 0) {
/* Shouldn't happen */
xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
- goto exit;
+ break;
}
if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
if (res != 0) {
if (pos == maxPos) {
- /* Clear remaining nodes and exit loop. */
- if (hasNsNodes) {
- for (i++; i < set->nodeNr; i++) {
- node = set->nodeTab[i];
- if ((node != NULL) &&
- (node->type == XML_NAMESPACE_DECL))
- xmlXPathNodeSetFreeNs((xmlNsPtr) node);
- }
- }
+ i += 1;
break;
}
}
}
+ /* Free remaining nodes. */
+ if (hasNsNodes) {
+ for (; i < set->nodeNr; i++) {
+ xmlNodePtr node = set->nodeTab[i];
+ if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
+ xmlXPathNodeSetFreeNs((xmlNsPtr) node);
+ }
+ }
+
set->nodeNr = j;
/* If too many elements were removed, shrink table to preserve memory. */
}
}
-exit:
xpctxt->node = oldnode;
xpctxt->doc = olddoc;
xpctxt->contextSize = oldcs;
res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
if (ctxt->error != XPATH_EXPRESSION_OK)
- goto exit;
+ break;
if (res < 0) {
/* Shouldn't happen */
xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
- goto exit;
+ break;
}
if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
if (res != 0) {
if (pos == maxPos) {
- /* Clear remaining nodes and exit loop. */
- for (i++; i < locset->locNr; i++) {
- xmlXPathFreeObject(locset->locTab[i]);
- }
+ i += 1;
break;
}
}
}
+ /* Free remaining nodes. */
+ for (; i < locset->locNr; i++)
+ xmlXPathFreeObject(locset->locTab[i]);
+
locset->locNr = j;
/* If too many elements were removed, shrink table to preserve memory. */
}
}
-exit:
xpctxt->node = oldnode;
xpctxt->doc = olddoc;
xpctxt->contextSize = oldcs;
"xmlXPathCompOpEvalPredicate: Expected a predicate\n");
XP_ERROR(XPATH_INVALID_OPERAND);
}
- if (ctxt->context->depth >= ctxt->context->maxDepth)
+ if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
ctxt->context->depth += 1;
xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
CHECK_ERROR0;
if (OP_LIMIT_EXCEEDED(ctxt, 1))
return(0);
- if (ctxt->context->depth >= ctxt->context->maxDepth)
+ if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
ctxt->context->depth += 1;
comp = ctxt->comp;
CHECK_ERROR0;
if (OP_LIMIT_EXCEEDED(ctxt, 1))
return(0);
- if (ctxt->context->depth >= ctxt->context->maxDepth)
+ if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
ctxt->context->depth += 1;
comp = ctxt->comp;
CHECK_ERROR0;
if (OP_LIMIT_EXCEEDED(ctxt, 1))
return(0);
- if (ctxt->context->depth >= ctxt->context->maxDepth)
+ if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
ctxt->context->depth += 1;
comp = ctxt->comp;
do {
cur = cur->parent;
depth--;
- if ((cur == NULL) || (cur == limit))
+ if ((cur == NULL) || (cur == limit) ||
+ (cur->type == XML_DOCUMENT_NODE))
goto done;
if (cur->type == XML_ELEMENT_NODE) {
ret = xmlStreamPop(patstream);
}
}
- stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH,
- &namespaces[0]);
+ stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH, namespaces);
if (namespaces != NULL) {
xmlFree((xmlChar **)namespaces);
}
/* Recurse */
ctxt = pctxt->context;
if (ctxt != NULL) {
- if (ctxt->depth >= ctxt->maxDepth)
+ if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
return;
ctxt->depth += 1;
}
return(comp);
#endif
- xmlXPathInit();
+ xmlInitParser();
pctxt = xmlXPathNewParserContext(str, ctxt);
if (pctxt == NULL)
if (comp == NULL)
return(-1);
- xmlXPathInit();
+ xmlInitParser();
#ifndef LIBXML_THREAD_ENABLED
reentance++;
CHECK_CTXT(ctx)
- xmlXPathInit();
+ xmlInitParser();
ctxt = xmlXPathNewParserContext(str, ctx);
if (ctxt == NULL)
/**
* xmlXPtrErrMemory:
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
/**
* xmlXPtrErr:
* @ctxt: an XPTR evaluation context
- * @extra: extra informations
+ * @extra: extra information
*
* Handle a redefinition of attribute error
*/
/*
* To evaluate an xpointer scheme element (4.3) we need:
* context initialized to the root
- * context position initalized to 1
+ * context position initialized to 1
* context size initialized to 1
*/
ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
xmlXPathObjectPtr init = NULL;
int stack = 0;
- xmlXPathInit();
+ xmlInitParser();
if ((ctx == NULL) || (str == NULL))
return(NULL);
case XML_ELEMENT_DECL:
case XML_ATTRIBUTE_DECL:
case XML_ENTITY_NODE:
- /* Do not copy DTD informations */
+ /* Do not copy DTD information */
break;
case XML_ENTITY_DECL:
TODO /* handle crossing entities -> stack needed */
XP_ERROR(XPATH_MEMORY_ERROR)
set = tmp;
}
- oldset = (xmlLocationSetPtr) set->user;
/*
* The loop is to compute the covering range for each item and add it
xmlXPathFreeObject(set);
XP_ERROR(XPATH_MEMORY_ERROR);
}
- for (i = 0;i < oldset->locNr;i++) {
- xmlXPtrLocationSetAdd(newset,
- xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
+ oldset = (xmlLocationSetPtr) set->user;
+ if (oldset != NULL) {
+ for (i = 0;i < oldset->locNr;i++) {
+ xmlXPtrLocationSetAdd(newset,
+ xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
+ }
}
/*
xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
int i, startindex, endindex = 0, fendindex;
xmlNodePtr start, end = 0, fend;
- xmlXPathObjectPtr set;
+ xmlXPathObjectPtr set = NULL;
xmlLocationSetPtr oldset;
- xmlLocationSetPtr newset;
- xmlXPathObjectPtr string;
+ xmlLocationSetPtr newset = NULL;
+ xmlXPathObjectPtr string = NULL;
xmlXPathObjectPtr position = NULL;
xmlXPathObjectPtr number = NULL;
int found, pos = 0, num = 0;
XP_ERROR(XPATH_INVALID_ARITY);
if (nargs >= 4) {
- CHECK_TYPE(XPATH_NUMBER);
+ if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NUMBER)) {
+ xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+ goto error;
+ }
number = valuePop(ctxt);
if (number != NULL)
num = (int) number->floatval;
}
if (nargs >= 3) {
- CHECK_TYPE(XPATH_NUMBER);
+ if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NUMBER)) {
+ xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+ goto error;
+ }
position = valuePop(ctxt);
if (position != NULL)
pos = (int) position->floatval;
}
- CHECK_TYPE(XPATH_STRING);
+ if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
+ xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+ goto error;
+ }
string = valuePop(ctxt);
if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_LOCATIONSET) &&
- (ctxt->value->type != XPATH_NODESET)))
- XP_ERROR(XPATH_INVALID_TYPE)
-
+ (ctxt->value->type != XPATH_NODESET))) {
+ xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+ goto error;
+ }
set = valuePop(ctxt);
newset = xmlXPtrLocationSetCreate(NULL);
if (newset == NULL) {
- xmlXPathFreeObject(set);
- XP_ERROR(XPATH_MEMORY_ERROR);
+ xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
+ goto error;
}
if (set->nodesetval == NULL) {
goto error;
*/
tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
xmlXPathFreeObject(set);
- if (tmp == NULL)
- XP_ERROR(XPATH_MEMORY_ERROR)
+ if (tmp == NULL) {
+ xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
+ goto error;
+ }
set = tmp;
}
oldset = (xmlLocationSetPtr) set->user;
* Save the new value and cleanup
*/
error:
- valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
+ if (newset != NULL)
+ valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
xmlXPathFreeObject(set);
xmlXPathFreeObject(string);
if (position) xmlXPathFreeObject(position);
all:
#
-# Rule to load the test description and extract the informations
+# Rule to load the test description and extract the information
#
$(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF):
-@(if [ ! -d Tests ] ; then \
tokens = self.groupName.split("-")
self.combineName = "%s-%s" % (tokens[0], tokens[1])
else:
- self.combineName = "unkown"
+ self.combineName = "unknown"
raise Exception("Could not compute the combine name of a test.")
if (not options.silent) and (self.group.descr is not None):
self.log.append("'%s' group-descr: %s\n" % (self.name, self.group.descr))