Go to file
Prashanth Swaminathan 641455aed3 Merge tag 'v2.12.5' into HEAD
* Release v2.12.5
* Update README.fuchsia to new libxml2 version.
* Merge via 'git merge -X theirs v2.12.5'.
* Regenerate config with './autogen.sh --without-lzma'

Bug: b/325015666
Change-Id: Ib4dccf98931bae2a11d00093b3edd3aa35c84052
2024-02-20 16:04:25 -08:00
.gitlab-ci gitlab-ci: Revert accidental change to setup_mingw.sh 2022-12-21 22:30:25 +01:00
doc Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
example tests: Don't use deprecated symbols 2023-09-20 22:06:49 +02:00
fuzz tests: Fix tests --with-valid --without-xinclude 2023-12-01 17:24:19 +01:00
include Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
m4 Link with --undefined-version 2023-04-29 19:12:23 +02:00
os400 fix Schematron spelling 2022-05-06 10:44:03 +02:00
python python: Make sure to distribute new files 2023-11-04 19:32:07 +01:00
result parser: Fix namespaces redefined from default attributes 2023-12-08 16:05:22 +01:00
test parser: Fix namespaces redefined from default attributes 2023-12-08 16:05:22 +01:00
vms Remove remaining definitions of STDC_HEADERS 2022-04-20 19:18:17 +02:00
win32 globals: Use thread-local storage if available 2023-09-20 22:06:49 +02:00
xstc .gitignore: Split up and rearrange .gitignore files 2023-04-30 16:22:27 +02:00
.editorconfig Fix .editorconfig 2022-11-22 17:01:21 +01:00
.gitattributes Fix .gitattributes 2020-07-23 20:46:42 +02:00
.gitignore tests: Start with testparser.c for extra tests 2023-10-22 14:24:43 +02:00
.gitlab-ci.yml Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
autogen.sh Build Autotools CI tests out of source tree (VPATH) 2022-04-21 06:59:02 +02:00
buf.c buf: Also reset input in error case 2023-10-11 13:32:54 +02:00
BUILD.gn [libxml] Update BUILD.gn and xmlversion headers 2023-01-17 21:53:35 +00:00
c14n.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
catalog.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
check-relaxng-test-suite.py Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
check-relaxng-test-suite2.py Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
check-xinclude-test-suite.py Use python3 not python 2022-12-07 13:21:12 +00:00
check-xml-test-suite.py Use python3 not python 2022-12-07 13:21:12 +00:00
check-xsddata-test-suite.py Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
chvalid.c libxml.h: Don't include stdio.h 2022-12-08 04:24:57 +01:00
chvalid.def Remove executable bit from non-executable files 2019-09-16 15:48:59 +02:00
CMakeLists.txt build: Disable compiler TLS by default 2023-12-05 20:40:20 +01:00
config.h Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
config.h.cmake.in cmake: Update config.h.cmake.in 2023-12-01 17:26:33 +01:00
configure.ac Release v2.12.5 2024-02-04 14:53:18 +01:00
Copyright hash: Rewrite hash table code 2023-09-29 02:25:57 +02:00
dbgen.pl add a Timingtests target to check bad behaviour from the streaming engine 2003-09-17 22:33:22 +00:00
dbgenattr.pl add a Timingtests target to check bad behaviour from the streaming engine 2003-09-17 22:33:22 +00:00
debugXML.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
dict.c dict: Fix '__thread' before 'static' 2023-11-23 16:20:54 +01:00
encoding.c encoding: Fix decoding of large chunks 2023-10-28 03:14:13 +02:00
entities.c entities: Make xmlFreeEntity public 2023-10-06 10:47:07 +02:00
error.c error: Make more xmlError structs constant 2023-10-24 15:02:36 +02:00
genChRanges.py libxml.h: Don't include stdio.h 2022-12-08 04:24:57 +01:00
gentest.py testapi: test_xmlSAXDefaultVersion() leaves xmlSAX2DefaultVersionValue set to 1 with LIBXML_SAX1_ENABLED 2023-06-10 10:55:38 -07:00
genUnicode.py Remove XMLCALL and XMLCDECL macros from public headers 2022-12-08 02:48:27 +01:00
globals.c include: Move globals from xmlsave.h to parser.h 2023-12-06 19:56:50 +01:00
hash.c hash: Fix deletion of entries during scan 2023-11-23 16:20:54 +01:00
HTMLparser.c io: Fix memory lifetime issue with input buffers 2023-12-12 23:58:33 +01:00
HTMLtree.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
legacy.c legacy: Add private declarations for stubs 2023-09-29 13:19:37 +02:00
libxml-2.0-uninstalled.pc.in autoconf: Don't bake build time CFLAGS into pkg-config file 2023-09-04 22:14:02 +01:00
libxml-2.0.pc.in autoconf: Don't bake build time CFLAGS into pkg-config file 2023-09-04 22:14:02 +01:00
libxml.h Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
libxml.m4 libxml.m4: Fix "possibly undefined macro" error 2023-04-30 13:18:47 +02:00
libxml2-config.cmake.cmake.in cmake: Check whether static linking dependencies found in config files 2023-09-23 16:48:54 +01:00
libxml2-config.cmake.in cmake: Check whether static linking dependencies found in config files 2023-09-23 16:48:54 +01:00
libxml2.doap Remove broken VxWorks support 2022-03-01 17:18:56 +01:00
libxml2.syms libxml2.syms: Revert removal of version information 2023-04-29 18:59:41 +02:00
list.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
MAINTAINERS.md doc: Add notes about runtest to MAINTAINERS.md 2023-09-29 16:07:45 +02:00
Makefile.am Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
nanoftp.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
nanohttp.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
NEWS Release v2.12.5 2024-02-04 14:53:18 +01:00
OWNERS [third_party][libxml2] Add OWNERS 2022-05-12 18:35:00 +00:00
parser.c Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
parserInternals.c parser: Don't grow or shrink pull parser memory buffers 2023-12-14 13:38:54 +01:00
pattern.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
README.fuchsia Merge tag 'v2.12.5' into HEAD 2024-02-20 16:04:25 -08:00
README.md doc: Improve documentation of configuration options 2023-08-21 11:13:33 +02:00
README.zOS Large batch of typo fixes 2019-09-30 18:04:38 +02:00
relaxng.c debug: Remove debugging code 2023-09-19 17:35:09 +02:00
rngparser.c Remove elfgcchack.h 2022-02-20 21:49:04 +01:00
runsuite.c tests: Fix build with older MSVC 2023-11-23 16:20:54 +01:00
runtest.c html: Reenable buggy detection of XML declarations 2023-12-01 17:26:47 +01:00
runxmlconf.c tests: Fix build with older MSVC 2023-11-23 16:20:54 +01:00
SAX.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
SAX2.c parser: Fix invalid free in xmlParseBalancedChunkMemoryRecover 2023-12-01 20:20:07 +01:00
schematron.c globals: Don't include SAX2.h from globals.h 2023-09-20 22:06:49 +02:00
testapi.c tests: Fix build with older MSVC 2023-11-23 16:20:54 +01:00
testchar.c io: Fix memory lifetime issue with input buffers 2023-12-12 23:58:33 +01:00
testdict.c doc: Minor fixes for apibuild.py 2023-11-04 19:32:48 +01:00
testdso.c warning patches from Peter Breitenlohner serious DTD parsing speedups, 2005-01-25 00:22:52 +00:00
testlimits.c error: Make more xmlError structs constant 2023-10-24 15:02:36 +02:00
testModule.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
testOOM.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
testOOMlib.c Don't check for standard C89 headers 2022-03-02 00:43:54 +01:00
testOOMlib.h Remove unneeded #includes 2022-03-04 22:11:49 +01:00
testparser.c parser: Fix regression parsing standalone declarations 2024-01-15 16:29:51 +01:00
testrecurse.c parser: Only enable SAX2 if there are SAX2 element handlers 2023-11-23 16:20:54 +01:00
testThreads.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
threads.c fix: pthread weak references in globals.c 2023-11-23 16:20:54 +01:00
timsort.h Large batch of typo fixes 2019-09-30 18:04:38 +02:00
tree.c tree: Another fix related to #538 2023-12-01 20:19:59 +01:00
trio.c Don't check for standard C89 headers 2022-03-02 00:43:54 +01:00
trio.h Fix typos 2020-03-08 17:41:53 +01:00
triodef.h Fix typos 2020-03-08 17:41:53 +01:00
trionan.c Fix typos 2020-03-08 17:41:53 +01:00
trionan.h Fix typos 2020-03-08 17:41:53 +01:00
triop.h Fix typos 2020-03-08 17:41:53 +01:00
triostr.c Fix typos 2020-03-08 17:41:53 +01:00
triostr.h Fix typos 2020-03-08 17:41:53 +01:00
uri.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
valid.c doc: Make apibuild.py happy 2023-09-21 22:57:33 +02:00
xinclude.c xinclude: Expand comment about fuzz timeouts 2023-09-30 15:47:46 +02:00
xlink.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
xml2-config.in build: Generate better pkg-config files for static-only builds 2023-09-03 08:52:36 +01:00
xmlcatalog.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
xmlIO.c io: Fix memory lifetime issue with input buffers 2023-12-12 23:58:33 +01:00
xmllint.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
xmlmemory.c memory: Fix memory debugging with Windows threads 2023-09-21 23:29:18 +02:00
xmlmodule.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
xmlreader.c [CVE-2024-25062] xmlreader: Don't expand XIncludes when backtracking 2024-02-04 14:44:15 +01:00
xmlregexp.c malloc-fail: Report malloc failure in xmlFARegExec 2023-09-29 00:15:40 +02:00
xmlsave.c doc: Make apibuild.py happy 2023-09-21 22:57:33 +02:00
xmlschemas.c schemas: Fix reallocation in xmlSchemaXPathProcessHistory 2023-11-05 02:03:05 +01:00
xmlschemastypes.c include: Remove more unnecessary includes 2023-09-21 01:50:53 +02:00
xmlstring.c string: Fix UTF-8 validation in xmlGetUTF8Char 2023-09-29 00:15:40 +02:00
xmlunicode.c Mark more static data as const 2022-04-07 12:01:23 -07:00
xmlwriter.c globals: Don't include SAX2.h from globals.h 2023-09-20 22:06:49 +02:00
xpath.c doc: Make apibuild.py happy 2023-09-21 22:57:33 +02:00
xpointer.c globals: Stop including globals.h 2023-09-20 22:07:40 +02:00
xzlib.c Stop using sprintf 2023-05-08 23:33:04 +02:00

