1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00
XML parser and toolkit
Go to file
2023-07-21 14:50:30 +02:00
.gitlab-ci gitlab-ci: Revert accidental change to setup_mingw.sh 2022-12-21 22:30:25 +01:00
doc .gitignore: Split up and rearrange .gitignore files 2023-04-30 16:22:27 +02:00
example Don't overlink executables 2022-04-03 14:08:43 +02:00
fuzz fuzz: Add valid.options 2023-03-12 19:47:07 +01:00
include SAX: Always validate xml:ids 2023-05-09 03:25:24 +02: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 .gitignore: Split up and rearrange .gitignore files 2023-04-30 16:22:27 +02:00
result runtest: Skip element name in schema error messages 2023-04-30 21:45:39 +02:00
test [CVE-2023-28484] Fix null deref in xmlSchemaFixupComplexType 2023-04-11 14:29:50 +02:00
vms Remove remaining definitions of STDC_HEADERS 2022-04-20 19:18:17 +02:00
win32 win32: Deprecate old Windows build system 2023-05-30 12:03:45 +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 .gitignore: Split up and rearrange .gitignore files 2023-04-30 16:22:27 +02:00
.gitlab-ci.yml gitlab-ci: Lower _XOPEN_SOURCE value 2023-05-25 03:25:48 +02:00
autogen.sh Build Autotools CI tests out of source tree (VPATH) 2022-04-21 06:59:02 +02:00
buf.c parser: Halt parser when growing buffer results in OOM 2023-06-08 21:59:20 +02:00
build_glob.py Remove XMLCALL and XMLCDECL macros from public headers 2022-12-08 02:48:27 +01:00
c14n.c Don't build unneeded .c source files 2022-09-02 18:33:35 +02:00
catalog.c catalog: Fix memory leaks 2023-02-21 15:22:01 +01:00
check-relaxng-test-suite2.py Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
check-relaxng-test-suite.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 testapi: Don't set http_proxy environment variable 2023-05-25 03:17:45 +02:00
config.h.cmake.in testapi: Don't set http_proxy environment variable 2023-05-25 03:17:45 +02:00
configure.ac autotools: fix Python module file ext for cygwin/msys2 2023-06-21 14:38:38 +02:00
Copyright Cleanup the Copyright to be pure MIT Licence wording 2012-09-20 21:46:19 +08: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 Remove hacky heuristic from b2dc5675e9 2022-12-01 15:31:25 +00:00
dict.c dict: Raise MAX_DICT_HASH limit 2023-05-03 19:40:57 +02:00
encoding.c parser: Halt parser when growing buffer results in OOM 2023-06-08 21:59:20 +02:00
entities.c entities: Stop counting entities 2022-12-21 20:19:10 +01:00
error.c error: Don't move past current position 2023-01-24 11:12:31 +01: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
global.data Fix SetGenericErrorFunc and SetStructured clash 2009-08-24 17:34:25 +02:00
globals.c threads: Allocate mutexes statically 2022-11-25 15:12:56 +01:00
hash.c hash: Fix possible startup crash with old libxslt versions 2023-05-06 15:28:13 +02:00
HTMLparser.c parser: Recover more input from encoding errors 2023-06-07 14:05:34 +02:00
HTMLtree.c html: Don't escape ASCII chars in href attributes 2022-11-20 21:16:03 +01:00
legacy.c Mark more static data as const 2022-04-07 12:01:23 -07:00
libxml2-config.cmake.cmake.in Add variables for configured options to CMake config files 2021-01-05 22:03:47 +01:00
libxml2-config.cmake.in Add variables for configured options to CMake config files 2021-01-05 22:03:47 +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
libxml-2.0-uninstalled.pc.in Update libxml-2.0-uninstalled.pc.in 2022-04-03 14:37:45 +02:00
libxml-2.0.pc.in Add WIN32_EXTRA_LIBADD to XML_PRIVATE_LIBS 2022-04-03 14:08:45 +02:00
libxml.h libxml.h: Add comments and indentation 2022-12-08 04:39:03 +01:00
libxml.m4 libxml.m4: Fix "possibly undefined macro" error 2023-04-30 13:18:47 +02:00
list.c Remove elfgcchack.h 2022-02-20 21:49:04 +01:00
MAINTAINERS.md Move Dockerfile to .gitlab-ci directory 2022-09-04 20:27:27 +02:00
Makefile.am autoconf: fix iconv library paths 2023-05-06 12:26:17 -04:00
nanoftp.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
nanohttp.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
NEWS Release v2.11.0 2023-04-28 14:28:33 +02:00
parser.c parser: Fix potential use-after-free in xmlParseCharDataInternal 2023-07-20 21:40:57 +02:00
parserInternals.c parser: Fix typo in previous commit 2023-06-23 23:04:30 +02:00
pattern.c malloc-fail: Fix memory leak in xmlCompileAttributeTest 2023-07-21 14:50:30 +02:00
README.md Update README.md 2022-12-08 00:54:13 +01:00
README.zOS Large batch of typo fixes 2019-09-30 18:04:38 +02:00
relaxng.c relaxng: Remove useless if statement 2023-02-21 15:46:06 +01:00
rngparser.c Remove elfgcchack.h 2022-02-20 21:49:04 +01:00
runsuite.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
runtest.c runtest: Fix compilation without LIBXML_HTML_ENABLED 2023-05-24 20:08:56 +02:00
runxmlconf.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
SAX2.c SAX: Always validate xml:ids 2023-05-09 03:25:24 +02:00
SAX.c Remove DOCBparser 2022-03-04 22:56:21 +01:00
schematron.c Stop using sprintf 2023-05-08 23:33:04 +02:00
testapi.c testapi: test_xmlSAXDefaultVersion() leaves xmlSAX2DefaultVersionValue set to 1 with LIBXML_SAX1_ENABLED 2023-06-10 10:55:38 -07:00
testchar.c test: Add push parser tests for split UTF-8 sequences 2023-05-18 19:35:16 +02:00
testdict.c dict: Raise MAX_DICT_HASH limit 2023-05-03 19:40:57 +02:00
testdso.c warning patches from Peter Breitenlohner serious DTD parsing speedups, 2005-01-25 00:22:52 +00:00
testlimits.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
testModule.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
testOOM.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +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
testrecurse.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
testThreads.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
threads.c threads: Fix startup crash with weak symbol hack 2023-05-03 19:40:57 +02:00
timsort.h Large batch of typo fixes 2019-09-30 18:04:38 +02:00
tree.c SAX: Always validate xml:ids 2023-05-09 03:25:24 +02: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 uri: Add explicit cast in xmlSaveUri 2023-01-24 11:32:15 +01:00
valid.c xmlValidatePopElement() can return invalid value (-1) 2023-04-10 13:21:53 -07:00
xinclude.c xinclude: Lower initial table size when fuzzing 2023-05-11 13:27:52 +02:00
xlink.c Remove unneeded #includes 2022-03-04 22:11:49 +01:00
xml2-config.in Remove LIBS from XML_PRIVATE_LIBS 2022-04-03 14:37:45 +02:00
xmlcatalog.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
xmlIO.c xmlIO: Remove some calls to xmlIOErr 2023-04-30 21:45:39 +02:00
xmllint.c malloc-fail: Fix null-deref with xmllint --copy 2023-06-06 13:15:46 +02:00
xmlmemory.c Stop calling xmlMemoryDump 2023-04-30 15:48:41 +02:00
xmlmodule.c Fix Windows compiler warnings in python/types.c 2022-09-04 18:36:04 +02:00
xmlreader.c parser: Improve handling of encoding and IO errors 2023-04-30 21:31:54 +02:00
xmlregexp.c regexp: Fix null deref in xmlFAFinishReduceEpsilonTransitions 2023-05-04 12:47:00 +02:00
xmlsave.c malloc-fail: Fix memory leak in xmlDocDumpFormatMemoryEnc 2023-02-17 17:16:51 +01:00
xmlschemas.c schemas: Fix filename in xmlSchemaValidateFile 2023-04-30 21:45:39 +02:00
xmlschemastypes.c malloc-fail: Handle malloc failures in xmlSchemaInitTypes 2023-03-14 15:14:38 +01:00
xmlstring.c malloc-fail: Don't call xmlErrMemory in xmlstring.c 2023-01-24 11:47:33 +01:00
xmlunicode.c Mark more static data as const 2022-04-07 12:01:23 -07:00
xmlwriter.c writer: Add error check in xmlTextWriterEndDocument 2023-04-30 21:45:39 +02:00
xpath.c xpath: Ignore entity ref nodes when computing node hash 2023-05-30 12:30:27 +02:00
xpointer.c xpath: Remove remaining references to valueFrame 2023-04-30 13:18:17 +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

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

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

To see a list of build options:

./configure --help

Also see the INSTALL file for additional instructions. Then you can configure and build the library:

./configure [possible options]
make

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