1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-15 23:24:06 +03:00
Alex Richardson 4b959ee168 Remove hacky heuristic from b2dc5675e94aa6b5557ba63f7d66b0f08dd17e4d
Checking whether the context is close to the parent context by hardcoding
250 is not portable (I noticed tests were failing on Morello since the value
is 288 there due to pointers being 128 bits). Instead we should ensure
that the XML_VCTXT_USE_PCTXT flag is not set in cases where the user data
is not actually a parser context (or ideally add a separate field but that
would be an ABI break.

From what I can see in the source, the XML_VCTXT_USE_PCTXT is only set if
the userData field points to a valid context, and if this is not the case
the flag should be cleared when changing userData rather than relying on
the offset between the two. Looking at the history, I think
d7cb33cf44aa688f24215c9cd398c1a26f0d25ff fixed most of the need for this
workaround, but it looks like there are a few more locations that need
updating; This commit changes two more places to set/clear/copy the
XML_VCTXT_USE_PCTXT flag, so this heuristic should not be needed anymore.
I've also drop two = NULL assignment in xmllint since this is not needed
after a call to memset().

There was also an uninitialized vctxt.flags (and other fields) in
`xmlShellValidate()`, which I've fixed by adding a memset() call.
2022-12-01 15:31:25 +00:00
2022-04-03 14:08:43 +02:00
2022-11-27 02:20:53 +01:00
2020-03-08 17:41:53 +01:00
2022-05-06 10:44:03 +02:00
2022-11-27 02:11:07 +01:00
2022-04-06 19:57:30 +02:00
2022-11-22 17:01:21 +01:00
2020-07-23 20:46:42 +02:00
2022-09-02 18:33:36 +02:00
2022-11-20 21:16:03 +01:00
2022-08-18 22:46:42 +02:00
2022-09-02 18:33:35 +02:00
2022-02-20 21:49:04 +01:00
2022-11-25 15:12:56 +01:00
2022-08-18 22:46:42 +02:00
2022-04-23 17:45:35 +02:00
2022-11-25 15:12:56 +01:00
2022-09-01 02:33:57 +02:00
2022-04-07 12:01:23 -07:00
2022-03-01 17:18:56 +01:00
2022-11-27 02:20:53 +01:00
2022-11-23 11:58:14 +00:00
2022-04-06 19:57:30 +02:00
2022-02-20 21:49:04 +01:00
2020-03-08 17:41:53 +01:00
2022-09-01 02:33:57 +02:00
2022-02-20 21:49:05 +01:00
2012-05-07 15:23:25 +08:00
2019-09-30 18:04:38 +02:00
2022-02-20 21:49:04 +01:00
2022-11-22 16:03:05 +01:00
2022-11-22 16:03:05 +01:00
2022-03-04 22:56:21 +01:00
2022-09-04 20:27:21 +02:00
2022-11-22 15:49:27 +01:00
2022-11-22 16:03:05 +01:00
2022-03-04 22:11:49 +01:00
2022-03-04 22:11:49 +01:00
2022-11-22 16:03:05 +01:00
2022-11-22 16:03:05 +01:00
2019-09-30 18:04:38 +02:00
2022-02-17 19:05:26 +01:00
2022-11-20 21:16:03 +01:00
2022-03-02 00:43:54 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2020-03-08 17:41:53 +01:00
2022-11-20 21:16:03 +01:00
2022-03-04 22:11:49 +01:00
2022-08-26 02:11:56 +02:00
2022-09-02 18:33:35 +02:00
2022-09-01 04:31:30 +02:00
2022-04-07 12:01:23 -07:00
2022-09-01 02:33:57 +02:00
2022-11-27 02:11:07 +01: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
Description
XML parser and toolkit
Readme 33 MiB
Languages
C 79.1%
RPGLE 9.1%
HTML 6.1%
Python 3%
M4 0.5%
Other 2.1%