libxml2

libxml2 is an XML toolkit implemented in C, originally developed for the GNOME Project.

Official releases can be downloaded from https://download.gnome.org/sources/libxml2/

The git repository is hosted on GNOME's GitLab server: https://gitlab.gnome.org/GNOME/libxml2

Bugs should be reported at https://gitlab.gnome.org/GNOME/libxml2/-/issues

Documentation is available at https://gitlab.gnome.org/GNOME/libxml2/-/wikis

License

This code is released under the MIT License, see the Copyright file.

Build instructions

libxml2 can be built with GNU Autotools, CMake, or several other build systems in platform-specific subdirectories.

Autotools (for POSIX systems like Linux, BSD, macOS)

If you build from a Git tree, you have to install Autotools and start by generating the configuration files with:

./autogen.sh [configuration options]

If you build from a source tarball, extract the archive with:

tar xf libxml2-xxx.tar.gz
cd libxml2-xxx

Then you can configure and build the library:

./configure [configuration options]
make

The following options disable or enable code modules and relevant symbols:

--with-c14n             Canonical XML 1.0 support (on)
--with-catalog          XML Catalogs support (on)
--with-debug            debugging module and shell (on)
--with-history          history support for shell (off)
--with-readline[=DIR]   use readline in DIR (for shell history)
--with-html             HTML parser (on)
--with-http             HTTP support (on)
--with-iconv[=DIR]      iconv support (on)
--with-icu              ICU support (off)
--with-iso8859x         ISO-8859-X support if no iconv (on)
--with-lzma[=DIR]       use liblzma in DIR (on)
--with-mem-debug        memory debugging module (off)
--with-modules          dynamic modules support (on)
--with-output           serialization support (on)
--with-pattern          xmlPattern selection interface (on)
--with-push             push parser interfaces (on)
--with-python           Python bindings (on)
--with-reader           xmlReader parsing interface (on)
--with-regexps          regular expressions support (on)
--with-run-debug        runtime debugging module (off)
--with-sax1             older SAX1 interface (on)
--with-schemas          XML Schemas 1.0 and RELAX NG support (on)
--with-schematron       Schematron support (on)
--with-threads          multithreading support (on)
--with-thread-alloc     per-thread malloc hooks (off)
--with-tree             DOM like tree manipulation APIs (on)
--with-valid            DTD validation support (on)
--with-writer           xmlWriter serialization interface (on)
--with-xinclude         XInclude 1.0 support (on)
--with-xpath            XPath 1.0 support (on)
--with-xptr             XPointer support (on)
--with-zlib[=DIR]       use libz in DIR (on)

