Remove stale TODO file
The TODO file has not been meaningfully updated since 2014, and a review of its four entries shows the contents are no longer useful:
“Fix ‘line_nubers’ in LibXML.pm (with a test)” — line_numbers is implemented (LibXML.pm:652) and tested (t/43options.t).
“Fix the ‘suppress_warnings’ similarly to RT #53270” — both suppress_warnings and suppress_errors are implemented (LibXML.pm:275-276) and tested (t/43options.t, t/49_load_html.t). RT #53270 itself was fixed in commit b3f930e (2011).
“Add a flag to disable touching the I/O callbacks (as requested by thread users on xml@gnome.org)” — fifteen-plus-year-old request with no concrete use case attached and no active asks; not actionable as written.
“Apply user-data patch (changes the proxy node data structure)” — references a patch that does not exist in the tree and would be a major architectural change with no requester behind it.
None of these warrant a GitHub issue; converting items 3 and 4 would just relocate noise. Drop the file (and its MANIFEST entry).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Introduction
This module implements a Perl interface to the Gnome libxml2 library which provides interfaces for parsing and manipulating XML files. This module allows Perl programmers to make use of its highly capable validating XML parser and its high performance DOM implementation.
Important Notes
XML::LibXML was almost entirely reimplemented between version 1.40 to version 1.49. This may cause problems on some production machines. With version 1.50 a lot of compatibility fixes were applied, so programs written for XML::LibXML 1.40 or less should run with version 1.50 again.
In 1.59, a new callback API was introduced. This new API is not compatible with the previous one. See
XML::LibXML::InputCallbackmanual page for details.In 1.61 the
XML::LibXML::XPathContextmodule, previously distributed separately, was merged in.An experimental support for Perl threads introduced in 1.66 has been replaced in 1.67.
Dependencies
Prior to installation you MUST have installed the libxml2 library. You can get the latest libxml2 version from https://gitlab.gnome.org/GNOME/libxml2.
Without libxml2 installed this module will neither build nor run.
Also XML::LibXML requires the following packages:
XML::SAX— base class for SAX parsersXML::NamespaceSupport— namespace support for SAX parsersThese packages are required. If one is missing some tests will fail.
Again, libxml2 is required to make XML::LibXML work. The library is not just required to build XML::LibXML, it has to be accessible during run-time as well. Because of this you need to make sure libxml2 is installed properly. To test this, run the
xmllintprogram on your system.xmllintis shipped with libxml2 and therefore should be available. For building the module you will also need the header file for libxml2, which in binary (.rpm,.deb) etc. distributions usually dwell in a package namedlibxml2-develor similar.Installation
(These instructions are for UNIX and GNU/Linux systems. For MSWin32, see Notes for Microsoft Windows below.)
To install XML::LibXML just follow the standard installation routine for Perl modules:
Note that XML::LibXML is an XS based Perl extension and you need a C compiler to build it.
Note also that you should rebuild XML::LibXML if you upgrade libxml2 in order to avoid problems with possible binary incompatibilities between releases of the library.
Notes on libxml2 versions
XML::LibXML requires at least libxml2 2.6.16 to compile and pass all tests and at least 2.6.21 is required for
XML::LibXML::Reader. For some older OS versions this means that an update of the pre-built packages is required.Although libxml2 claims binary compatibility between its patch levels, it is a good idea to recompile XML::LibXML and run its tests after an upgrade of libxml2.
If your libxml2 installation is not within your
$PATH, you can pass theXMLPREFIX=$YOURLIBXMLPREFIXparameter toMakefile.PLdetermining the correct libxml2 version in use. e.g.will ask
/usr/brand-new/bin/xml2-configabout your real libxml2 configuration.Try to avoid setting
INCandLIBSdirectly on the command-line, for if used,Makefile.PLdoes not check the libxml2 version for compatibility with XML::LibXML.Which version of libxml2 should be used?
XML::LibXML is tested against a couple versions of libxml2 before it is released. Thus there are versions of libxml2 that are known not to work properly with XML::LibXML. The
Makefile.PLkeeps a blacklist of the incompatible libxml2 versions usingAlien::Libxml2. The blacklist itself is kept inside itsalienfilefile.If
Makefile.PLdetects one of the incompatible versions, it notifies the user. It may still happen that XML::LibXML builds and pass its tests with such a version, but that does not mean everything is OK. There will be no support at all for blacklisted versions!As of XML::LibXML 1.61, only versions 2.6.16 and higher are supported. XML::LibXML will probably not compile with earlier libxml2 versions than 2.5.6. Versions prior to 2.6.8 are known to be broken for various reasons, versions prior to 2.1.16 exhibit problems with namespaced attributes and do not therefore pass XML::LibXML regression tests.
It may happen that an unsupported version of libxml2 passes all tests under certain conditions. This is no reason to assume that it shall work without problems. If
Makefile.PLmarks a version of libxml2 as incompatible or broken it is done for a good reason.Full linking information for libxml2 can be obtained by invoking
xml2-config --libs.Notes for Microsoft Windows
On Windows, the recommended way to install XML::LibXML is via Strawberry Perl, which ships with a working toolchain and pulls in libxml2 automatically through
Alien::Libxml2.If you need to build against a custom libxml2, pre-built Windows binaries are available from https://www.zlatkovic.com/pub/libxml/.
Notes for macOS
XML::LibXML builds and runs on supported versions of macOS. libxml2 is generally available either via the system, Homebrew (
brew install libxml2), or installed automatically byAlien::Libxml2.Notes for HPUX
XML::LibXML requires libxml2 2.6.16 or later. There may not exist a usable binary libxml2 package for HPUX and XML::LibXML. If HPUX
ccdoes not compile libxml2 correctly, you will be forced to recompile perl withgcc(unless you have already done that).Additionally I received the following Note from Rozi Kovesdi:
Contact
For bug reports and pull requests, please use the issue tracker at https://github.com/cpan-authors/XML-LibXML/issues.
Package History
Patches and Developer Version
As XML::LibXML is open source software, help and patches are appreciated. If you find a bug in the current release, make sure this bug still exists in the developer version of XML::LibXML. This version can be cloned from its Git repository. For more information about that, see:
https://github.com/cpan-authors/XML-LibXML
Please consider all regression tests as correct. If any test fails it is most certainly related to a bug.
If you find documentation bugs, please fix them in the
libxml.dbkfile, stored in thedocsdirectory.