1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-28 07:21:26 +03:00
XML parser and toolkit
Go to file
Nick Wellnhofer f30adb54f5 uri: Allow port without host
Don't set port to -1 when host is missing. Host can be empty according
to spec.

Fixes #71.
2022-11-20 21:16:03 +01:00
.gitlab-ci gitlab-ci: Upgrade image to Ubuntu 22.10, reenable MSan 2022-10-25 19:34:38 +02:00
doc doc: Remove xmlDllMain from documentation and version script 2022-11-04 14:50:39 +01:00
example Don't overlink executables 2022-04-03 14:08:43 +02:00
fuzz fuzz: Add new XInclude test directory to corpus 2022-10-31 17:09:54 +01:00
include io: Remove xmlInputReadCallbackNop 2022-11-20 21:12:18 +01:00
m4 Move local Autoconf macros into m4 directory 2022-04-03 19:11:13 +02:00
optim Fix typos 2020-03-08 17:41:53 +01:00
os400 fix Schematron spelling 2022-05-06 10:44:03 +02:00
python autotools: Disable parallel Python build 2022-09-06 01:07:24 +02:00
result html: Don't escape ASCII chars in href attributes 2022-11-20 21:16:03 +01:00
test xinclude: Always allow XPtr expressions in external documents 2022-10-31 16:49:36 +01:00
vms Remove remaining definitions of STDC_HEADERS 2022-04-20 19:18:17 +02:00
win32 doc: Remove xmlDllMain from documentation and version script 2022-11-04 14:50:39 +01:00
xstc Use portable python shebangs 2022-04-06 19:57:30 +02:00
.gitattributes Fix .gitattributes 2020-07-23 20:46:42 +02:00
.gitignore Move automata test to runtest.c 2022-09-02 18:33:36 +02:00
.gitlab-ci.yml gitlab-ci: Upgrade image to Ubuntu 22.10, reenable MSan 2022-10-25 19:34:38 +02:00
autogen.sh Build Autotools CI tests out of source tree (VPATH) 2022-04-21 06:59:02 +02:00
buf.c Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
build_glob.py Port build_glob.py to Python 3 2022-08-18 22:46:42 +02:00
c14n.c Don't build unneeded .c source files 2022-09-02 18:33:35 +02:00
catalog.c warnings: Remove set-but-unused variables 2022-10-25 19:34:38 +02:00
check-relaxng-test-suite2.py Use portable python shebangs 2022-04-06 19:57:30 +02:00
check-relaxng-test-suite.py Use portable python shebangs 2022-04-06 19:57:30 +02:00
check-xinclude-test-suite.py Use portable python shebangs 2022-04-06 19:57:30 +02:00
check-xml-test-suite.py Use portable python shebangs 2022-04-06 19:57:30 +02:00
check-xsddata-test-suite.py Use portable python shebangs 2022-04-06 19:57:30 +02:00
chvalid.c Remove elfgcchack.h 2022-02-20 21:49:04 +01:00
chvalid.def Remove executable bit from non-executable files 2019-09-16 15:48:59 +02:00
CMakeLists.txt cmake: Build static library with -DLIBXML_STATIC 2022-10-18 19:17:45 +02:00
config.h.cmake.in build: Remove check for broken ss_family 2022-09-06 01:07:24 +02:00
configure.ac autotools: Don't use version script on Windows 2022-09-20 14:39:52 +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 Consolidate private header files 2022-08-26 02:11:56 +02:00
dict.c warnings: Remove set-but-unused variables 2022-10-25 19:34:38 +02:00
encoding.c Remove explicit integer casts 2022-09-01 02:33:57 +02:00
entities.c [CVE-2022-40304] Fix dict corruption caused by entity reference cycles 2022-10-14 15:02:06 +02:00
error.c error: Don't use initGenericErrorDefaultFunc 2022-09-09 13:52:48 +02:00
genChRanges.py Port genChRanges.py to Python 3 2022-08-18 22:46:42 +02:00
gentest.py Make gentest.py work with Python 2 2022-08-17 11:22:38 +02:00
genUnicode.py Port genUnicode.py to Python 3 2022-04-23 17:45:35 +02:00
global.data Fix SetGenericErrorFunc and SetStructured clash 2009-08-24 17:34:25 +02:00
globals.c Remove explicit integer casts 2022-09-01 02:33:57 +02:00
hash.c Remove explicit integer casts 2022-09-01 02:33:57 +02:00
HTMLparser.c Remove or annotate char casts 2022-09-01 04:31:30 +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 doc: Remove xmlDllMain from documentation and version script 2022-11-04 14:50:39 +01: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 Fix Windows compiler warnings in python/types.c 2022-09-04 18:36:04 +02:00
libxml.m4 Redirect links to xmlsoft.org 2022-02-13 23:10:00 +01:00
libxml.spec.in Use portable python shebangs 2022-04-06 19:57:30 +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 Disable fuzzer tests if glob.h wasn't found 2022-09-04 18:36:04 +02:00
Makefile.tests Fix typos 2020-03-08 17:41:53 +01:00
nanoftp.c build: Remove check for broken ss_family 2022-09-06 01:07:24 +02:00
nanohttp.c Bypass proxy in nanoHTTP for hosts in "no_proxy" 2022-11-04 12:34:39 +00:00
NEWS doc: Mention new location of XML catalog as breaking change 2022-11-13 15:21:22 +01:00
parser.c io: Don't shrink memory input buffers 2022-11-20 21:16:03 +01:00
parserInternals.c io: Fix a few integer overflows in I/O statistics 2022-11-20 21:16:03 +01:00
pattern.c Remove explicit integer casts 2022-09-01 02:33:57 +02:00
README.md Add note about optimization flags 2022-02-20 21:49:05 +01:00
README.tests Update README.tests 2012-05-07 15:23:25 +08:00
README.zOS Large batch of typo fixes 2019-09-30 18:04:38 +02:00
relaxng.c Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
rngparser.c Remove elfgcchack.h 2022-02-20 21:49:04 +01:00
runsuite.c Stop including sys/types.h 2022-09-02 18:33:36 +02:00
runtest.c xinclude: Don't create result doc for test with errors 2022-10-23 14:27:05 +02:00
runxmlconf.c Stop including sys/types.h 2022-09-02 18:33:36 +02:00
SAX2.c malloc-fail: Fix memory leak in xmlSAX2ExternalSubset 2022-11-02 16:05:05 +01:00
SAX.c Remove DOCBparser 2022-03-04 22:56:21 +01:00
schematron.c Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
testapi.c testapi: Disable on Windows for now 2022-09-04 20:27:21 +02:00
testchar.c Consolidate private header files 2022-08-26 02:11:56 +02:00
testdict.c Remove various unused value assignments 2014-10-27 21:18:57 +08:00
testdso.c warning patches from Peter Breitenlohner serious DTD parsing speedups, 2005-01-25 00:22:52 +00:00
testlimits.c Stop including sys/types.h 2022-09-02 18:33:36 +02:00
testModule.c Fix some format string warnings with possible format string vulnerability 2016-05-23 15:01:07 +08:00
testOOM.c Remove unneeded #includes 2022-03-04 22:11:49 +01: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 including sys/types.h 2022-09-02 18:33:36 +02:00
testThreads.c Remove HAVE_WIN32_THREADS configuration flag 2022-09-04 01:49:41 +02:00
threads.c threads: Remove check for pthread_equal 2022-10-25 19:34:38 +02:00
timsort.h Large batch of typo fixes 2019-09-30 18:04:38 +02:00
TODO Remove SVN keyword anchors 2022-02-17 19:05:26 +01:00
TODO_SCHEMAS merged the current state of XML Schemas implementation, it is not 2002-04-16 15:50:10 +00:00
tree.c malloc-fail: Fix memory leak in xmlStringGetNodeList 2022-11-02 16:22:54 +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 uri: Allow port without host 2022-11-20 21:16:03 +01:00
valid.c Fix --with-valid --without-regexps build 2022-09-02 18:33:35 +02:00
xinclude.c malloc-fail: Fix use-after-free in xmlXIncludeAddNode 2022-11-02 16:13:27 +01: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 Respect --sysconfdir in source files 2022-03-30 14:36:49 +00:00
xmlIO.c io: Fix a few integer overflows in I/O statistics 2022-11-20 21:16:03 +01:00
xmllint.c xmllint: Improve handling of empty XPath node sets 2022-10-19 02:51:14 +02:00
xmlmemory.c Deprecate module init and cleanup functions 2022-03-06 15:59:43 +01:00
xmlmodule.c Fix Windows compiler warnings in python/types.c 2022-09-04 18:36:04 +02:00
xmlreader.c io: Don't shrink memory input buffers 2022-11-20 21:16:03 +01:00
xmlregexp.c Consolidate private header files 2022-08-26 02:11:56 +02:00
xmlsave.c Move xmlIsXHTML to tree.c 2022-09-02 18:33:35 +02:00
xmlschemas.c schemas: Fix infinite loop in xmlSchemaCheckElemSubstGroup 2022-11-02 10:55:29 +01:00
xmlschemastypes.c Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
xmlstring.c Remove or annotate char casts 2022-09-01 04:31:30 +02:00
xmlunicode.c Mark more static data as const 2022-04-07 12:01:23 -07:00
xmlwriter.c Remove explicit integer casts 2022-09-01 02:33:57 +02:00
xpath.c warnings: Remove set-but-unused variables 2022-10-25 19:34:38 +02:00
xpointer.c Don't use sizeof(xmlChar) or sizeof(char) 2022-09-01 03:35:19 +02:00
xzlib.c Stop including sys/types.h 2022-09-02 18:33:36 +02:00

libxml2

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

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

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

A mailing list xml@gnome.org is available. You can subscribe at https://mail.gnome.org/mailman/listinfo/xml. The list archive is at https://mail.gnome.org/archives/xml/.

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