Other options:

--with-minimum          build a minimally sized library (off)
--with-legacy           maximum ABI compatibility (off)

Note that by default, no optimization options are used. You have to enable them manually, for example with:

CFLAGS='-O2 -fno-semantic-interposition' ./configure

Now you can run the test suite with:

make check

Please report test failures to the mailing list or bug tracker.

Then you can install the library:

make install

At that point you may have to rerun ldconfig or a similar utility to update your list of installed shared libs.

CMake (mainly for Windows)

Another option for compiling libxml is using CMake:

cmake -E tar xf libxml2-xxx.tar.gz
cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
cmake --build libxml2-xxx-build
cmake --install libxml2-xxx-build

Common CMake options include:

-D BUILD_SHARED_LIBS=OFF            # build static libraries
-D CMAKE_BUILD_TYPE=Release         # specify build type
-D CMAKE_INSTALL_PREFIX=/usr/local  # specify the install path
-D LIBXML2_WITH_ICONV=OFF           # disable iconv
-D LIBXML2_WITH_LZMA=OFF            # disable liblzma
-D LIBXML2_WITH_PYTHON=OFF          # disable Python
-D LIBXML2_WITH_ZLIB=OFF            # disable libz

You can also open the libxml source directory with its CMakeLists.txt directly in various IDEs such as CLion, QtCreator, or Visual Studio.

Dependencies

Libxml does not require any other libraries. A platform with somewhat recent POSIX support should be sufficient (please report any violation to this rule you may find).

However, if found at configuration time, libxml will detect and use the following libraries:

  • libz, a highly portable and widely available compression library.
  • liblzma, another compression library.
  • libiconv, a character encoding conversion library. The iconv function is part of POSIX.1-2001, so libiconv isn't required on modern UNIX-like systems like Linux, BSD or macOS.
  • ICU, a Unicode library. Mainly useful as an alternative to iconv on Windows. Unnecessary on most other systems.

Contributing

The current version of the code can be found in GNOME's GitLab at at https://gitlab.gnome.org/GNOME/libxml2. The best way to get involved is by creating issues and merge requests on GitLab. Alternatively, you can start discussions and send patches to the mailing list. If you want to work with patches, please format them with git-format-patch and use plain text attachments.

All code must conform to C89 and pass the GitLab CI tests. Add regression tests if possible.

Authors

  • Daniel Veillard
  • Bjorn Reese
  • William Brack
  • Igor Zlatkovic for the Windows port
  • Aleksey Sanin
  • Nick Wellnhofer