| 1 |
INTRODUCTION |
| 2 |
============ |
| 3 |
|
| 4 |
This module implements a Perl interface to the Gnome libxml2 library which |
| 5 |
provides interfaces for parsing and manipulating XML files. This module allows |
| 6 |
Perl programmers to make use of the highly capable validating XML parser and |
| 7 |
the high performance DOM implementation. |
| 8 |
|
| 9 |
|
| 10 |
IMPORTANT NOTES |
| 11 |
=============== |
| 12 |
|
| 13 |
XML::LibXML was almost entirely reimplemented between version 1.40 to version |
| 14 |
1.49. This may cause problems on some production machines. With version 1.50 a |
| 15 |
lot of compatibility fixes were applied, so programs written for XML::LibXML |
| 16 |
1.40 or less should run with version 1.50 again. |
| 17 |
|
| 18 |
In 1.59, a new callback API was introduced. This new API is not compatible with |
| 19 |
the previous one. See XML::LibXML::InputCallback manual page for details. |
| 20 |
|
| 21 |
In 1.61 the XML::LibXML::XPathContext module, previously distributed |
| 22 |
separately, was merged in. |
| 23 |
|
| 24 |
An experimental support for Perl threads introduced in 1.66 has been replaced |
| 25 |
in 1.67. |
| 26 |
|
| 27 |
|
| 28 |
DEPENDENCIES |
| 29 |
============ |
| 30 |
|
| 31 |
Prior to installation you MUST have installed the libxml2 library. You can get |
| 32 |
the latest libxml2 version from |
| 33 |
|
| 34 |
http://xmlsoft.org/ |
| 35 |
|
| 36 |
Without libxml2 installed this module will neither build nor run. |
| 37 |
|
| 38 |
Also XML::LibXML requires the following packages: |
| 39 |
|
| 40 |
o XML::SAX - base class for SAX parsers |
| 41 |
o XML::NamespaceSupport - namespace support for SAX parsers |
| 42 |
|
| 43 |
These packages are required. If one is missing some tests will fail. |
| 44 |
|
| 45 |
Again, libxml2 is required to make XML::LibXML work. The library is not just |
| 46 |
required to build XML::LibXML, it has to be accessible during run-time as well. |
| 47 |
Because of this you need to make sure libxml2 is installed properly. To test |
| 48 |
this, run the xmllint program on your system. xmllint is shipped with libxml2 |
| 49 |
and therefore should be available. For building the module you will also need |
| 50 |
the header file for libxml2, which in binary (.rpm,.deb) etc. distributions |
| 51 |
usually dwell in a package named libxml2-devel or similar. |
| 52 |
|
| 53 |
|
| 54 |
INSTALLATION |
| 55 |
============ |
| 56 |
|
| 57 |
(These instructions are for UNIX and GNU/Linux systems. For MSWin32, See Notes |
| 58 |
for Microsoft Windows below.) |
| 59 |
|
| 60 |
To install XML::LibXML just follow the standard installation routine for Perl |
| 61 |
modules: |
| 62 |
|
| 63 |
1 perl Makefile.PL |
| 64 |
2 make |
| 65 |
3 make test |
| 66 |
4 make install # as superuser |
| 67 |
|
| 68 |
Note that XML::LibXML is an XS based Perl extension and you need a C compiler |
| 69 |
to build it. |
| 70 |
|
| 71 |
Note also that you should rebuild XML::LibXML if you upgrade libxml2 in order |
| 72 |
to avoid problems with possible binary incompatibilities between releases of |
| 73 |
the library. |
| 74 |
|
| 75 |
|
| 76 |
Notes on libxml2 versions |
| 77 |
========================= |
| 78 |
|
| 79 |
XML::LibXML requires at least libxml2 2.6.16 to compile and pass all tests and |
| 80 |
at least 2.6.21 is required for XML::LibXML::Reader. For some older OS versions |
| 81 |
this means that an update of the pre-built packages is required. |
| 82 |
|
| 83 |
Although libxml2 claims binary compatibility between its patch levels, it is a |
| 84 |
good idea to recompile XML::LibXML and run its tests after an upgrade of |
| 85 |
libxml2. |
| 86 |
|
| 87 |
If your libxml2 installation is not within your $PATH, you can pass the |
| 88 |
XMLPREFIX=$YOURLIBXMLPREFIX parameter to Makefile.PL determining the correct |
| 89 |
libxml2 version in use. e.g. |
| 90 |
|
| 91 |
> perl Makefile.PL XMLPREFIX=/usr/brand-new |
| 92 |
|
| 93 |
will ask '/usr/brand-new/bin/xml2-config' about your real libxml2 |
| 94 |
configuration. |
| 95 |
|
| 96 |
Try to avoid setting INC and LIBS directly on the command-line, for if used, |
| 97 |
Makefile.PL does not check the libxml2 version for compatibility with |
| 98 |
XML::LibXML. |
| 99 |
|
| 100 |
|
| 101 |
Which version of libxml2 should be used? |
| 102 |
======================================== |
| 103 |
|
| 104 |
XML::LibXML is tested against a couple versions of libxml2 before it is |
| 105 |
released. Thus there are versions of libxml2 that are known not to work |
| 106 |
properly with XML::LibXML. The Makefile.PL keeps a blacklist of the |
| 107 |
incompatible libxml2 versions. |
| 108 |
|
| 109 |
If Makefile.PL detects one of the incompatible versions, it notifies the user. |
| 110 |
It may still happen that XML::LibXML builds and pass its tests with such a |
| 111 |
version, but that does not mean everything is OK. There will be no support at |
| 112 |
all for blacklisted versions! |
| 113 |
|
| 114 |
As of XML::LibXML 1.61, only versions 2.6.16 and higher are supported. |
| 115 |
XML::LibXML will probably not compile with earlier libxml2 versions than 2.5.6. |
| 116 |
Versions prior to 2.6.8 are known to be broken for various reasons, versions |
| 117 |
prior to 2.1.16 exhibit problems with namespaced attributes and do not |
| 118 |
therefore pass XML::LibXML regression tests. |
| 119 |
|
| 120 |
It may happen that an unsupported version of libxml2 passes all tests under |
| 121 |
certain conditions. This is no reason to assume that it shall work without |
| 122 |
problems. If Makefile.PL marks a version of libxml2 as incompatible or broken |
| 123 |
it is done for a good reason. |
| 124 |
|
| 125 |
|
| 126 |
Notes for Microsoft Windows |
| 127 |
=========================== |
| 128 |
|
| 129 |
Thanks to Randy Kobes there is a pre-compiled PPM package available on |
| 130 |
|
| 131 |
http://theoryx5.uwinnipeg.ca/ppmpackages/ |
| 132 |
|
| 133 |
Usually it takes a little time to build the package for the latest release. |
| 134 |
|
| 135 |
If you want to build XML::LibXML on Windows from source, you can use the |
| 136 |
following instructions contributed by Christopher J. Madsen: |
| 137 |
|
| 138 |
These instructions assume that you already have your system set up to compile |
| 139 |
modules that use C components. |
| 140 |
|
| 141 |
First, get the libxml2 binaries from http://xmlsoft.org/sources/win32/ |
| 142 |
(currently also available at http://www.zlatkovic.com/pub/libxml/). |
| 143 |
|
| 144 |
You need: |
| 145 |
|
| 146 |
> iconv-VERSION.win32.zip |
| 147 |
> libxml2-VERSION.win32.zip |
| 148 |
> zlib-VERSION.win32.zip |
| 149 |
|
| 150 |
Download the latest version of each. (Each package will probably have a |
| 151 |
different version.) When you extract them, you'll get directories named |
| 152 |
iconv-VERSION.win32, libxml2-VERSION.win32, and zlib-VERSION.win32, each |
| 153 |
containing bin, lib, and include directories. |
| 154 |
|
| 155 |
Combine all the bin, include, and lib directories under c:\Prog\LibXML. (You |
| 156 |
can use any directory you prefer; just adjust the instructions accordingly.) |
| 157 |
|
| 158 |
Get the latest version of XML-LibXML from CPAN. Extract it. |
| 159 |
|
| 160 |
Issue these commands in the XML-LibXML-VERSION directory: |
| 161 |
|
| 162 |
> perl Makefile.PL INC=-Ic:\Prog\LibXML\include LIBS=-Lc:\Prog\LibXML\lib |
| 163 |
> nmake |
| 164 |
> copy c:\Prog\LibXML\bin\*.dll blib\arch\auto\XML\LibXML |
| 165 |
> nmake test |
| 166 |
> nmake install |
| 167 |
|
| 168 |
(Note: Some systems use dmake instead of nmake.) |
| 169 |
|
| 170 |
By copying the libxml2 DLLs to the arch directory, you help avoid conflicts |
| 171 |
with other programs you may have installed that use other (possibly |
| 172 |
incompatible) versions of those DLLs. |
| 173 |
|
| 174 |
|
| 175 |
Notes for Mac OS X |
| 176 |
================== |
| 177 |
|
| 178 |
Due refactoring the module, XML::LibXML will not run with some earlier versions |
| 179 |
of Mac OS X. It appears that this is related to special linker options for that |
| 180 |
OS prior to version 10.2.2. Since the developers do not have full access to |
| 181 |
this OS, help/ patches from OS X gurus are highly appreciated. |
| 182 |
|
| 183 |
It is confirmed that XML::LibXML builds and runs without problems since Mac OS |
| 184 |
X 10.2.6. |
| 185 |
|
| 186 |
|
| 187 |
Notes for HPUX |
| 188 |
============== |
| 189 |
|
| 190 |
XML::LibXML requires libxml2 2.6.16 or later. There may not exist a usable |
| 191 |
binary libxml2 package for HPUX and XML::LibXML. If HPUX cc does not compile |
| 192 |
libxml2 correctly, you will be forced to recompile perl with gcc (unless you |
| 193 |
have already done that). |
| 194 |
|
| 195 |
Additionally I received the following Note from Rozi Kovesdi: |
| 196 |
|
| 197 |
> Here is my report if someone else runs into the same problem: |
| 198 |
> |
| 199 |
> Finally I am done with installing all the libraries and XML Perl |
| 200 |
> modules |
| 201 |
> |
| 202 |
> The combination that worked best for me was: |
| 203 |
> gcc |
| 204 |
> GNU make |
| 205 |
> |
| 206 |
> Most importantly - before trying to install Perl modules that depend on |
| 207 |
> libxml2: |
| 208 |
> |
| 209 |
> must set SHLIB_PATH to include the path to libxml2 shared library |
| 210 |
> |
| 211 |
> assuming that you used the default: |
| 212 |
> |
| 213 |
> export SHLIB=/usr/local/lib |
| 214 |
> |
| 215 |
> also, make sure that the config files have execute permission: |
| 216 |
> |
| 217 |
> /usr/local/bin/xml2-config |
| 218 |
> /usr/local/bin/xslt-config |
| 219 |
> |
| 220 |
> they did not have +x after they were installed by 'make install' |
| 221 |
> and it took me a while to realize that this was my problem |
| 222 |
> |
| 223 |
> or one can use: |
| 224 |
> |
| 225 |
> perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' |
| 226 |
|
| 227 |
|
| 228 |
CONTACT |
| 229 |
======= |
| 230 |
|
| 231 |
For bug reports, please use the CPAN request tracker on |
| 232 |
http://rt.cpan.org/NoAuth/Bugs.html?Dist=XML-LibXML |
| 233 |
|
| 234 |
For suggestions etc. you may contact the maintainer directly at "pajas at ufal |
| 235 |
dot mff dot cuni dot cz", but in general, it is recommended to use the mailing |
| 236 |
list given below. |
| 237 |
|
| 238 |
For suggestions etc., and other issues related to XML::LibXML you may use the |
| 239 |
perl XML mailing list ([email protected]), where most |
| 240 |
XML-related Perl modules are discussed. In case of problems you should check |
| 241 |
the archives of that list first. Many problems are already discussed there. You |
| 242 |
can find the list's archives and subscription options at |
| 243 |
http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/perl-xml |
| 244 |
|
| 245 |
|
| 246 |
PACKAGE HISTORY |
| 247 |
=============== |
| 248 |
|
| 249 |
Version < 0.98 were maintained by Matt Sergeant |
| 250 |
|
| 251 |
0.98 > Version > 1.49 were maintained by Matt Sergeant and Christian Glahn |
| 252 |
|
| 253 |
Versions >= 1.49 are maintained by Christian Glahn |
| 254 |
|
| 255 |
Versions > 1.56 are co-maintained by Petr Pajas |
| 256 |
|
| 257 |
Versions >= 1.59 are provisionally maintained by Petr Pajas |
| 258 |
|
| 259 |
|
| 260 |
PATCHES AND DEVELOPER VERSION |
| 261 |
============================= |
| 262 |
|
| 263 |
As XML::LibXML is open source software, help and patches are appreciated. If |
| 264 |
you find a bug in the current release, make sure this bug still exists in the |
| 265 |
developer version of XML::LibXML. This version can be cloned from its Git |
| 266 |
repository. For more information about that, see: |
| 267 |
|
| 268 |
https://github.com/shlomif/perl-XML-LibXML |
| 269 |
|
| 270 |
Please consider all regression tests as correct. If any test fails it is most |
| 271 |
certainly related to a bug. |
| 272 |
|
| 273 |
If you find documentation bugs, please fix them in the libxml.dbk file, stored |
| 274 |
in the docs directory. |
| 275 |
|
| 276 |
|
| 277 |
KNOWN ISSUES |
| 278 |
============ |
| 279 |
|
| 280 |
The push-parser implementation causes memory leaks. |
| 281 |
|