1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2    "http://www.w3.org/TR/html4/loose.dtd">
3<html>
4<head>
5  <title>The XML C parser and toolkit of Gnome</title>
6  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7</head>
8<body bgcolor="#ffffff">
9<h1 align="center">The XML C parser and toolkit of Gnome</h1>
10
11<h1>Note: this is the flat content of the <a href="index.html">web
12site</a></h1>
13
14<h1 style="text-align: center">libxml, a.k.a. gnome-xml</h1>
15
16<p></p>
17
18<p
19style="text-align: right; font-style: italic; font-size: 10pt">"Programming
20with libxml2 is like the thrilling embrace of an exotic stranger." <a
21href="http://diveintomark.org/archives/2004/02/18/libxml2">Mark
22Pilgrim</a></p>
23
24<p>Libxml2 is the XML C parser and toolkit developed for the Gnome project
25(but usable outside of the Gnome platform), it is free software available
26under the <a href="http://www.opensource.org/licenses/mit-license.html">MIT
27License</a>. XML itself is a metalanguage to design markup languages, i.e.
28text language where semantic and structure are added to the content using
29extra "markup" information enclosed between angle brackets. HTML is the most
30well-known markup language. Though the library is written in C <a
31href="python.html">a variety of language bindings</a> make it available in
32other environments.</p>
33
34<p>Libxml2 is known to be very portable, the library should build and work
35without serious troubles on a variety of systems (Linux, Unix, Windows,
36CygWin, MacOS, MacOS X, RISC Os, OS/2, VMS, QNX, MVS, VxWorks, ...)</p>
37
38<p>Libxml2 implements a number of existing standards related to markup
39languages:</p>
40<ul>
41  <li>the XML standard: <a
42    href="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</a></li>
43  <li>Namespaces in XML: <a
44    href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a></li>
45  <li>XML Base: <a
46    href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a></li>
47  <li><a href="http://www.cis.ohio-state.edu/rfc/rfc2396.txt">RFC 2396</a> :
48    Uniform Resource Identifiers <a
49    href="http://www.ietf.org/rfc/rfc2396.txt">http://www.ietf.org/rfc/rfc2396.txt</a></li>
50  <li>XML Path Language (XPath) 1.0: <a
51    href="http://www.w3.org/TR/xpath">http://www.w3.org/TR/xpath</a></li>
52  <li>HTML4 parser: <a
53    href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a></li>
54  <li>XML Pointer Language (XPointer) Version 1.0: <a
55    href="http://www.w3.org/TR/xptr">http://www.w3.org/TR/xptr</a></li>
56  <li>XML Inclusions (XInclude) Version 1.0: <a
57    href="http://www.w3.org/TR/xinclude/">http://www.w3.org/TR/xinclude/</a></li>
58  <li>ISO-8859-x encodings, as well as <a
59    href="http://www.cis.ohio-state.edu/rfc/rfc2044.txt">rfc2044</a> [UTF-8]
60    and <a href="http://www.cis.ohio-state.edu/rfc/rfc2781.txt">rfc2781</a>
61    [UTF-16] Unicode encodings, and more if using iconv support</li>
62  <li>part of SGML Open Technical Resolution TR9401:1997</li>
63  <li>XML Catalogs Working Draft 06 August 2001: <a
64    href="http://www.oasis-open.org/committees/entity/spec-2001-08-06.html">http://www.oasis-open.org/committees/entity/spec-2001-08-06.html</a></li>
65  <li>Canonical XML Version 1.0: <a
66    href="http://www.w3.org/TR/xml-c14n">http://www.w3.org/TR/xml-c14n</a>
67    and the Exclusive XML Canonicalization CR draft <a
68    href="http://www.w3.org/TR/xml-exc-c14n">http://www.w3.org/TR/xml-exc-c14n</a></li>
69  <li>Relax NG, ISO/IEC 19757-2:2003, <a
70    href="http://www.oasis-open.org/committees/relax-ng/spec-20011203.html">http://www.oasis-open.org/committees/relax-ng/spec-20011203.html</a></li>
71  <li>W3C XML Schemas Part 2: Datatypes <a
72    href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">REC 02 May
73    2001</a></li>
74  <li>W3C <a href="http://www.w3.org/TR/xml-id/">xml:id</a> Working Draft 7
75    April 2004</li>
76</ul>
77
78<p>In most cases libxml2 tries to implement the specifications in a
79relatively strictly compliant way. As of release 2.4.16, libxml2 passed all
801800+ tests from the <a
81href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML Tests
82Suite</a>.</p>
83
84<p>To some extent libxml2 provides support for the following additional
85specifications but doesn't claim to implement them completely:</p>
86<ul>
87  <li>Document Object Model (DOM) <a
88    href="http://www.w3.org/TR/DOM-Level-2-Core/">http://www.w3.org/TR/DOM-Level-2-Core/</a>
89    the document model, but it doesn't implement the API itself, gdome2 does
90    this on top of libxml2</li>
91  <li><a href="http://www.cis.ohio-state.edu/rfc/rfc959.txt">RFC 959</a> :
92    libxml2 implements a basic FTP client code</li>
93  <li><a href="http://www.cis.ohio-state.edu/rfc/rfc1945.txt">RFC 1945</a> :
94    HTTP/1.0, again a basic HTTP client code</li>
95  <li>SAX: a SAX2 like interface and a minimal SAX1 implementation compatible
96    with early expat versions</li>
97</ul>
98
99<p>A partial implementation of <a
100href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML Schemas Part
1011: Structure</a> is being worked on but it would be far too early to make any
102conformance statement about it at the moment.</p>
103
104<p>Separate documents:</p>
105<ul>
106  <li><a href="http://xmlsoft.org/XSLT/">the libxslt page</a> providing an
107    implementation of XSLT 1.0 and common extensions like EXSLT for
108  libxml2</li>
109  <li><a href="http://gdome2.cs.unibo.it/">the gdome2 page</a>
110    : a standard DOM2 implementation for libxml2</li>
111  <li><a href="http://www.aleksey.com/xmlsec/">the XMLSec page</a>: an
112    implementation of <a href="http://www.w3.org/TR/xmldsig-core/">W3C XML
113    Digital Signature</a> for libxml2</li>
114  <li>also check the related links section for more related and active
115    projects.</li>
116</ul>
117<p> Hosting sponsored by <a href="http://www.aoemedia.de/opensource-cms.html"
118>Open Source CMS services</a> from AOE media.</p>
119
120<p>Logo designed by <a href="mailto:liyanage@access.ch">Marc Liyanage</a>.</p>
121
122<h2><a name="Introducti">Introduction</a></h2>
123
124<p>This document describes libxml, the <a
125href="http://www.w3.org/XML/">XML</a> C parser and toolkit developed for the
126<a href="http://www.gnome.org/">Gnome</a> project. <a
127href="http://www.w3.org/XML/">XML is a standard</a> for building tag-based
128structured documents/data.</p>
129
130<p>Here are some key points about libxml:</p>
131<ul>
132  <li>Libxml2 exports Push (progressive) and Pull (blocking) type parser
133    interfaces for both XML and HTML.</li>
134  <li>Libxml2 can do DTD validation at parse time, using a parsed document
135    instance, or with an arbitrary DTD.</li>
136  <li>Libxml2 includes complete <a
137    href="http://www.w3.org/TR/xpath">XPath</a>, <a
138    href="http://www.w3.org/TR/xptr">XPointer</a> and <a
139    href="http://www.w3.org/TR/xinclude">XInclude</a> implementations.</li>
140  <li>It is written in plain C, making as few assumptions as possible, and
141    sticking closely to ANSI C/POSIX for easy embedding. Works on
142    Linux/Unix/Windows, ported to a number of other platforms.</li>
143  <li>Basic support for HTTP and FTP client allowing applications to fetch
144    remote resources.</li>
145  <li>The design is modular, most of the extensions can be compiled out.</li>
146  <li>The internal document representation is as close as possible to the <a
147    href="http://www.w3.org/DOM/">DOM</a> interfaces.</li>
148  <li>Libxml2 also has a <a
149    href="http://www.megginson.com/SAX/index.html">SAX like interface</a>;
150    the interface is designed to be compatible with <a
151    href="http://www.jclark.com/xml/expat.html">Expat</a>.</li>
152  <li>This library is released under the <a
153    href="http://www.opensource.org/licenses/mit-license.html">MIT
154    License</a>. See the Copyright file in the distribution for the precise
155    wording.</li>
156</ul>
157
158<p>Warning: unless you are forced to because your application links with a
159Gnome-1.X library requiring it,  <strong><span
160style="background-color: #FF0000">Do Not Use libxml1</span></strong>, use
161libxml2</p>
162
163<h2><a name="FAQ">FAQ</a></h2>
164
165<p>Table of Contents:</p>
166<ul>
167  <li><a href="FAQ.html#License">License(s)</a></li>
168  <li><a href="FAQ.html#Installati">Installation</a></li>
169  <li><a href="FAQ.html#Compilatio">Compilation</a></li>
170  <li><a href="FAQ.html#Developer">Developer corner</a></li>
171</ul>
172
173<h3><a name="License">License</a>(s)</h3>
174<ol>
175  <li><em>Licensing Terms for libxml</em>
176    <p>libxml2 is released under the <a
177    href="http://www.opensource.org/licenses/mit-license.html">MIT
178    License</a>; see the file Copyright in the distribution for the precise
179    wording</p>
180  </li>
181  <li><em>Can I embed libxml2 in a proprietary application ?</em>
182    <p>Yes. The MIT License allows you to keep proprietary the changes you
183    made to libxml, but it would be graceful to send-back bug fixes and
184    improvements as patches for possible incorporation in the main
185    development tree.</p>
186  </li>
187</ol>
188
189<h3><a name="Installati">Installation</a></h3>
190<ol>
191  <li><strong><span style="background-color: #FF0000">Do Not Use
192    libxml1</span></strong>, use libxml2</li>
193  <p></p>
194  <li><em>Where can I get libxml</em> ?
195    <p>The original distribution comes from <a
196    href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a> or <a
197    href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">gnome.org</a></p>
198    <p>Most Linux and BSD distributions include libxml, this is probably the
199    safer way for end-users to use libxml.</p>
200    <p>David Doolin provides precompiled Windows versions at <a
201    href="http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/         ">http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/</a></p>
202  </li>
203  <p></p>
204  <li><em>I see libxml and libxml2 releases, which one should I install ?</em>
205    <ul>
206      <li>If you are not constrained by backward compatibility issues with
207        existing applications, install libxml2 only</li>
208      <li>If you are not doing development, you can safely install both.
209        Usually the packages <a
210        href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a
211        href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a> are
212        compatible (this is not the case for development packages).</li>
213      <li>If you are a developer and your system provides separate packaging
214        for shared libraries and the development components, it is possible
215        to install libxml and libxml2, and also <a
216        href="http://rpmfind.net/linux/RPM/libxml-devel.html">libxml-devel</a>
217        and <a
218        href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>
219        too for libxml2 &gt;= 2.3.0</li>
220      <li>If you are developing a new application, please develop against
221        libxml2(-devel)</li>
222    </ul>
223  </li>
224  <li><em>I can't install the libxml package, it conflicts with libxml0</em>
225    <p>You probably have an old libxml0 package used to provide the shared
226    library for libxml.so.0, you can probably safely remove it. The libxml
227    packages provided on <a
228    href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a> provide
229    libxml.so.0</p>
230  </li>
231  <li><em>I can't install the libxml(2) RPM package due to failed
232    dependencies</em>
233    <p>The most generic solution is to re-fetch the latest src.rpm , and
234    rebuild it locally with</p>
235    <p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p>
236    <p>If everything goes well it will generate two binary rpm packages (one
237    providing the shared libs and xmllint, and the other one, the -devel
238    package, providing includes, static libraries and scripts needed to build
239    applications with libxml(2)) that you can install locally.</p>
240  </li>
241</ol>
242
243<h3><a name="Compilatio">Compilation</a></h3>
244<ol>
245  <li><em>What is the process to compile libxml2 ?</em>
246    <p>As most UNIX libraries libxml2 follows the "standard":</p>
247    <p><code>gunzip -c xxx.tar.gz | tar xvf -</code></p>
248    <p><code>cd libxml-xxxx</code></p>
249    <p><code>./configure --help</code></p>
250    <p>to see the options, then the compilation/installation proper</p>
251    <p><code>./configure [possible options]</code></p>
252    <p><code>make</code></p>
253    <p><code>make install</code></p>
254    <p>At that point you may have to rerun ldconfig or a similar utility to
255    update your list of installed shared libs.</p>
256  </li>
257  <li><em>What other libraries are needed to compile/install libxml2 ?</em>
258    <p>Libxml2 does not require any other library, the normal C ANSI API
259    should be sufficient (please report any violation to this rule you may
260    find).</p>
261    <p>However if found at configuration time libxml2 will detect and use the
262    following libs:</p>
263    <ul>
264      <li><a href="http://www.info-zip.org/pub/infozip/zlib/">libz</a> : a
265        highly portable and available widely compression library.</li>
266      <li>iconv: a powerful character encoding conversion library. It is
267        included by default in recent glibc libraries, so it doesn't need to
268        be installed specifically on Linux. It now seems a <a
269        href="http://www.opennc.org/onlinepubs/7908799/xsh/iconv.html">part
270        of the official UNIX</a> specification. Here is one <a
271        href="http://www.gnu.org/software/libiconv/">implementation of the
272        library</a> which source can be found <a
273        href="ftp://ftp.ilog.fr/pub/Users/haible/gnu/">here</a>.</li>
274    </ul>
275  </li>
276  <p></p>
277  <li><em>Make check fails on some platforms</em>
278    <p>Sometimes the regression tests' results don't completely match the
279    value produced by the parser, and the makefile uses diff to print the
280    delta. On some platforms the diff return breaks the compilation process;
281    if the diff is small this is probably not a serious problem.</p>
282    <p>Sometimes (especially on Solaris) make checks fail due to limitations
283    in make. Try using GNU-make instead.</p>
284  </li>
285  <li><em>I use the SVN version and there is no configure script</em>
286    <p>The configure script (and other Makefiles) are generated. Use the
287    autogen.sh script to regenerate the configure script and Makefiles,
288    like:</p>
289    <p><code>./autogen.sh --prefix=/usr --disable-shared</code></p>
290  </li>
291  <li><em>I have troubles when running make tests with gcc-3.0</em>
292    <p>It seems the initial release of gcc-3.0 has a problem with the
293    optimizer which miscompiles the URI module. Please use another
294    compiler.</p>
295  </li>
296</ol>
297
298<h3><a name="Developer">Developer</a> corner</h3>
299<ol>
300  <li><em>Troubles compiling or linking programs using libxml2</em>
301    <p>Usually the problem comes from the fact that the compiler doesn't get
302    the right compilation or linking flags. There is a small shell script
303    <code>xml2-config</code> which is installed as part of libxml2 usual
304    install process which provides those flags. Use</p>
305    <p><code>xml2-config --cflags</code></p>
306    <p>to get the compilation flags and</p>
307    <p><code>xml2-config --libs</code></p>
308    <p>to get the linker flags. Usually this is done directly from the
309    Makefile as:</p>
310    <p><code>CFLAGS=`xml2-config --cflags`</code></p>
311    <p><code>LIBS=`xml2-config --libs`</code></p>
312  </li>
313  <li><em>I want to install my own copy of libxml2 in my home directory and
314    link my programs against it, but it doesn't work</em>
315    <p>There are many different ways to accomplish this.  Here is one way to
316    do this under Linux.  Suppose your home directory is <code>/home/user.
317    </code>Then:</p>
318    <ul>
319      <li>Create a subdirectory, let's call it <code>myxml</code></li>
320      <li>unpack the libxml2 distribution into that subdirectory</li>
321      <li>chdir into the unpacked distribution
322        (<code>/home/user/myxml/libxml2 </code>)</li>
323      <li>configure the library using the "<code>--prefix</code>" switch,
324        specifying an installation subdirectory in
325        <code>/home/user/myxml</code>, e.g.
326        <p><code>./configure --prefix /home/user/myxml/xmlinst</code> {other
327        configuration options}</p>
328      </li>
329      <li>now run <code>make</code> followed by <code>make install</code></li>
330      <li>At this point, the installation subdirectory contains the complete
331        "private" include files, library files and binary program files (e.g.
332        xmllint), located in
333        <p><code>/home/user/myxml/xmlinst/lib,
334        /home/user/myxml/xmlinst/include </code> and <code>
335        /home/user/myxml/xmlinst/bin</code></p>
336        respectively.</li>
337      <li>In order to use this "private" library, you should first add it to
338        the beginning of your default PATH (so that your own private program
339        files such as xmllint will be used instead of the normal system
340        ones).  To do this, the Bash command would be
341        <p><code>export PATH=/home/user/myxml/xmlinst/bin:$PATH</code></p>
342      </li>
343      <li>Now suppose you have a program <code>test1.c</code> that you would
344        like to compile with your "private" library.  Simply compile it using
345        the command
346        <p><code>gcc `xml2-config --cflags --libs` -o test test.c</code></p>
347        Note that, because your PATH has been set with <code>
348        /home/user/myxml/xmlinst/bin</code> at the beginning, the xml2-config
349        program which you just installed will be used instead of the system
350        default one, and this will <em>automatically</em> get the correct
351        libraries linked with your program.</li>
352    </ul>
353  </li>
354
355  <p></p>
356  <li><em>xmlDocDump() generates output on one line.</em>
357    <p>Libxml2 will not <strong>invent</strong> spaces in the content of a
358    document since <strong>all spaces in the content of a document are
359    significant</strong>. If you build a tree from the API and want
360    indentation:</p>
361    <ol>
362      <li>the correct way is to generate those yourself too.</li>
363      <li>the dangerous way is to ask libxml2 to add those blanks to your
364        content <strong>modifying the content of your document in the
365        process</strong>. The result may not be what you expect. There is
366        <strong>NO</strong> way to guarantee that such a modification won't
367        affect other parts of the content of your document. See <a
368        href="http://xmlsoft.org/html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault
369        ()</a> and <a
370        href="http://xmlsoft.org/html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile
371        ()</a></li>
372    </ol>
373  </li>
374  <p></p>
375  <li><em>Extra nodes in the document:</em>
376    <p><em>For an XML file as below:</em></p>
377    <pre>&lt;?xml version="1.0"?&gt;
378&lt;PLAN xmlns="http://www.argus.ca/autotest/1.0/"&gt;
379&lt;NODE CommFlag="0"/&gt;
380&lt;NODE CommFlag="1"/&gt;
381&lt;/PLAN&gt;</pre>
382    <p><em>after parsing it with the function
383    pxmlDoc=xmlParseFile(...);</em></p>
384    <p><em>I want to the get the content of the first node (node with the
385    CommFlag="0")</em></p>
386    <p><em>so I did it as following;</em></p>
387    <pre>xmlNodePtr pnode;
388pnode=pxmlDoc-&gt;children-&gt;children;</pre>
389    <p><em>but it does not work. If I change it to</em></p>
390    <pre>pnode=pxmlDoc-&gt;children-&gt;children-&gt;next;</pre>
391    <p><em>then it works.  Can someone explain it to me.</em></p>
392    <p></p>
393    <p>In XML all characters in the content of the document are significant
394    <strong>including blanks and formatting line breaks</strong>.</p>
395    <p>The extra nodes you are wondering about are just that, text nodes with
396    the formatting spaces which are part of the document but that people tend
397    to forget. There is a function <a
398    href="http://xmlsoft.org/html/libxml-parser.html">xmlKeepBlanksDefault
399    ()</a>  to remove those at parse time, but that's an heuristic, and its
400    use should be limited to cases where you are certain there is no
401    mixed-content in the document.</p>
402  </li>
403  <li><em>I get compilation errors of existing code like when accessing
404    <strong>root</strong> or <strong>child fields</strong> of nodes.</em>
405    <p>You are compiling code developed for libxml version 1 and using a
406    libxml2 development environment. Either switch back to libxml v1 devel or
407    even better fix the code to compile with libxml2 (or both) by <a
408    href="upgrade.html">following the instructions</a>.</p>
409  </li>
410  <li><em>I get compilation errors about non existing
411    <strong>xmlRootNode</strong> or <strong>xmlChildrenNode</strong>
412    fields.</em>
413    <p>The source code you are using has been <a
414    href="upgrade.html">upgraded</a> to be able to compile with both libxml
415    and libxml2, but you need to install a more recent version:
416    libxml(-devel) &gt;= 1.8.8 or libxml2(-devel) &gt;= 2.1.0</p>
417  </li>
418  <li><em>Random crashes in threaded applications</em>
419    <p>Read and follow all advices on the <a href="threads.html">thread
420    safety</a> page, and make 100% sure you never call xmlCleanupParser()
421    while the library or an XML document might still be in use by another
422    thread.</p>
423  </li>
424  <li><em>The example provided in the web page does not compile.</em>
425    <p>It's hard to maintain the documentation in sync with the code
426    &lt;grin/&gt; ...</p>
427    <p>Check the previous points 1/ and 2/ raised before, and please send
428    patches.</p>
429  </li>
430  <li><em>Where can I get more examples and information than provided on the
431    web page?</em>
432    <p>Ideally a libxml2 book would be nice. I have no such plan ... But you
433    can:</p>
434    <ul>
435      <li>check more deeply the <a href="html/libxml-lib.html">existing
436        generated doc</a></li>
437      <li>have a look at <a href="examples/index.html">the set of
438        examples</a>.</li>
439      <li>look for examples of use for libxml2 function using the Gnome code
440          or by asking on Google.</li>
441      <li><a
442        href="http://svn.gnome.org/viewvc/libxml2/trunk/">Browse
443        the libxml2 source</a> , I try to write code as clean and documented
444        as possible, so looking at it may be helpful. In particular the code
445        of <a href="http://svn.gnome.org/viewvc/libxml2/trunk/xmllint.c?view=markup">xmllint.c</a> and of the various testXXX.c test programs should
446        provide good examples of how to do things with the library.</li>
447    </ul>
448  </li>
449  <p></p>
450  <li><em>What about C++ ?</em>
451    <p>libxml2 is written in pure C in order to allow easy reuse on a number
452    of platforms, including embedded systems. I don't intend to convert to
453    C++.</p>
454    <p>There is however a C++ wrapper which may fulfill your needs:</p>
455    <ul>
456      <li>by Ari Johnson &lt;ari@btigate.com&gt;:
457        <p>Website: <a
458        href="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</a></p>
459        <p>Download: <a
460        href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p>
461      </li>
462    </ul>
463  </li>
464  <li><em>How to validate a document a posteriori ?</em>
465    <p>It is possible to validate documents which had not been validated at
466    initial parsing time or documents which have been built from scratch
467    using the API. Use the <a
468    href="http://xmlsoft.org/html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd()</a>
469    function. It is also possible to simply add a DTD to an existing
470    document:</p>
471    <pre>xmlDocPtr doc; /* your existing document */
472xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
473
474        dtd-&gt;name = xmlStrDup((xmlChar*)"root_name"); /* use the given root */
475
476        doc-&gt;intSubset = dtd;
477        if (doc-&gt;children == NULL) xmlAddChild((xmlNodePtr)doc, (xmlNodePtr)dtd);
478        else xmlAddPrevSibling(doc-&gt;children, (xmlNodePtr)dtd);
479          </pre>
480  </li>
481  <li><em>So what is this funky "xmlChar" used all the time?</em>
482    <p>It is a null terminated sequence of utf-8 characters. And only utf-8!
483    You need to convert strings encoded in different ways to utf-8 before
484    passing them to the API.  This can be accomplished with the iconv library
485    for instance.</p>
486  </li>
487  <li>etc ...</li>
488</ol>
489
490<p></p>
491
492<h2><a name="Documentat">Developer Menu</a></h2>
493
494<p>There are several on-line resources related to using libxml:</p>
495<ol>
496  <li>Use the <a href="search.php">search engine</a> to look up
497  information.</li>
498  <li>Check the <a href="FAQ.html">FAQ.</a></li>
499  <li>Check the <a href="http://xmlsoft.org/html/libxml-lib.html">extensive
500    documentation</a> automatically extracted from code comments.</li>
501  <li>Look at the documentation about <a href="encoding.html">libxml
502    internationalization support</a>.</li>
503  <li>This page provides a global overview and <a href="example.html">some
504    examples</a> on how to use libxml.</li>
505  <li><a href="examples/index.html">Code examples</a></li>
506  <li>John Fleck's libxml2 tutorial: <a href="tutorial/index.html">html</a>
507    or <a href="tutorial/xmltutorial.pdf">pdf</a>.</li>
508  <li>If you need to parse large files, check the <a
509    href="xmlreader.html">xmlReader</a> API tutorial</li>
510  <li><a href="mailto:james@daa.com.au">James Henstridge</a> wrote <a
511    href="http://www.jamesh.id.au/articles/libxml-sax/libxml-sax.html">some nice
512    documentation</a> explaining how to use the libxml SAX interface.</li>
513  <li>George Lebl wrote <a
514    href="http://www-106.ibm.com/developerworks/library/l-gnome3/">an article
515    for IBM developerWorks</a> about using libxml.</li>
516  <li>Check <a href="http://svn.gnome.org/viewvc/libxml2/trunk/TODO?view=markup">the TODO
517    file</a>.</li>
518  <li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a>
519    description. If you are starting a new project using libxml you should
520    really use the 2.x version.</li>
521  <li>And don't forget to look at the <a
522    href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li>
523</ol>
524
525<h2><a name="Reporting">Reporting bugs and getting help</a></h2>
526
527<p>Well, bugs or missing features are always possible, and I will make a
528point of fixing them in a timely fashion. The best way to report a bug is to
529use the <a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Gnome
530bug tracking database</a> (make sure to use the "libxml2" module name). I
531look at reports there regularly and it's good to have a reminder when a bug
532is still open. Be sure to specify that the bug is for the package libxml2.</p>
533
534<p>For small problems you can try to get help on IRC, the #xml channel on
535irc.gnome.org (port 6667) usually has a few people subscribed which may help
536(but there is no guarantee and if a real issue is raised it should go on the
537mailing-list for archival).</p>
538
539<p>There is also a mailing-list <a
540href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an  <a
541href="http://mail.gnome.org/archives/xml/">on-line archive</a> (<a
542href="http://xmlsoft.org/messages">old</a>). To subscribe to this list,
543please visit the <a
544href="http://mail.gnome.org/mailman/listinfo/xml">associated Web</a> page and
545follow the instructions. <strong>Do not send code, I won't debug it</strong>
546(but patches are really appreciated!).</p>
547
548<p>Please note that with the current amount of virus and SPAM, sending mail
549to the list without being subscribed won't work. There is *far too many
550bounces* (in the order of a thousand a day !) I cannot approve them manually
551anymore. If your mail to the list bounced waiting for administrator approval,
552it is LOST ! Repost it and fix the problem triggering the error. Also please
553note that <span style="color: #FF0000; background-color: #FFFFFF">emails with
554a legal warning asking to not copy or redistribute freely the information
555they contain</span> are <strong>NOT</strong> acceptable for the mailing-list,
556such mail will as much as possible be discarded automatically, and are less
557likely to be answered if they made it to the list, <strong>DO NOT</strong>
558post to the list from an email address where such legal requirements are
559automatically added, get private paying support if you can't share
560information.</p>
561
562<p>Check the following <strong><span style="color: #FF0000">before
563posting</span></strong>:</p>
564<ul>
565  <li>Read the <a href="FAQ.html">FAQ</a> and <a href="search.php">use the
566    search engine</a> to get information related to your problem.</li>
567  <li>Make sure you are <a href="ftp://xmlsoft.org/libxml2/">using a recent
568    version</a>, and that the problem still shows up in a recent version.</li>
569  <li>Check the <a href="http://mail.gnome.org/archives/xml/">list
570    archives</a> to see if the problem was reported already. In this case
571    there is probably a fix available, similarly check the <a
572    href="https://gitlab.gnome.org/GNOME/libxml2/issues">registered
573    open bugs</a>.</li>
574  <li>Make sure you can reproduce the bug with xmllint or one of the test
575    programs found in source in the distribution.</li>
576  <li>Please send the command showing the error as well as the input (as an
577    attachment)</li>
578</ul>
579
580<p>Then send the bug with associated information to reproduce it to the <a
581href="mailto:xml@gnome.org">xml@gnome.org</a> list; if it's really libxml
582related I will approve it. Please do not send mail to me directly, it makes
583things really hard to track and in some cases I am not the best person to
584answer a given question, ask on the list.</p>
585
586<p>To <span style="color: #E50000">be really clear about support</span>:</p>
587<ul>
588  <li>Support or help <span style="color: #E50000">requests MUST be sent to
589    the list or the bug tracker</span> in case of problems, so that the Question
590    and Answers can be shared publicly. Failing to do so carries the implicit
591    message "I want free support but I don't want to share the benefits with
592    others" and is not welcome. I will automatically Carbon-Copy the
593    xml@gnome.org mailing list for any technical reply made about libxml2 or
594    libxslt.</li>
595  <li>There is <span style="color: #E50000">no guarantee of support</span>. If
596    your question remains unanswered after a week, repost it, making sure you
597    gave all the detail needed and the information requested.</li>
598  <li>Failing to provide information as requested or double checking first
599    for prior feedback also carries the implicit message "the time of the
600    library maintainers is less valuable than my time" and might not be
601    welcome.</li>
602</ul>
603
604<p>Of course, bugs reported with a suggested patch for fixing them will
605probably be processed faster than those without.</p>
606
607<p>If you're looking for help, a quick look at <a
608href="http://mail.gnome.org/archives/xml/">the list archive</a> may actually
609provide the answer. I usually send source samples when answering libxml2
610usage questions. The <a
611href="http://xmlsoft.org/html/book1.html">auto-generated documentation</a> is
612not as polished as I would like (i need to learn more about DocBook), but
613it's a good starting point.</p>
614
615<h2><a name="help">How to help</a></h2>
616
617<p>You can help the project in various ways, the best thing to do first is to
618subscribe to the mailing-list as explained before, check the <a
619href="http://mail.gnome.org/archives/xml/">archives </a>and the <a
620href="https://gitlab.gnome.org/GNOME/libxml2/issues">Gnome bug
621database</a>:</p>
622<ol>
623  <li>Provide patches when you find problems.</li>
624  <li>Provide the diffs when you port libxml2 to a new platform. They may not
625    be integrated in all cases but help pinpointing portability problems
626  and</li>
627  <li>Provide documentation fixes (either as patches to the code comments or
628    as HTML diffs).</li>
629  <li>Provide new documentations pieces (translations, examples, etc
630  ...).</li>
631  <li>Check the TODO file and try to close one of the items.</li>
632  <li>Take one of the points raised in the archive or the bug database and
633    provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me
634    </a>before to avoid synchronization problems and check that the suggested
635    fix will fit in nicely :-)</li>
636</ol>
637
638<h2><a name="Downloads">Downloads</a></h2>
639
640<p>The latest versions of libxml2 can be found on the <a
641href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a> server ( <a
642href="ftp://xmlsoft.org/libxml2/">FTP</a> and rsync are available), there are also
643mirrors (<a href="ftp://fr.rpmfind.net/pub/libxml/">France</a> and
644Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
645mirror in Austria</a>). (NOTE that you need both the <a
646href="http://rpmfind.net/linux/RPM/libxml2.html">libxml(2)</a> and <a
647href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml(2)-devel</a>
648packages installed to compile applications using libxml if using RPMs.)</p>
649
650<p>You can find all the history of libxml(2) and libxslt releases in the <a
651href="http://xmlsoft.org/sources/old/">old</a> directory. The precompiled
652Windows binaries made by Igor Zlatovic are available in the <a
653href="http://xmlsoft.org/sources/win32/">win32</a> directory.</p>
654
655<p>Binary ports:</p>
656<ul>
657  <li>RPMs for x86_64 are available directly on <a
658    href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a>, the source RPM will compile on
659    any architecture supported.</li>
660  <li><a href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a> is now the
661    maintainer of the Windows port, <a
662    href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
663    binaries</a>.</li>
664  <li>OpenCSW provides <a
665    href="http://opencsw.org/packages/libxml2">Solaris
666  binaries</a>.</li>
667  <li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a> provides <a
668    href="http://www.explain.com.au/oss/libxml2xslt.html">Mac Os X
669    binaries</a>.</li>
670  <li>The HP-UX porting center provides <a
671    href="http://hpux.connect.org.uk/hppd/hpux/Gnome/">HP-UX binaries</a></li>
672  <li>Bull provides precompiled <a
673    href="http://gnome.bullfreeware.com/new_index.html">RPMs for AIX</a> as
674    patr of their GNOME packages</li>
675</ul>
676
677<p>If you know other supported binary ports, please <a
678href="http://veillard.com/">contact me</a>.</p>
679
680<p><a name="Snapshot">Snapshot:</a></p>
681<ul>
682  <li>Code from the GNOME GIT base libxml2 module, updated hourly <a
683    href="ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz">libxml2-git-snapshot.tar.gz</a>.</li>
684  <li>Docs, content of the web site, the list archive included <a
685    href="ftp://xmlsoft.org/libxml2/libxml-docs.tar.gz">libxml-docs.tar.gz</a>.</li>
686</ul>
687
688<p><a name="Contribs">Contributions:</a></p>
689
690<p>I do accept external contributions, especially if compiling on another
691platform,  get in touch with the list to upload the package, wrappers for
692various languages have been provided, and can be found in the <a
693href="python.html">bindings section</a></p>
694
695<p>Libxml2 is also available from GIT:</p>
696<ul>
697  <li><p>See <a href="https://gitlab.gnome.org/GNOME/libxml2">libxml2 Git web</a>.
698         To checkout a local tree use:</p>
699       <pre>git clone https://gitlab.gnome.org/GNOME/libxml2.git</pre>
700  </li>
701  <li>The <strong>libxslt</strong> module is also present
702      <a href="https://gitlab.gnome.org/GNOME/libxslt">there</a>.</li>
703</ul>
704
705<h2><a name="News">Releases</a></h2>
706
707<p>The <a href="ChangeLog.html">change log</a> describes the recents commits
708to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p>
709
710<p>Here is the list of public releases:</p>
711
712<h3>v2.9.11: May 13 2021</h3>
713<ul>
714  <li>Security:<br/>
715  Patch for security issue CVE-2021-3541 (Daniel Veillard)<br/>
716  </li>
717
718  <li>Documentation:<br/>
719  Clarify xmlNewDocProp documentation (Nick Wellnhofer)<br/>
720  </li>
721
722  <li>Portability:<br/>
723  CMake: Only add postfixes if MSVC (Christopher Degawa),<br/>
724  Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),<br/>
725  Use CMake PROJECT_VERSION (Markus Rickert),<br/>
726  Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),<br/>
727  Add CI for CMake on MSVC (Markus Rickert),<br/>
728  Update minimum required CMake version (Markus Rickert),<br/>
729  Add variables for configured options to CMake config files (Markus Rickert),<br/>
730  Check if variables exist when defining targets (Markus Rickert),<br/>
731  Check if target exists when reading target properties (Markus Rickert),<br/>
732  Add xmlcatalog target and definition to config files (Markus Rickert),<br/>
733  Remove include directories for link-only dependencies (Markus Rickert),<br/>
734  Fix ICU build in CMake (Markus Rickert),<br/>
735  Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),<br/>
736  Update CMake config files (Markus Rickert),<br/>
737  Add xmlcatalog and xmllint to CMake export (Markus Rickert),<br/>
738  Simplify xmlexports.h (Nick Wellnhofer),<br/>
739  Require dependencies based on enabled CMake options (Markus Rickert),<br/>
740  Use NAMELINK_COMPONENT in CMake install (Markus Rickert),<br/>
741  Add CMake files to EXTRA_DIST (Markus Rickert),<br/>
742  Add missing compile definition for static builds to CMake (Markus Rickert),<br/>
743  Add CI for CMake on Linux and MinGW (Markus Rickert),<br/>
744  Fix variable name in win32/configure.js (Nick Wellnhofer),<br/>
745  Fix version parsing in win32/configure.js (Nick Wellnhofer),<br/>
746  Fix autotools warnings (Nick Wellnhofer),<br/>
747  Update config.h.cmake.in (Markus Rickert),<br/>
748  win32: allow passing *FLAGS on command line (Michael Stahl),<br/>
749  Configure file xmlwin32version.h.in on MSVC (Markus Rickert),<br/>
750  List headers individually (Markus Rickert),<br/>
751  Add CMake build files (Markus Rickert),<br/>
752  Parenthesize Py&lt;type&gt;_Check() in ifs (Miro Hrončok),<br/>
753  Minor fixes to configure.js (Nick Wellnhofer)<br/>
754  </li>
755
756  <li>Bug Fixes:<br/>
757  Fix null deref in legacy SAX1 parser (Nick Wellnhofer),<br/>
758  Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),<br/>
759  Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),<br/>
760  Fix htmlTagLookup (Nick Wellnhofer),<br/>
761  Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),<br/>
762  Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),<br/>
763  Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),<br/>
764  Validate UTF8 in xmlEncodeEntities (Joel Hockey),<br/>
765  Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),<br/>
766  Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),<br/>
767  Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),<br/>
768  Fix exponential behavior with recursive entities (Nick Wellnhofer),<br/>
769  Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),<br/>
770  Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),<br/>
771  Fix null deref introduced with previous commit (Nick Wellnhofer),<br/>
772  Check for invalid redeclarations of predefined entities (Nick Wellnhofer),<br/>
773  Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),<br/>
774  parser.c: shrink the input buffer when appropriate (Mike Dalessio),<br/>
775  Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),<br/>
776  Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),<br/>
777  Fix timeout when handling recursive entities (Nick Wellnhofer),<br/>
778  Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),<br/>
779  Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),<br/>
780  use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),<br/>
781  htmlParseComment: treat `--!&gt;` as if it closed the comment (Mike Dalessio),<br/>
782  Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),<br/>
783  encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),<br/>
784  xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet-&gt;val" (Xiaoming Ni),<br/>
785  Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),<br/>
786  Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),<br/>
787  Avoid quadratic checking of identity-constraints (Michael Matz),<br/>
788  Fix building with ICU 68. (Frederik Seiffert),<br/>
789  Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
790  Fix xmlURIEscape memory leaks. (Elliott Hughes),<br/>
791  Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),<br/>
792  Fix caret in regexp character group (Nick Wellnhofer),<br/>
793  parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),<br/>
794  Fix memory leaks in XPointer string-range function (Nick Wellnhofer),<br/>
795  Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),<br/>
796  Fix SEGV in xmlSAXParseFileWithData (yanjinjq),<br/>
797  Fix null deref in XPointer expression error path (Nick Wellnhofer),<br/>
798  Don't call xmlXPathInit directly (Nick Wellnhofer),<br/>
799  Fix cleanup of attributes in XML reader (Nick Wellnhofer),<br/>
800  Fix double free in XML reader with XIncludes (Nick Wellnhofer),<br/>
801  Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),<br/>
802  Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),<br/>
803  Fix error reporting with xi:fallback (Nick Wellnhofer),<br/>
804  Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),<br/>
805  Fix corner case with empty xi:fallback (Nick Wellnhofer),<br/>
806  Fix XInclude regression introduced with recent commit (Nick Wellnhofer),<br/>
807  Fix memory leak in runtest.c (Nick Wellnhofer),<br/>
808  Make "xmllint --push --recovery" work (Nick Wellnhofer),<br/>
809  Revert "Do not URI escape in server side includes" (Nick Wellnhofer),<br/>
810  Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),<br/>
811  Stop counting nbChars in parser context (Nick Wellnhofer),<br/>
812  Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),<br/>
813  Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),<br/>
814  Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),<br/>
815  Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),<br/>
816  Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),<br/>
817  Check for custom free function in global destructor (Nick Wellnhofer),<br/>
818  Fix integer overflow when comparing schema dates (Nick Wellnhofer),<br/>
819  Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),<br/>
820  Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),<br/>
821  Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
822  Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),<br/>
823  Reset XML parser input before reporting errors (David Kilzer),<br/>
824  Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),<br/>
825  Fix HTML push parser lookahead (Nick Wellnhofer),<br/>
826  Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),<br/>
827  Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),<br/>
828  Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),<br/>
829  Reset HTML parser input before reporting error (Nick Wellnhofer),<br/>
830  Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
831  Fix regression introduced with 477c7f6a (Nick Wellnhofer),<br/>
832  Fix quadratic runtime in HTML parser (Nick Wellnhofer),<br/>
833  Reset HTML parser input before reporting encoding error (Nick Wellnhofer),<br/>
834  Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),<br/>
835  Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),<br/>
836  Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),<br/>
837  Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),<br/>
838  Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),<br/>
839  Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br/>
840  Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),<br/>
841  Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),<br/>
842  Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),<br/>
843  Fix return value of xmlCharEncOutput (Nick Wellnhofer),<br/>
844  Never expand parameter entities in text declaration (Nick Wellnhofer),<br/>
845  Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),<br/>
846  Fix use-after-free with validating reader (Nick Wellnhofer),<br/>
847  xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),<br/>
848  Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),<br/>
849  Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),<br/>
850  Make schema validation fail with multiple top-level elements (Nick Wellnhofer),<br/>
851  Call xmlCleanupParser on ELF destruction (Samuel Thibault),<br/>
852  Fix copying of entities in xmlParseReference (Nick Wellnhofer),<br/>
853  Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),<br/>
854  Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),<br/>
855  Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),<br/>
856  Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),<br/>
857  Fix integer overflow in xmlBufferResize (Nick Wellnhofer),<br/>
858  Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),<br/>
859  Remove useless comparisons (Nick Wellnhofer),<br/>
860  Fix overflow check in xmlNodeDump (Nick Wellnhofer),<br/>
861  Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),<br/>
862  Fix freeing of nested documents (Nick Wellnhofer),<br/>
863  Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),<br/>
864  Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),<br/>
865  Fix xml2-config error code (Nick Wellnhofer),<br/>
866  Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),<br/>
867  Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),<br/>
868  Null pointer handling in catalog.c (raniervf),<br/>
869  xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)<br/>
870  </li>
871
872  <li>Improvements:<br/>
873  Store per-element parser state in a struct (Nick Wellnhofer),<br/>
874  update for xsd:language type check (PaulHiggs),<br/>
875  Update INSTALL.libxml2 (Nick Wellnhofer),<br/>
876  Fix include order in c14n.h (Nick Wellnhofer),<br/>
877  Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),<br/>
878  Speed up htmlCheckAutoClose (Nick Wellnhofer),<br/>
879  Speed up htmlTagLookup (Nick Wellnhofer),<br/>
880  Stop checking attributes for UTF-8 validity (Nick Wellnhofer),<br/>
881  Reduce some fuzzer timeouts (Nick Wellnhofer),<br/>
882  Only run a few CI tests unless scheduled (Nick Wellnhofer),<br/>
883  Improve fuzzer stability (Nick Wellnhofer),<br/>
884  Check for feature flags in fuzzer tests (Nick Wellnhofer),<br/>
885  Another attempt at improving fuzzer stability (Nick Wellnhofer),<br/>
886  Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),<br/>
887  Add charset names to fuzzing dictionaries (Nick Wellnhofer),<br/>
888  Improve HTML fuzzer stability (Nick Wellnhofer),<br/>
889  Add CI for MSVC x86 (Markus Rickert),<br/>
890  Add a flag to not output anything when xmllint succeeded (hhb),<br/>
891  Speed up HTML fuzzer (Nick Wellnhofer),<br/>
892  Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),<br/>
893  Handle malloc failures in fuzzing code (Nick Wellnhofer),<br/>
894  add test coverage for incorrectly-closed comments (Mike Dalessio),<br/>
895  Enforce maximum length of fuzz input (Nick Wellnhofer),<br/>
896  Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),<br/>
897  Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
898  Add CI test for Python 3 (Nick Wellnhofer),<br/>
899  Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),<br/>
900  Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),<br/>
901  Allow port numbers up to INT_MAX (Nick Wellnhofer),<br/>
902  Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),<br/>
903  Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),<br/>
904  Hardcode maximum XPath recursion depth (Nick Wellnhofer),<br/>
905  Pass URL of main entity in XML fuzzer (Nick Wellnhofer),<br/>
906  Consolidate seed corpus generation (Nick Wellnhofer),<br/>
907  Test fuzz targets with dummy driver (Nick Wellnhofer),<br/>
908  Fix regression introduced with commit d88df4b (Nick Wellnhofer),<br/>
909  Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),<br/>
910  Add TODO comment in xinclude.c (Nick Wellnhofer),<br/>
911  Stop using maxParserDepth in xpath.c (Nick Wellnhofer),<br/>
912  Remove dead code in xinclude.c (Nick Wellnhofer),<br/>
913  Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),<br/>
914  Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),<br/>
915  Remove unneeded progress checks in HTML parser (Nick Wellnhofer),<br/>
916  Use strcmp when fuzzing (Nick Wellnhofer),<br/>
917  Fix XPath fuzzer (Nick Wellnhofer),<br/>
918  Fuzz XInclude engine (Nick Wellnhofer),<br/>
919  Add XPath and XPointer fuzzer (Nick Wellnhofer),<br/>
920  Update fuzzing code (Nick Wellnhofer),<br/>
921  More *NodeDumpOutput fixes (Nick Wellnhofer),<br/>
922  Fix *NodeDumpOutput functions (Nick Wellnhofer),<br/>
923  Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),<br/>
924  Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),<br/>
925  Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),<br/>
926  Fix .gitattributes (Nick Wellnhofer),<br/>
927  Rework control flow in htmlCurrentChar (Nick Wellnhofer),<br/>
928  Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),<br/>
929  Remove misleading comments in xpath.c (Nick Wellnhofer),<br/>
930  Update to Devhelp index file format version 2 (Andre Klapper),<br/>
931  Set project language to C (Markus Rickert),<br/>
932  Add variable for working directory of XML Conformance Test Suite (Markus Rickert),<br/>
933  Add additional tests and XML Conformance Test Suite (Markus Rickert),<br/>
934  Add command line option for temp directory in runtest (Markus Rickert),<br/>
935  Ensure LF line endings for test files (Markus Rickert),<br/>
936  Enable runtests and testThreads (Markus Rickert),<br/>
937  Limit regexp nesting depth (Nick Wellnhofer),<br/>
938  Fix return values and documentation in encoding.c (Nick Wellnhofer),<br/>
939  Add regexp regression tests (David Kilzer),<br/>
940  Report error for invalid regexp quantifiers (Nick Wellnhofer),<br/>
941  Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),<br/>
942  Copy xs:duration parser from libexslt (Nick Wellnhofer),<br/>
943  Fuzz target for XML Schemas (Nick Wellnhofer),<br/>
944  Move entity recorder to fuzz.c (Nick Wellnhofer),<br/>
945  Fuzz target for HTML parser (Nick Wellnhofer),<br/>
946  Update GitLab CI container (Nick Wellnhofer),<br/>
947  Add options file for xml fuzzer (Nick Wellnhofer),<br/>
948  Add a couple of libFuzzer targets (Nick Wellnhofer),<br/>
949  Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),<br/>
950  Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),<br/>
951  Fix typos (Nick Wellnhofer),<br/>
952  Disable LeakSanitizer (Nick Wellnhofer),<br/>
953  Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),<br/>
954  Add test case for recursive external parsed entities (Nick Wellnhofer),<br/>
955  Enable error tests with entity substitution (Nick Wellnhofer),<br/>
956  Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),<br/>
957  Merge code paths loading external entities (Nick Wellnhofer),<br/>
958  Copy some XMLReader option flags to parser context (Nick Wellnhofer),<br/>
959  Add xmlPopOutputCallbacks (Nick Wellnhofer),<br/>
960  Updated Python test reader2.py (Pieter van Oostrum),<br/>
961  Updated python/tests/tstLastError.py (Pieter van Oostrum),<br/>
962  Use random seed in xmlDictComputeFastKey (Ranier Vilela),<br/>
963  Enable more undefined behavior sanitizers (Nick Wellnhofer)<br/>
964  </li>
965</ul>
966
967<h3>v2.9.10: Oct 30 2019</h3>
968<ul>
969  <li>Documentation:<br/>
970  Fix a few more typos ("fonction") (Nick Wellnhofer),<br/>
971  Large batch of typo fixes (Jared Yanovich),<br/>
972  Fix typos: tree: move{ -&gt; s}, reconcil{i -&gt; }ed, h{o -&gt; e}ld by... (Jan Pokorný),<br/>
973  Fix typo: xpath: simpli{ -&gt; fi}ed (Jan Pokorný),<br/>
974  Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan Pokorný),<br/>
975  Fix comments in test code (zhouzhongyuan),<br/>
976  fix comment in testReader.c (zhouzhongyuan)<br/>
977  </li>
978
979  <li>Portability:<br/>
980  Fix some release issues on Fedora 30 (Daniel Veillard),<br/>
981  Fix exponent digits when running tests under old MSVC (Daniel Richard G),<br/>
982  Work around buggy ceil() function on AIX (Daniel Richard G),<br/>
983  Don't call printf with NULL string in runtest.c (Daniel Richard G),<br/>
984  Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney),<br/>
985  timsort.h: support older GCCs (Jérôme Duval),<br/>
986  Make configure.ac work with older pkg-config (Nick Wellnhofer),<br/>
987  Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer),<br/>
988  Fix nanohttp.c on MinGW (Nick Wellnhofer),<br/>
989  Fix Windows compiler warning in testC14N.c (Nick Wellnhofer),<br/>
990  Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer),<br/>
991  Fix Python bindings under Windows (Nick Wellnhofer)<br/>
992  </li>
993
994  <li>Bug Fixes:<br/>
995  Another fix for conditional sections at end of document (Nick Wellnhofer),<br/>
996  Fix for conditional sections at end of document (Nick Wellnhofer),<br/>
997  Make sure that Python tests exit with error code (Nick Wellnhofer),<br/>
998  Audit memory error handling in xpath.c (Nick Wellnhofer),<br/>
999  Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer),<br/>
1000  Fix integer overflow when counting written bytes (Nick Wellnhofer),<br/>
1001  Fix uninitialized memory access in HTML parser (Nick Wellnhofer),<br/>
1002  Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br/>
1003  Disallow conditional sections in internal subset (Nick Wellnhofer),<br/>
1004  Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer),<br/>
1005  Fix Regextests (Nick Wellnhofer),<br/>
1006  Fix empty branch in regex (Nick Wellnhofer),<br/>
1007  Fix integer overflow in entity recursion check (Nick Wellnhofer),<br/>
1008  Don't read external entities or XIncludes from stdin (Nick Wellnhofer),<br/>
1009  Fix Schema determinism check of ##other namespaces (Nick Wellnhofer),<br/>
1010  Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan),<br/>
1011  Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer),<br/>
1012  Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer),<br/>
1013  Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan),<br/>
1014  14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer),<br/>
1015  Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie),<br/>
1016  Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer),<br/>
1017  Misleading error message with xs:{min|max}Inclusive (bettermanzzy),<br/>
1018  Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin),<br/>
1019  Partial fix for comparison of xs:durations (Nick Wellnhofer),<br/>
1020  Fix null deref in xmlreader buffer (zhouzhongyuan),<br/>
1021  Fix unability to RelaxNG-validate grammar with choice-based name class (Jan Pokorný),<br/>
1022  Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan Pokorný),<br/>
1023  Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan),<br/>
1024  fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan),<br/>
1025  Fix unsigned int overflow (Jens Eggerstedt),<br/>
1026  dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer),<br/>
1027  Fix another code path in xmlParseQName (Nick Wellnhofer),<br/>
1028  Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer),<br/>
1029  Fix build without reader but with pattern (Nick Wellnhofer),<br/>
1030  Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer),<br/>
1031  Fix unsigned integer overflow (Nick Wellnhofer),<br/>
1032  Fix return value of xmlOutputBufferWrite (Nick Wellnhofer),<br/>
1033  Fix parser termination from "Double hyphen within comment" error (David Warring),<br/>
1034  Fix call stack overflow in xmlFreePattern (Nick Wellnhofer),<br/>
1035  Fix null deref in previous commit (Nick Wellnhofer),<br/>
1036  Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer),<br/>
1037  Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer),<br/>
1038  Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer),<br/>
1039  Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer),<br/>
1040  Fix null deref in xmlregexp error path (Nick Wellnhofer),<br/>
1041  Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer),<br/>
1042  Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer),<br/>
1043  Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer),<br/>
1044  Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer),<br/>
1045  Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer),<br/>
1046  Memory leak in xmlFreeTextReader (Nick Wellnhofer),<br/>
1047  Memory leak in xmlFreeID (xmlreader.c) (Nick Wellnhofer)<br/>
1048  </li>
1049
1050  <li>Improvements:<br/>
1051  Run XML conformance tests under CI (Nick Wellnhofer),<br/>
1052  Update GitLab CI config (Nick Wellnhofer),<br/>
1053  Propagate memory errors in valuePush (Nick Wellnhofer),<br/>
1054  Propagate memory errors in xmlXPathCompExprAdd (Nick Wellnhofer),<br/>
1055  Make xmlFreeDocElementContent non-recursive (Nick Wellnhofer),<br/>
1056  Enable continuous integration via GitLab CI (Nick Wellnhofer),<br/>
1057  Avoid ignored attribute warnings under GCC (Nick Wellnhofer),<br/>
1058  Make xmlDumpElementContent non-recursive (Nick Wellnhofer),<br/>
1059  Make apibuild.py ignore ATTRIBUTE_NO_SANITIZE (Nick Wellnhofer),<br/>
1060  Mark xmlExp* symbols as removed (Nick Wellnhofer),<br/>
1061  Make xmlParseConditionalSections non-recursive (Nick Wellnhofer),<br/>
1062  Adjust expected error in Python tests (Nick Wellnhofer),<br/>
1063  Make xmlTextReaderFreeNodeList non-recursive (Nick Wellnhofer),<br/>
1064  Make xmlFreeNodeList non-recursive (Nick Wellnhofer),<br/>
1065  Make xmlParseContent and xmlParseElement non-recursive (Nick Wellnhofer),<br/>
1066  Remove executable bit from non-executable files (Nick Wellnhofer),<br/>
1067  Fix expected output of test/schemas/any4 (Nick Wellnhofer),<br/>
1068  Optimize build instructions in README (zhouzhongyuan),<br/>
1069  xml2-config.in: Output CFLAGS and LIBS on the same line (Hugh McMaster),<br/>
1070  xml2-config: Add a --dynamic switch to print only shared libraries (Hugh McMaster),<br/>
1071  Annotate functions with __attribute__((no_sanitize)) (Nick Wellnhofer),<br/>
1072  Fix warnings when compiling without reader or push parser (Nick Wellnhofer),<br/>
1073  Remove unused member `doc` in xmlSaveCtxt (Nick Wellnhofer),<br/>
1074  Limit recursion depth in xmlXPathCompOpEvalPredicate (Nick Wellnhofer),<br/>
1075  Remove -Wno-array-bounds (Nick Wellnhofer),<br/>
1076  Remove unreachable code in xmlXPathCountFunction (Nick Wellnhofer),<br/>
1077  Improve XPath predicate and filter evaluation (Nick Wellnhofer),<br/>
1078  Limit recursion depth in xmlXPathOptimizeExpression (Nick Wellnhofer),<br/>
1079  Disable hash randomization when fuzzing (Nick Wellnhofer),<br/>
1080  Optional recursion limit when parsing XPath expressions (Nick Wellnhofer),<br/>
1081  Optional recursion limit when evaluating XPath expressions (Nick Wellnhofer),<br/>
1082  Use break statements in xmlXPathCompOpEval (Nick Wellnhofer),<br/>
1083  Optional XPath operation limit (Nick Wellnhofer),<br/>
1084  Fix compilation with --with-minimum (Nick Wellnhofer),<br/>
1085  Check XPath stack after calling functions (Nick Wellnhofer),<br/>
1086  Remove debug printf in xmlreader.c (Nick Wellnhofer),<br/>
1087  Always define LIBXML_THREAD_ENABLED when enabled (Michael Haubenwallner),<br/>
1088  Regenerate NEWS (Nick Wellnhofer),<br/>
1089  Change git repo URL (Nick Wellnhofer),<br/>
1090  Change bug tracker URL (Nick Wellnhofer),<br/>
1091  Remove outdated HTML file (Nick Wellnhofer),<br/>
1092  Fix unused function warning in testapi.c (Nick Wellnhofer),<br/>
1093  Add some generated test files to .gitignore (Nick Wellnhofer),<br/>
1094  Remove unneeded function pointer casts (Nick Wellnhofer),<br/>
1095  Fix -Wcast-function-type warnings (GCC 8) (Nick Wellnhofer),<br/>
1096  Fix -Wformat-truncation warnings (GCC 8) (Nick Wellnhofer)<br/>
1097  </li>
1098
1099  <li>Cleanups:<br/>
1100  Rebuild docs (Nick Wellnhofer),<br/>
1101  Disable xmlExp regex code (Nick Wellnhofer),<br/>
1102  Remove redundant code in xmlRelaxNGValidateState (Nick Wellnhofer),<br/>
1103  Remove redundant code in xmlXPathCompRelationalExpr (Nick Wellnhofer)<br/>
1104  </li>
1105</ul>
1106
1107<h3>v2.9.9: Jan 03 2019</h3>
1108<ul>
1109  <li>Security:<br/>
1110  CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),<br/>
1111  CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),<br/>
1112  </li>
1113
1114  <li>Documentation:<br/>
1115  reader: Fix documentation comment (Mohammed Sadiq)<br/>
1116  </li>
1117
1118  <li>Portability:<br/>
1119  Fix MSVC build with lzma (Nick Wellnhofer),<br/>
1120  Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),<br/>
1121  Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),<br/>
1122  Merge branch 'patch-2' into 'master' (Nick Wellnhofer),<br/>
1123  Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),<br/>
1124  Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),<br/>
1125  NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)<br/>
1126  </li>
1127
1128  <li>Bug Fixes:<br/>
1129  Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),<br/>
1130  Fix building relative URIs (Thomas Holder),<br/>
1131  Problem with data in interleave in RelaxNG validation (Nikolai Weibull),<br/>
1132  Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),<br/>
1133  Set doc on element obtained from freeElems (Nick Wellnhofer),<br/>
1134  Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),<br/>
1135  Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),<br/>
1136  Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),<br/>
1137  Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),<br/>
1138  Free input buffer in xmlHaltParser (Nick Wellnhofer),<br/>
1139  Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),<br/>
1140  Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),<br/>
1141  Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),<br/>
1142  Fix xmlTextReaderNext with preparsed document (Felix Bünemann),<br/>
1143  Remove stray character from comment (Nick Wellnhofer),<br/>
1144  Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),<br/>
1145  HTML noscript should not close p (Daniel Veillard),<br/>
1146  Don't change context node in xmlXPathRoot (Nick Wellnhofer),<br/>
1147  Stop using XPATH_OP_RESET (Nick Wellnhofer),<br/>
1148  Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)<br/>
1149  </li>
1150
1151  <li>Improvements:<br/>
1152  Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),<br/>
1153  cleanup: remove some unreachable code (Thomas Holder),<br/>
1154  add --relative to testURI (Thomas Holder),<br/>
1155  Remove redefined starts and defines inside include elements (Nikolai Weibull),<br/>
1156  Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),<br/>
1157  Look inside divs for starts and defines inside include (Nikolai Weibull),<br/>
1158  Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),<br/>
1159  Stop using doc-&gt;charset outside parser code (Nick Wellnhofer),<br/>
1160  Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),<br/>
1161  Don't include SAX.h from globals.h (Nick Wellnhofer),<br/>
1162  Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),<br/>
1163  Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),<br/>
1164  Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),<br/>
1165  Improve restoring of context size and position (Nick Wellnhofer),<br/>
1166  Simplify and harden nodeset filtering (Nick Wellnhofer),<br/>
1167  Avoid unnecessary backups of the context node (Nick Wellnhofer),<br/>
1168  Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)<br/>
1169  </li>
1170
1171  <li>Cleanups:<br/>
1172  </li>
1173</ul>
1174<h3>v2.9.8: Mar 05 2018</h3>
1175<ul>
1176  <li>Portability:<br/>
1177  python: remove single use of _PyVerify_fd (Patrick Welche),<br/>
1178  Build more test executables on Windows/MSVC (Nick Wellnhofer),<br/>
1179  Stop including ansidecl.h (Nick Wellnhofer),<br/>
1180  Fix libz and liblzma detection (Nick Wellnhofer),<br/>
1181  Revert "Compile testapi with -Wno-unused-function" (Nick Wellnhofer)<br/>
1182  </li>
1183
1184  <li>Bug Fixes:<br/>
1185  Fix xmlParserEntityCheck (Nick Wellnhofer),<br/>
1186  Halt parser in case of encoding error (Nick Wellnhofer),<br/>
1187  Clear entity content in case of errors (Nick Wellnhofer),<br/>
1188  Change calls to xmlCharEncInput to set flush false when not final call. Having flush incorrectly set to true causes errors for ICU. (Joel Hockey),<br/>
1189  Fix buffer over-read in xmlParseNCNameComplex (Nick Wellnhofer),<br/>
1190  Fix ICU library filenames on Windows/MSVC (Nick Wellnhofer),<br/>
1191  Fix xmlXPathIsNaN broken by recent commit (Nick Wellnhofer),<br/>
1192  Fix -Wenum-compare warnings (Nick Wellnhofer),<br/>
1193  Fix callback signature in testapi.c (Nick Wellnhofer),<br/>
1194  Fix unused parameter warning without ICU (Nick Wellnhofer),<br/>
1195  Fix IO callback signatures (Nick Wellnhofer),<br/>
1196  Fix misc callback signatures (Nick Wellnhofer),<br/>
1197  Fix list callback signatures (Nick Wellnhofer),<br/>
1198  Fix hash callback signatures (Nick Wellnhofer),<br/>
1199  Refactor name and type signature for xmlNop (Vlad Tsyrklevich),<br/>
1200  Fixed ICU to set flush correctly and provide pivot buffer. (Joel Hockey),<br/>
1201  Skip EBCDIC tests if EBCDIC isn't supported (Nick Wellnhofer)<br/>
1202  </li>
1203
1204  <li>Improvements:<br/>
1205  Disable pointer-overflow UBSan checks under Travis (Nick Wellnhofer),<br/>
1206  Improve handling of context input_id (Daniel Veillard),<br/>
1207  Add resource file to Windows DLL (ccpaging),<br/>
1208  Run Travis tests with -Werror (Nick Wellnhofer),<br/>
1209  Build with "-Wall -Wextra" (Nick Wellnhofer),<br/>
1210  Fix -Wtautological-pointer-compare warnings (Nick Wellnhofer),<br/>
1211  Remove unused AC_CHECKs (Nick Wellnhofer),<br/>
1212  Update information about contributing (Nick Wellnhofer),<br/>
1213  Fix -Wmisleading-indentation warnings (Nick Wellnhofer),<br/>
1214  Don't touch CFLAGS in configure.ac (Nick Wellnhofer),<br/>
1215  Ignore function pointer cast warnings (Nick Wellnhofer),<br/>
1216  Simplify XPath NaN, inf and -0 handling (Nick Wellnhofer),<br/>
1217  Introduce xmlPosixStrdup and update xmlMemStrdup (Nick Wellnhofer),<br/>
1218  Add test for ICU flush and pivot buffer (Nick Wellnhofer),<br/>
1219  Compile testapi with -Wno-unused-function (Nick Wellnhofer)<br/>
1220  </li>
1221</ul>
1222<h3>2.9.7: Nov 02 2017</h3>
1223<ul>
1224  <li>Documentation:<br/>
1225  xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)<br/>
1226  </li>
1227
1228  <li>Portability:<br/>
1229  Fix deprecated Travis compiler flag (Nick Wellnhofer),<br/>
1230  Add declaration for DllMain (J. Peter Mugaas),<br/>
1231  Fix preprocessor conditional in threads.h (J. Peter Mugaas),<br/>
1232  Fix pointer comparison warnings on 64-bit Windows (J. Peter Mugaas),<br/>
1233  Fix macro redefinition warning (J. Peter Mugaas),<br/>
1234  Default to native threads on MinGW-w64 (Nick Wellnhofer),<br/>
1235  Simplify Windows IO functions (Nick Wellnhofer),<br/>
1236  Fix runtest on Windows (Nick Wellnhofer),<br/>
1237  socklen_t is always int on Windows (Nick Wellnhofer),<br/>
1238  Don't redefine socket error codes on Windows (Nick Wellnhofer),<br/>
1239  Fix pointer/int cast warnings on 64-bit Windows (Nick Wellnhofer),<br/>
1240  Fix Windows compiler warnings in xmlCanonicPath (Nick Wellnhofer)<br/>
1241  </li>
1242
1243  <li>Bug Fixes:<br/>
1244  xmlcatalog: restore ability to query system catalog easily (Jan Pokorný),<br/>
1245  Fix comparison of nodesets to strings (Nick Wellnhofer)<br/>
1246  </li>
1247
1248  <li>Improvements:<br/>
1249  Add Makefile rules to rebuild HTML man pages (Nick Wellnhofer),<br/>
1250  Fix mixed decls and code in timsort.h (Nick Wellnhofer),<br/>
1251  Rework handling of return values in thread tests (Nick Wellnhofer),<br/>
1252  Fix unused variable warnings in testrecurse (Nick Wellnhofer),<br/>
1253  Fix -Wimplicit-fallthrough warnings (J. Peter Mugaas),<br/>
1254  Upgrade timsort.h to latest revision (Nick Wellnhofer),<br/>
1255  Increase warning level to /W3 under MSVC (Nick Wellnhofer),<br/>
1256  Fix a couple of warnings in dict.c and threads.c (Nick Wellnhofer),<br/>
1257  Update .gitignore for Windows (Nick Wellnhofer),<br/>
1258  Fix unused variable warnings in nanohttp.c (Nick Wellnhofer),<br/>
1259  Fix the Windows header mess (Nick Wellnhofer),<br/>
1260  Don't include winsock2.h in xmllint.c (Nick Wellnhofer),<br/>
1261  Remove generated file python/setup.py from version control (Nick Wellnhofer),<br/>
1262  Use __linux__ macro in generated code (Nick Wellnhofer)<br/>
1263  </li>
1264
1265</ul>
1266<h3>v2.9.6: Oct 06 2017</h3>
1267<ul>
1268  <li>Portability:<br/>
1269  Change preprocessor OS tests to __linux__ (Nick Wellnhofer)<br/>
1270  </li>
1271
1272  <li>Bug Fixes:<br/>
1273  Fix XPath stack frame logic (Nick Wellnhofer),<br/>
1274  Report undefined XPath variable error message (Nick Wellnhofer),<br/>
1275  Fix regression with librsvg (Nick Wellnhofer),<br/>
1276  Handle more invalid entity values in recovery mode (Nick Wellnhofer),<br/>
1277  Fix structured validation errors (Nick Wellnhofer),<br/>
1278  Fix memory leak in LZMA decompressor (Nick Wellnhofer),<br/>
1279  Set memory limit for LZMA decompression (Nick Wellnhofer),<br/>
1280  Handle illegal entity values in recovery mode (Nick Wellnhofer),<br/>
1281  Fix debug dump of streaming XPath expressions (Nick Wellnhofer),<br/>
1282  Fix memory leak in nanoftp (Nick Wellnhofer),<br/>
1283  Fix memory leaks in SAX1 parser (Nick Wellnhofer)<br/>
1284  </li>
1285</ul>
1286<h3>v2.9.5: Sep 04 2017</h3>
1287<ul>
1288
1289  <li>Security:<br/>
1290  Detect infinite recursion in parameter entities (Nick Wellnhofer),<br/>
1291  Fix handling of parameter-entity references (Nick Wellnhofer),<br/>
1292  Disallow namespace nodes in XPointer ranges (Nick Wellnhofer),<br/>
1293  Fix XPointer paths beginning with range-to (Nick Wellnhofer)<br/>
1294  </li>
1295
1296  <li>Documentation:<br/>
1297  Documentation fixes (Nick Wellnhofer),<br/>
1298  Spelling and grammar fixes (Nick Wellnhofer)<br/>
1299  </li>
1300
1301  <li>Portability:<br/>
1302  Adding README.zOS to list of extra files for the release (Daniel Veillard),<br/>
1303  Description of work needed to compile on zOS (Stéphane Michaut),<br/>
1304  Porting libxml2 on zOS encoding of code (Stéphane Michaut),<br/>
1305  small changes for OS/400 (Patrick Monnerat),<br/>
1306  relaxng.c, xmlschemas.c: Fix build on pre-C99 compilers (Chun-wei Fan)<br/>
1307  </li>
1308
1309  <li>Bug Fixes:<br/>
1310  Problem resolving relative URIs (Daniel Veillard),<br/>
1311  Fix unwanted warnings when switching encodings (Nick Wellnhofer),<br/>
1312  Fix signature of xmlSchemaAugmentImportedIDC (Daniel Veillard),<br/>
1313  Heap-buffer-overflow read of size 1 in xmlFAParsePosCharGroup (David Kilzer),<br/>
1314  Fix NULL pointer deref in xmlFAParseCharClassEsc (Nick Wellnhofer),<br/>
1315  Fix infinite loops with push parser in recovery mode (Nick Wellnhofer),<br/>
1316  Send xmllint usage error to stderr (Nick Wellnhofer),<br/>
1317  Fix NULL deref in xmlParseExternalEntityPrivate (Nick Wellnhofer),<br/>
1318  Make sure not to call IS_BLANK_CH when parsing the DTD (Nick Wellnhofer),<br/>
1319  Fix xmlHaltParser (Nick Wellnhofer),<br/>
1320  Fix pathological performance when outputting charrefs (Nick Wellnhofer),<br/>
1321  Fix invalid-source-encoding warnings in testWriter.c (Nick Wellnhofer),<br/>
1322  Fix duplicate SAX callbacks for entity content (David Kilzer),<br/>
1323  Treat URIs with scheme as absolute in C14N (Nick Wellnhofer),<br/>
1324  Fix copy-paste errors in error messages (Nick Wellnhofer),<br/>
1325  Fix sanity check in htmlParseNameComplex (Nick Wellnhofer),<br/>
1326  Fix potential infinite loop in xmlStringLenDecodeEntities (Nick Wellnhofer),<br/>
1327  Reset parser input pointers on encoding failure (Nick Wellnhofer),<br/>
1328  Fix memory leak in xmlParseEntityDecl error path (Nick Wellnhofer),<br/>
1329  Fix xmlBuildRelativeURI for URIs starting with './' (Nick Wellnhofer),<br/>
1330  Fix type confusion in xmlValidateOneNamespace (Nick Wellnhofer),<br/>
1331  Fix memory leak in xmlStringLenGetNodeList (Nick Wellnhofer),<br/>
1332  Fix NULL pointer deref in xmlDumpElementContent (Daniel Veillard),<br/>
1333  Fix memory leak in xmlBufAttrSerializeTxtContent (Nick Wellnhofer),<br/>
1334  Stop parser on unsupported encodings (Nick Wellnhofer),<br/>
1335  Check for integer overflow in memory debug code (Nick Wellnhofer),<br/>
1336  Fix buffer size checks in xmlSnprintfElementContent (Nick Wellnhofer),<br/>
1337  Avoid reparsing in xmlParseStartTag2 (Nick Wellnhofer),<br/>
1338  Fix undefined behavior in xmlRegExecPushStringInternal (Nick Wellnhofer),<br/>
1339  Check XPath exponents for overflow (Nick Wellnhofer),<br/>
1340  Check for overflow in xmlXPathIsPositionalPredicate (Nick Wellnhofer),<br/>
1341  Fix spurious error message (Nick Wellnhofer),<br/>
1342  Fix memory leak in xmlCanonicPath (Nick Wellnhofer),<br/>
1343  Fix memory leak in xmlXPathCompareNodeSetValue (Nick Wellnhofer),<br/>
1344  Fix memory leak in pattern error path (Nick Wellnhofer),<br/>
1345  Fix memory leak in parser error path (Nick Wellnhofer),<br/>
1346  Fix memory leaks in XPointer error paths (Nick Wellnhofer),<br/>
1347  Fix memory leak in xmlXPathNodeSetMergeAndClear (Nick Wellnhofer),<br/>
1348  Fix memory leak in XPath filter optimizations (Nick Wellnhofer),<br/>
1349  Fix memory leaks in XPath error paths (Nick Wellnhofer),<br/>
1350  Do not leak the new CData node if adding fails (David Tardon),<br/>
1351  Prevent unwanted external entity reference (Neel Mehta),<br/>
1352  Increase buffer space for port in HTTP redirect support (Daniel Veillard),<br/>
1353  Fix more NULL pointer derefs in xpointer.c (Nick Wellnhofer),<br/>
1354  Avoid function/data pointer conversion in xpath.c (Nick Wellnhofer),<br/>
1355  Fix format string warnings (Nick Wellnhofer),<br/>
1356  Disallow namespace nodes in XPointer points (Nick Wellnhofer),<br/>
1357  Fix comparison with root node in xmlXPathCmpNodes (Nick Wellnhofer),<br/>
1358  Fix attribute decoding during XML schema validation (Alex Henrie),<br/>
1359  Fix NULL pointer deref in XPointer range-to (Nick Wellnhofer)<br/>
1360  </li>
1361
1362  <li>Improvements:<br/>
1363  Updating the spec file to reflect Fedora 24 (Daniel Veillard),<br/>
1364  Add const in five places to move 1 KiB to .rdata (Bruce Dawson),<br/>
1365  Fix missing part of comment for function xmlXPathEvalExpression() (Daniel Veillard),<br/>
1366  Get rid of "blanks wrapper" for parameter entities (Nick Wellnhofer),<br/>
1367  Simplify handling of parameter entity references (Nick Wellnhofer),<br/>
1368  Deduplicate code in encoding.c (Nick Wellnhofer),<br/>
1369  Make HTML parser functions take const pointers (Nick Wellnhofer),<br/>
1370  Build test programs only when needed (Nick Wellnhofer),<br/>
1371  Fix doc/examples/index.py (Nick Wellnhofer),<br/>
1372  Fix compiler warnings in threads.c (Nick Wellnhofer),<br/>
1373  Fix empty-body warning in nanohttp.c (Nick Wellnhofer),<br/>
1374  Fix cast-align warnings (Nick Wellnhofer),<br/>
1375  Fix unused-parameter warnings (Nick Wellnhofer),<br/>
1376  Rework entity boundary checks (Nick Wellnhofer),<br/>
1377  Don't switch encoding for internal parameter entities (Nick Wellnhofer),<br/>
1378  Merge duplicate code paths handling PE references (Nick Wellnhofer),<br/>
1379  Test SAX2 callbacks with entity substitution (Nick Wellnhofer),<br/>
1380  Support catalog and threads tests under --without-sax1 (Nick Wellnhofer),<br/>
1381  Misc fixes for 'make tests' (Nick Wellnhofer),<br/>
1382  Initialize keepBlanks in HTML parser (Nick Wellnhofer),<br/>
1383  Add test cases for bug 758518 (David Kilzer),<br/>
1384  Fix compiler warning in htmlParseElementInternal (Nick Wellnhofer),<br/>
1385  Remove useless check in xmlParseAttributeListDecl (Nick Wellnhofer),<br/>
1386  Allow zero sized memory input buffers (Nick Wellnhofer),<br/>
1387  Add TODO comment in xmlSwitchEncoding (Nick Wellnhofer),<br/>
1388  Check for integer overflow in xmlXPathFormatNumber (Nick Wellnhofer),<br/>
1389  Make Travis print UBSan stacktraces (Nick Wellnhofer),<br/>
1390  Add .travis.yml (Nick Wellnhofer),<br/>
1391  Fix expected error output in Python tests (Nick Wellnhofer),<br/>
1392  Simplify control flow in xmlParseStartTag2 (Nick Wellnhofer),<br/>
1393  Disable LeakSanitizer when running API tests (Nick Wellnhofer),<br/>
1394  Avoid out-of-bound array access in API tests (Nick Wellnhofer),<br/>
1395  Avoid spurious UBSan errors in parser.c (Nick Wellnhofer),<br/>
1396  Parse small XPath numbers more accurately (Nick Wellnhofer),<br/>
1397  Rework XPath rounding functions (Nick Wellnhofer),<br/>
1398  Fix white space in test output (Nick Wellnhofer),<br/>
1399  Fix axis traversal from attribute and namespace nodes (Nick Wellnhofer),<br/>
1400  Check for trailing characters in XPath expressions earlier (Nick Wellnhofer),<br/>
1401  Rework final handling of XPath results (Nick Wellnhofer),<br/>
1402  Make xmlXPathEvalExpression call xmlXPathEval (Nick Wellnhofer),<br/>
1403  Remove unused variables (Nick Wellnhofer),<br/>
1404  Don't print generic error messages in XPath tests (Nick Wellnhofer)<br/>
1405  </li>
1406
1407  <li>Cleanups:<br/>
1408  Fix a couple of misleading indentation errors (Daniel Veillard),<br/>
1409  Remove unnecessary calls to xmlPopInput (Nick Wellnhofer)<br/>
1410  </li>
1411</ul>
1412<h3>2.9.4: May 23 2016</h3>
1413<ul>
1414  <li>Security:<br/>
1415  More format string warnings with possible format string vulnerability (David Kilzer),<br/>
1416  Avoid building recursive entities (Daniel Veillard),<br/>
1417  Heap-based buffer overread in htmlCurrentChar (Pranjal Jumde),<br/>
1418  Heap-based buffer-underreads due to xmlParseName (David Kilzer),<br/>
1419  Heap use-after-free in xmlSAX2AttributeNs (Pranjal Jumde),<br/>
1420  Heap use-after-free in htmlParsePubidLiteral and htmlParseSystemiteral (Pranjal Jumde),<br/>
1421  Fix some format string warnings with possible format string vulnerability (David Kilzer),<br/>
1422  Detect change of encoding when parsing HTML names (Hugh Davenport),<br/>
1423  Fix inappropriate fetch of entities content (Daniel Veillard),<br/>
1424  Bug 759398: Heap use-after-free in xmlDictComputeFastKey &lt;https://bugzilla.gnome.org/show_bug.cgi?id=759398&gt; (Pranjal Jumde),<br/>
1425  Bug 758605: Heap-based buffer overread in xmlDictAddString &lt;https://bugzilla.gnome.org/show_bug.cgi?id=758605&gt; (Pranjal Jumde),<br/>
1426  Bug 758588: Heap-based buffer overread in xmlParserPrintFileContextInternal &lt;https://bugzilla.gnome.org/show_bug.cgi?id=758588&gt; (David Kilzer),<br/>
1427  Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup &lt;https://bugzilla.gnome.org/show_bug.cgi?id=757711&gt; (Pranjal Jumde),<br/>
1428  Add missing increments of recursion depth counter to XML parser. (Peter Simons)<br/>
1429  </li>
1430
1431  <li>Documentation:<br/>
1432  Fix typo: s{ ec -&gt; cr }cipt (Jan Pokorný),<br/>
1433  Fix typos: dictio{ nn -&gt; n }ar{y,ies} (Jan Pokorný),<br/>
1434  Fix typos: PATH_{ SEAPARATOR -&gt; SEPARATOR } (Jan Pokorný),<br/>
1435  Correct a typo. (Shlomi Fish)<br/>
1436  </li>
1437
1438  <li>Portability:<br/>
1439  Correct the usage of LDFLAGS (Mattias Hansson),<br/>
1440  Revert the use of SAVE_LDFLAGS in configure.ac (Mattias Hansson),<br/>
1441  libxml2 hardcodes -L/lib in zlib/lzma tests which breaks cross-compiles (Mike Frysinger),<br/>
1442  Fix apibuild for a recently added construct (Daniel Veillard),<br/>
1443  Use pkg-config to locate zlib when possible (Stewart Brodie),<br/>
1444  Use pkg-config to locate ICU when possible (Stewart Brodie),<br/>
1445  Portability to non C99 compliant compilers (Patrick Monnerat),<br/>
1446  dict.h: Move xmlDictPtr definition before includes to allow direct inclusion. (Patrick Monnerat),<br/>
1447  os400: tell about xmllint and xmlcatalog in README400. (Patrick Monnerat),<br/>
1448  os400: properly process SGML add in XMLCATALOG command. (Patrick Monnerat),<br/>
1449  os400: implement CL command XMLCATALOG. (Patrick Monnerat),<br/>
1450  os400: compile and install program xmlcatalog (qshell-only). (Patrick Monnerat),<br/>
1451  os400: expand tabs in sources, strip trailing blanks. (Patrick Monnerat),<br/>
1452  os400: implement CL command XMLLINT. (Patrick Monnerat),<br/>
1453  os400: compile and install program xmllint (qshell-only). (Patrick Monnerat),<br/>
1454  os400: initscript make_module(): Use options instead of positional parameters. (Patrick Monnerat),<br/>
1455  os400: c14n.rpgle: allow *omit for nullable reference parameters. (Patrick Monnerat),<br/>
1456  os400: use like() for double type. (Patrick Monnerat),<br/>
1457  os400: use like() for int type. (Patrick Monnerat),<br/>
1458  os400: use like() for unsigned int type. (Patrick Monnerat),<br/>
1459  os400: use like() for enum types. (Patrick Monnerat),<br/>
1460  Add xz to xml2-config --libs output (Baruch Siach),<br/>
1461  Bug 760190: configure.ac should be able to build --with-icu without icu-config tool &lt;https://bugzilla.gnome.org/show_bug.cgi?id=760190&gt; (David Kilzer),<br/>
1462  win32\VC10\config.h and VS 2015 (Bruce Dawson),<br/>
1463  Add configure maintainer mode (orzen)<br/>
1464  </li>
1465
1466  <li>Bug Fixes:<br/>
1467  Avoid an out of bound access when serializing malformed strings (Daniel Veillard),<br/>
1468  Unsigned addition may overflow in xmlMallocAtomicLoc() (David Kilzer),<br/>
1469  Integer signed/unsigned type mismatch in xmlParserInputGrow() (David Kilzer),<br/>
1470  Bug 763071: heap-buffer-overflow in xmlStrncat &lt;https://bugzilla.gnome.org/show_bug.cgi?id=763071&gt; (Pranjal Jumde),<br/>
1471  Integer overflow parsing port number in URI (Michael Paddon),<br/>
1472  Fix an error with regexp on nullable counted char transition (Daniel Veillard),<br/>
1473  Fix memory leak with XPath namespace nodes (Nick Wellnhofer),<br/>
1474  Fix namespace axis traversal (Nick Wellnhofer),<br/>
1475      Fix null pointer deref in docs with no root element (Hugh Davenport),<br/>
1476  Fix XSD validation of URIs with ampersands (Alex Henrie),<br/>
1477  xmlschemastypes.c: accept endOfDayFrag Times set to "24:00:00" mean "end of day" and should not cause an error. (Patrick Monnerat),<br/>
1478  xmlcatalog: flush stdout before interactive shell input. (Patrick Monnerat),<br/>
1479  xmllint: flush stdout before interactive shell input. (Patrick Monnerat),<br/>
1480  Don't recurse into OP_VALUEs in xmlXPathOptimizeExpression (Nick Wellnhofer),<br/>
1481  Fix namespace::node() XPath expression (Nick Wellnhofer),<br/>
1482  Fix OOB write in xmlXPathEmptyNodeSet (Nick Wellnhofer),<br/>
1483  Fix parsing of NCNames in XPath (Nick Wellnhofer),<br/>
1484  Fix OOB read with invalid UTF-8 in xmlUTF8Strsize (Nick Wellnhofer),<br/>
1485  Do normalize string-based datatype value in RelaxNG facet checking (Audric Schiltknecht),<br/>
1486  Bug 760921: REGRESSION (8eb55d78): doc/examples/io1 test fails after fix for "xmlSaveUri() incorrectly recomposes URIs with rootless paths" &lt;https://bugzilla.gnome.org/show_bug.cgi?id=760921&gt; (David Kilzer),<br/>
1487  Bug 760861: REGRESSION (bf9c1dad): Missing results for test/schemas/regexp-char-ref_[01].xsd &lt;https://bugzilla.gnome.org/show_bug.cgi?id=760861&gt; (David Kilzer),<br/>
1488  error.c: *input-&gt;cur == 0 does not mean no error (Pavel Raiskup),<br/>
1489  Add missing RNG test files (David Kilzer),<br/>
1490  Bug 760183: REGRESSION (v2.9.3): XML push parser fails with bogus UTF-8 encoding error when multi-byte character in large CDATA section is split across buffer &lt;https://bugzilla.gnome.org/show_bug.cgi?id=760183&gt; (David Kilzer),<br/>
1491  Bug 758572: ASAN crash in make check &lt;https://bugzilla.gnome.org/show_bug.cgi?id=758572&gt; (David Kilzer),<br/>
1492  Bug 721158: Missing ICU string when doing --version on xmllint &lt;https://bugzilla.gnome.org/show_bug.cgi?id=721158&gt; (David Kilzer),<br/>
1493  python 3: libxml2.c wrappers create Unicode str already (Michael Stahl),<br/>
1494  Add autogen.sh to distrib (orzen),<br/>
1495  Heap-based buffer overread in xmlNextChar (Daniel Veillard)<br/>
1496  </li>
1497
1498  <li>Improvements:<br/>
1499  Add more debugging info to runtest (Daniel Veillard),<br/>
1500  Implement "runtest -u" mode (David Kilzer),<br/>
1501  Add a make rule to rebuild for ASAN (Daniel Veillard)<br/>
1502  </li>
1503</ul>
1504<h3>v2.9.3: Nov 20 2015</h3>
1505<ul>
1506  <li>Security:<br/>
1507  CVE-2015-8242 Buffer overead with HTML parser in push mode (Hugh Davenport),<br/>
1508  CVE-2015-7500 Fix memory access error due to incorrect entities boundaries (Daniel Veillard),<br/>
1509  CVE-2015-7499-2 Detect incoherency on GROW (Daniel Veillard),<br/>
1510  CVE-2015-7499-1 Add xmlHaltParser() to stop the parser (Daniel Veillard),<br/>
1511  CVE-2015-5312 Another entity expansion issue (David Drysdale),<br/>
1512  CVE-2015-7497 Avoid an heap buffer overflow in xmlDictComputeFastQKey (David Drysdale),<br/>
1513  CVE-2015-7498 Avoid processing entities after encoding conversion failures (Daniel Veillard),<br/>
1514  CVE-2015-8035 Fix XZ compression support loop (Daniel Veillard),<br/>
1515  CVE-2015-7942-2 Fix an error in previous Conditional section patch (Daniel Veillard),<br/>
1516  CVE-2015-7942 Another variation of overflow in Conditional sections (Daniel Veillard),<br/>
1517  CVE-2015-1819 Enforce the reader to run in constant memory (Daniel Veillard)<br/>
1518  CVE-2015-7941_2 Cleanup conditional section error handling (Daniel Veillard),<br/>
1519  CVE-2015-7941_1 Stop parsing on entities boundaries errors (Daniel Veillard),<br/>
1520  </li>
1521
1522  <li>Documentation:<br/>
1523  Correct spelling of "calling" (Alex Henrie),<br/>
1524  Fix a small error in xmllint --format description (Fabien Degomme),<br/>
1525  Avoid XSS on the search of xmlsoft.org (Daniel Veillard)<br/>
1526  </li>
1527
1528  <li>Portability:<br/>
1529  threads: use forward declarations only for glibc (Michael Heimpold),<br/>
1530  Update Win32 configure.js to search for configure.ac (Daniel Veillard)<br/>
1531  </li>
1532
1533  <li>Bug Fixes:<br/>
1534  Bug on creating new stream from entity (Daniel Veillard),<br/>
1535  Fix some loop issues embedding NEXT (Daniel Veillard),<br/>
1536  Do not print error context when there is none (Daniel Veillard),<br/>
1537  Avoid extra processing of MarkupDecl when EOF (Hugh Davenport),<br/>
1538  Fix parsing short unclosed comment uninitialized access (Daniel Veillard),<br/>
1539  Add missing Null check in xmlParseExternalEntityPrivate (Gaurav Gupta),<br/>
1540  Fix a bug in CData error handling in the push parser (Daniel Veillard),<br/>
1541  Fix a bug on name parsing at the end of current input buffer (Daniel Veillard),<br/>
1542  Fix the spurious ID already defined error (Daniel Veillard),<br/>
1543  Fix previous change to node sort order (Nick Wellnhofer),<br/>
1544  Fix a self assignment issue raised by clang (Scott Graham),<br/>
1545  Fail parsing early on if encoding conversion failed (Daniel Veillard),<br/>
1546  Do not process encoding values if the declaration if broken (Daniel Veillard),<br/>
1547  Silence clang's -Wunknown-attribute (Michael Catanzaro),<br/>
1548  xmlMemUsed is not thread-safe (Martin von Gagern),<br/>
1549  Fix support for except in nameclasses (Daniel Veillard),<br/>
1550  Fix order of root nodes (Nick Wellnhofer),<br/>
1551  Allow attributes on descendant-or-self axis (Nick Wellnhofer),<br/>
1552  Fix the fix to Windows locking (Steve Nairn),<br/>
1553  Fix timsort invariant loop re: Envisage article (Christopher Swenson),<br/>
1554  Don't add IDs in xmlSetTreeDoc (Nick Wellnhofer),<br/>
1555  Account for ID attributes in xmlSetTreeDoc (Nick Wellnhofer),<br/>
1556  Remove various unused value assignments (Philip Withnall),<br/>
1557  Fix missing entities after CVE-2014-3660 fix (Daniel Veillard),<br/>
1558  Revert "Missing initialization for the catalog module" (Daniel Veillard)<br/>
1559  </li>
1560
1561  <li>Improvements:<br/>
1562  Reuse xmlHaltParser() where it makes sense (Daniel Veillard),<br/>
1563  xmlStopParser reset errNo (Daniel Veillard),<br/>
1564  Re-enable xz support by default (Daniel Veillard),<br/>
1565  Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),<br/>
1566  Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),<br/>
1567  Regression test for bug #695699 (Nick Wellnhofer),<br/>
1568  Add a couple of XPath tests (Nick Wellnhofer),<br/>
1569  Add Python 3 rpm subpackage (Tomas Radej),<br/>
1570  libxml2-config.cmake.in: update include directories (Samuel Martin),<br/>
1571  Adding example from bugs 738805 to regression tests (Daniel Veillard)<br/>
1572  </li>
1573
1574  <li>Cleanups:<br/>
1575  </li>
1576</ul>
1577<h3>2.9.2: Oct 16 2014</h3>
1578<ul>
1579  <li>Security:<br/>
1580  Fix for CVE-2014-3660 billion laugh variant (Daniel Veillard),<br/>
1581  CVE-2014-0191 Do not fetch external parameter entities (Daniel Veillard)<br/>
1582  </li>
1583
1584  <li>Bug Fixes:<br/>
1585  fix memory leak xml header encoding field with XML_PARSE_IGNORE_ENC (Bart De Schuymer),<br/>
1586  xmlmemory: handle realloc properly (Yegor Yefremov),<br/>
1587  Python generator bug raised by the const change (Daniel Veillard),<br/>
1588  Windows Critical sections not released correctly (Daniel Veillard),<br/>
1589  Parser error on repeated recursive entity expansion containing &amp;lt; (Daniel Veillard),<br/>
1590  xpointer : fixing Null Pointers (Gaurav Gupta),<br/>
1591  Remove Unnecessary Null check in xpointer.c (Gaurav Gupta),<br/>
1592  parser bug on misformed namespace attributes (Dennis Filder),<br/>
1593  Pointer dereferenced before null check (Daniel Veillard),<br/>
1594  Leak of struct addrinfo in xmlNanoFTPConnect() (Gaurav Gupta),<br/>
1595  Possible overflow in HTMLParser.c (Daniel Veillard),<br/>
1596  python/tests/sync.py assumes Python dictionaries are ordered (John Beck),<br/>
1597  Fix Enum check and missing break (Gaurav Gupta),<br/>
1598  xmlIO: Handle error returns from dup() (Philip Withnall),<br/>
1599  Fix a problem properly saving URIs (Daniel Veillard),<br/>
1600  wrong error column in structured error when parsing attribute values (Juergen Keil),<br/>
1601  wrong error column in structured error when skipping whitespace in xml decl (Juergen Keil),<br/>
1602  no error column in structured error handler for xml schema validation errors (Juergen Keil),<br/>
1603  Couple of Missing Null checks (Gaurav Gupta),<br/>
1604  Add couple of missing Null checks (Daniel Veillard),<br/>
1605  xmlschemastypes: Fix potential array overflow (Philip Withnall),<br/>
1606  runtest: Fix a memory leak on parse failure (Philip Withnall),<br/>
1607  xmlIO: Fix an FD leak on gzdopen() failure (Philip Withnall),<br/>
1608  xmlcatalog: Fix a memory leak on quit (Philip Withnall),<br/>
1609  HTMLparser: Correctly initialise a stack allocated structure (Philip Withnall),<br/>
1610  Check for tmon in _xmlSchemaDateAdd() is incorrect (David Kilzer),<br/>
1611  Avoid Possible Null Pointer in trio.c (Gaurav Gupta),<br/>
1612  Fix processing in SAX2 in case of an allocation failure (Daniel Veillard),<br/>
1613  XML Shell command "cd" does not handle "/" at end of path (Daniel Veillard),<br/>
1614  Fix various Missing Null checks (Gaurav Gupta),<br/>
1615  Fix a potential NULL dereference (Daniel Veillard),<br/>
1616  Add a couple of misisng check in xmlRelaxNGCleanupTree (Gaurav Gupta),<br/>
1617  Add a missing argument check (Gaurav Gupta),<br/>
1618  Adding a check in case of allocation error (Gaurav Gupta),<br/>
1619  xmlSaveUri() incorrectly recomposes URIs with rootless paths (Dennis Filder),<br/>
1620  Adding some missing NULL checks (Gaurav),<br/>
1621  Fixes for xmlInitParserCtxt (Daniel Veillard),<br/>
1622  Fix regressions introduced by CVE-2014-0191 patch (Daniel Veillard),<br/>
1623  erroneously ignores a validation error if no error callback set (Daniel Veillard),<br/>
1624  xmllint was not parsing the --c14n11 flag (Sérgio Batista),<br/>
1625  Avoid Possible null pointer dereference in memory debug mode (Gaurav),<br/>
1626  Avoid Double Null Check (Gaurav),<br/>
1627  Restore context size and position after XPATH_OP_ARG (Nick Wellnhofer),<br/>
1628  Fix xmlParseInNodeContext() if node is not element (Daniel Veillard),<br/>
1629  Avoid a possible NULL pointer dereference (Gaurav),<br/>
1630  Fix xmlTextWriterWriteElement when a null content is given (Daniel Veillard),<br/>
1631  Fix an typo 'onrest' in htmlScriptAttributes (Daniel Veillard),<br/>
1632  fixing a ptotential uninitialized access (Daniel Veillard),<br/>
1633  Fix an fd leak in an error case (Daniel Veillard),<br/>
1634  Missing initialization for the catalog module (Daniel Veillard),<br/>
1635  Handling of XPath function arguments in error case (Nick Wellnhofer),<br/>
1636  Fix a couple of missing NULL checks (Gaurav),<br/>
1637  Avoid a possibility of dangling encoding handler (Gaurav),<br/>
1638  Fix HTML push parser to accept HTML_PARSE_NODEFDTD (Arnold Hendriks),<br/>
1639  Fix a bug loading some compressed files (Mike Alexander),<br/>
1640  Fix XPath node comparison bug (Gaurav),<br/>
1641  Type mismatch in xmlschemas.c (Gaurav),<br/>
1642  Type mismatch in xmlschemastypes.c (Gaurav),<br/>
1643  Avoid a deadcode in catalog.c (Daniel Veillard),<br/>
1644  run close socket on Solaris, same as we do on other platforms (Denis Pauk),<br/>
1645  Fix pointer dereferenced before null check (Gaurav),<br/>
1646  Fix a potential NULL dereference in tree code (Daniel Veillard),<br/>
1647  Fix potential NULL pointer dereferences in regexp code (Gaurav),<br/>
1648  xmllint --pretty crashed without following numeric argument (Tim Galeckas),<br/>
1649  Fix XPath expressions of the form '@ns:*' (Nick Wellnhofer),<br/>
1650  Fix XPath '//' optimization with predicates (Nick Wellnhofer),<br/>
1651  Clear up a potential NULL dereference (Daniel Veillard),<br/>
1652  Fix a possible NULL dereference (Gaurav),<br/>
1653  Avoid crash if allocation fails (Daniel Veillard),<br/>
1654  Remove occasional leading space in XPath number formatting (Daniel Veillard),<br/>
1655  Fix handling of mmap errors (Daniel Veillard),<br/>
1656  Catch malloc error and exit accordingly (Daniel Veillard),<br/>
1657  missing else in xlink.c (Ami Fischman),<br/>
1658  Fix a parsing bug on non-ascii element and CR/LF usage (Daniel Veillard),<br/>
1659  Fix a regression in xmlGetDocCompressMode() (Daniel Veillard),<br/>
1660  properly quote the namespace uris written out during c14n (Aleksey Sanin),<br/>
1661  Remove premature XInclude check on URI being relative (Alexey Neyman),<br/>
1662  Fix missing break on last() function for attributes (dcb),<br/>
1663  Do not URI escape in server side includes (Romain Bondue),<br/>
1664  Fix an error in xmlCleanupParser (Alexander Pastukhov)<br/>
1665  </li>
1666
1667  <li>Documentation:<br/>
1668  typo in error messages "colon are forbidden from..." (Daniel Veillard),<br/>
1669  Fix a link to James SAX documentation old page (Daniel Veillard),<br/>
1670  Fix typos in relaxng.c (Jan Pokorný),<br/>
1671  Fix a doc typo (Daniel Veillard),<br/>
1672  Fix typos in {tree,xpath}.c (errror) (Jan Pokorný),<br/>
1673  Add limitations about encoding conversion (Daniel Veillard),<br/>
1674  Fix typos in xmlschemas{,types}.c (Jan Pokorný),<br/>
1675  Fix incorrect spelling entites-&gt;entities (Jan Pokorný),<br/>
1676  Forgot to document 2.9.1 release, regenerate docs (Daniel Veillard)<br/>
1677  </li>
1678
1679  <li>Portability:<br/>
1680  AC_CONFIG_FILES and executable bit (Roumen Petrov),<br/>
1681  remove HAVE_CONFIG_H dependency in testlimits.c (Roumen Petrov),<br/>
1682  fix some tabs mixing incompatible with python3 (Roumen Petrov),<br/>
1683  Visual Studio 14 CTP defines snprintf() (Francis Dupont),<br/>
1684  OS400: do not try to copy unexisting doc files (Patrick Monnerat),<br/>
1685  OS400: use either configure.ac or configure.in. (Patrick Monnerat),<br/>
1686  os400: make-src.sh: create physical file with target CCSID (Patrick Monnerat),<br/>
1687  OS400: Add some more C macros equivalent procedures. (Patrick Monnerat),<br/>
1688  OS400: use C macros to implement equivalent RPG support procedures. (Patrick Monnerat),<br/>
1689  OS400: implement XPath macros as procedures for ILE/RPG support. (Patrick Monnerat),<br/>
1690  OS400: include in distribution tarball. (Patrick Monnerat),<br/>
1691  OS400: Add README: compilation directives and OS/400 specific stuff. (Patrick Monnerat),<br/>
1692  OS400: Add compilation scripts. (Patrick Monnerat),<br/>
1693  OS400: ILE RPG language header files. (Patrick Monnerat),<br/>
1694  OS400: implement some macros as functions for ILE/RPG language support (that as no macros). (Patrick Monnerat),<br/>
1695  OS400: UTF8&lt;--&gt;EBCDIC wrappers for system and external library calls (Patrick Monnerat),<br/>
1696  OS400: Easy character transcoding support (Patrick Monnerat),<br/>
1697  OS400: iconv functions compatibility wrappers and table builder. (Patrick Monnerat),<br/>
1698  OS400: create architecture directory. Implement dlfcn emulation. (Patrick Monnerat),<br/>
1699  Fix building when configuring without xpath and xptr (Daniel Veillard),<br/>
1700  configure: Add --with-python-install-dir (Jonas Eriksson),<br/>
1701  Fix compilation with minimum and xinclude. (Nicolas Le Cam),<br/>
1702  Compile out use of xmlValidateNCName() when not available. (Nicolas Le Cam),<br/>
1703  Fix compilation with minimum and schematron. (Nicolas Le Cam),<br/>
1704  Legacy needs xmlSAX2StartElement() and xmlSAX2EndElement(). (Nicolas Le Cam),<br/>
1705  Don't use xmlValidateName() when not available. (Nicolas Le Cam),<br/>
1706  Fix a portability issue on Windows (Longstreth Jon),<br/>
1707  Various portability patches for OpenVMS (Jacob (Jouk) Jansen),<br/>
1708  Use specific macros for portability to OS/400 (Patrick Monnerat),<br/>
1709  Add macros needed for OS/400 portability (Patrick Monnerat),<br/>
1710  Portability patch for fopen on OS/400 (Patrick Monnerat),<br/>
1711  Portability fixes for OS/400 (Patrick Monnerat),<br/>
1712  Improve va_list portability (Patrick Monnerat),<br/>
1713  Portability fix (Patrick Monnerat),<br/>
1714  Portability fix (Patrick Monnerat),<br/>
1715  Generic portability fix (Patrick Monnerat),<br/>
1716  Shortening lines in headers (Patrick Monnerat),<br/>
1717  build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB (Philip Withnall),<br/>
1718  build: Add @LZMA_LIBS@ to libxml’s pkg-config files (Philip Withnall),<br/>
1719  fix some tabs mixing incompatible with python3 (Daniel Veillard),<br/>
1720  add additional defines checks for support "./configure --with-minimum" (Denis Pauk),<br/>
1721  Another round of fixes for older versions of Python (Arfrever Frehtes Taifersar Arahesis),<br/>
1722  python: fix drv_libxml2.py for python3 compatibility (Alexandre Rostovtsev),<br/>
1723  python: Fix compiler warnings when building python3 bindings (Armin K),<br/>
1724  Fix for compilation with python 2.6.8 (Petr Sumbera)<br/>
1725  </li>
1726
1727  <li>Improvements:<br/>
1728  win32/libxml2.def.src after rebuild in doc (Roumen Petrov),<br/>
1729  elfgcchack.h: more legacy needs xmlSAX2StartElement() and xmlSAX2EndElement() (Roumen Petrov),<br/>
1730  elfgcchack.h: add xmlXPathNodeEval and xmlXPathSetContextNode (Roumen Petrov),<br/>
1731  Provide cmake module (Samuel Martin),<br/>
1732  Fix a couple of issues raised by make dist (Daniel Veillard),<br/>
1733  Fix and add const qualifiers (Kurt Roeckx),<br/>
1734  Preparing for upcoming release of 2.9.2 (Daniel Veillard),<br/>
1735  Fix zlib and lzma libraries check via command line (Dmitriy),<br/>
1736  wrong error column in structured error when parsing end tag (Juergen Keil),<br/>
1737  doc/news.html: small update to avoid line join while generating NEWS. (Patrick Monnerat),<br/>
1738  Add methods for python3 iterator (Ron Angeles),<br/>
1739  Support element node traversal in document fragments. (Kyle VanderBeek),<br/>
1740  xmlNodeSetName: Allow setting the name to a substring of the currently set name (Tristan Van Berkom),<br/>
1741  Added macros for argument casts (Eric Zurcher),<br/>
1742  adding init calls to xml and html Read parsing entry points (Daniel Veillard),<br/>
1743  Get rid of 'REPLACEMENT CHARACTER' Unicode chars in xmlschemas.c (Jan Pokorný),<br/>
1744  Implement choice for name classes on attributes (Shaun McCance),<br/>
1745  Two small namespace tweaks (Daniel Veillard),<br/>
1746  xmllint --memory should fail on empty files (Daniel Veillard),<br/>
1747  Cast encoding name to char pointer to match arg type (Nikolay Sivov)<br/>
1748  </li>
1749
1750  <li>Cleanups:<br/>
1751  Removal of old configure.in (Daniel Veillard),<br/>
1752  Unreachable code in tree.c (Gaurav Gupta),<br/>
1753  Remove a couple of dead conditions (Gaurav Gupta),<br/>
1754  Avoid some dead code and cleanup in relaxng.c (Gaurav),<br/>
1755  Drop not needed checks (Denis Pauk),<br/>
1756  Fix a wrong test (Daniel Veillard)<br/>
1757  </li>
1758</ul>
1759<h3>2.9.1: Apr 19 2013</h3>
1760<ul>
1761  <li> Features:<br/>
1762    Support for Python3 (Daniel Veillard),<br/>
1763    Add xmlXPathSetContextNode and xmlXPathNodeEval (Alex Bligh)<br/>
1764  </li>
1765
1766  <li> Documentation:<br/>
1767    Add documentation for xmllint --xpath (Daniel Veillard),<br/>
1768    Fix the URL of the SAX documentation from James (Daniel Veillard),<br/>
1769    Fix spelling of "length". (Michael Wood)<br/>
1770  </li>
1771
1772  <li> Portability:<br/>
1773    Fix python bindings with versions older than 2.7 (Daniel Veillard),<br/>
1774    rebuild docs:Makefile.am (Roumen Petrov),<br/>
1775    elfgcchack.h after rebuild in doc (Roumen Petrov),<br/>
1776    elfgcchack for buf module (Roumen Petrov),<br/>
1777    Fix a uneeded and wrong extra link parameter (Daniel Veillard),<br/>
1778    Few cleanup patches for Windows (Denis Pauk),<br/>
1779    Fix rpmbuild --nocheck (Mark Salter),<br/>
1780    Fix for win32/configure.js and WITH_THREAD_ALLOC (Daniel Richard),<br/>
1781    Fix Broken multi-arch support in xml2-config (Daniel Veillard),<br/>
1782    Fix a portability issue for GCC &lt; 3.4.0 (Daniel Veillard),<br/>
1783    Windows build fixes (Daniel Richard),<br/>
1784    Fix a thread portability problem (Friedrich Haubensak),<br/>
1785    Downgrade autoconf requirement to 2.63 (Daniel Veillard)<br/>
1786  </li>
1787
1788  <li> Bug Fixes:<br/>
1789    Fix a linking error for python bindings (Daniel Veillard),<br/>
1790    Fix a couple of return without value (Jüri Aedla),<br/>
1791    Improve the hashing functions (Daniel Franke),<br/>
1792    Improve handling of xmlStopParser() (Daniel Veillard),<br/>
1793    Remove risk of lockup in dictionary initialization (Daniel Veillard),<br/>
1794    Activate detection of encoding in external subset (Daniel Veillard),<br/>
1795    Fix an output buffer flushing conversion bug (Mikhail Titov),<br/>
1796    Fix an old bug in xmlSchemaValidateOneElement (Csaba László),<br/>
1797    Fix configure cannot remove messages (Gilles Espinasse),<br/>
1798    fix schema validation in combination with xsi:nil (Daniel Veillard),<br/>
1799    xmlCtxtReadFile doesn't work with literal IPv6 URLs (Steve Wolf),<br/>
1800    Fix a few problems with setEntityLoader (Alexey Neyman),<br/>
1801    Detect excessive entities expansion upon replacement (Daniel Veillard),<br/>
1802    Fix the flushing out of raw buffers on encoding conversions (Daniel,<br/>
1803Veillard),<br/>
1804    Fix some buffer conversion issues (Daniel Veillard),<br/>
1805    When calling xmlNodeDump make sure we grow the buffer quickly (Daniel,<br/>
1806Veillard),<br/>
1807    Fix an error in the progressive DTD parsing code (Dan Winship),<br/>
1808    xmllint should not load DTD by default when using the reader (Daniel,<br/>
1809Veillard),<br/>
1810    Try IBM-037 when looking for EBCDIC handlers (Petr Sumbera),<br/>
1811    Fix potential out of bound access (Daniel Veillard),<br/>
1812    Fix large parse of file from memory (Daniel Veillard),<br/>
1813    Fix a bug in the nsclean option of the parser (Daniel Veillard),<br/>
1814    Fix a regression in 2.9.0 breaking validation while streaming (Daniel,<br/>
1815Veillard),<br/>
1816    Remove potential calls to exit() (Daniel Veillard)<br/>
1817  </li>
1818
1819  <li> Improvements:<br/>
1820    Regenerated API, and testapi, rebuild documentation (Daniel Veillard),<br/>
1821    Fix tree iterators broken by 2to3 script (Daniel Veillard),<br/>
1822    update all tests for Python3 and Python2 (Daniel Veillard),<br/>
1823    A few more fixes for python 3 affecting libxml2.py (Daniel Veillard),<br/>
1824    Fix compilation on Python3 (Daniel Veillard),<br/>
1825    Converting apibuild.py to python3 (Daniel Veillard),<br/>
1826    First pass at starting porting to python3 (Daniel Veillard),<br/>
1827    updated configure.in for python3 (Daniel Veillard),<br/>
1828    Add support for xpathRegisterVariable in Python (Shaun McCance),<br/>
1829    Added a regression tests from bug 694228 data (Daniel Veillard),<br/>
1830    Cache presence of '&lt;' in entities content (Daniel Veillard),<br/>
1831    Avoid extra processing on entities (Daniel Veillard),<br/>
1832    Python binding for xmlRegisterInputCallback (Alexey Neyman),<br/>
1833    Python bindings: DOM casts everything to xmlNode (Alexey Neyman),<br/>
1834    Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h (Tim Starling),<br/>
1835    Adding streaming validation to runtest checks (Daniel Veillard),<br/>
1836    Add a --pushsmall option to xmllint (Daniel Veillard)<br/>
1837  </li>
1838
1839  <li> Cleanups:<br/>
1840    Switched comment in file to UTF-8 encoding (Daniel Veillard),<br/>
1841    Extend gitignore (Daniel Veillard),<br/>
1842    Silent the new python test on input (Alexey Neyman),<br/>
1843    Cleanup of a duplicate test (Daniel Veillard),<br/>
1844    Cleanup on duplicate test expressions (Daniel Veillard),<br/>
1845    Fix compiler warning after 153cf15905cf4ec080612ada6703757d10caba1e (Patrick,<br/>
1846Gansterer),<br/>
1847    Spec cleanups and a fix for multiarch support (Daniel Veillard),<br/>
1848    Silence a clang warning (Daniel Veillard),<br/>
1849    Cleanup the Copyright to be pure MIT Licence wording (Daniel Veillard),<br/>
1850    rand_seed should be static in dict.c (Wouter Van Rooy),<br/>
1851    Fix typos in parser comments (Jan Pokorný)<br/>
1852  </li>
1853</ul>
1854<h3>2.9.0: Sep 11 2012</h3>
1855<ul>
1856  <li> Features:<br/>
1857    A few new API entry points,<br/>
1858    More resilient push parser mode,<br/>
1859    A lot of portability improvement,<br/>
1860    Faster XPath evaluation<br/>
1861  </li>
1862
1863  <li> Documentation:<br/>
1864    xml2-config.1 markup error (Christian Weisgerber),<br/>
1865    libxml(3) manpage typo fix (John Bradshaw),<br/>
1866    More cleanups to the documentation part of libxml2 (Daniel Richard G)<br/>
1867  </li>
1868
1869  <li> Portability:<br/>
1870    Bug 676544 - fails to build with --without-sax1 (Akira TAGOH),<br/>
1871    fix builds not having stdint.h (Rob Richards),<br/>
1872    GetProcAddressA is available only on WinCE (Daniel Veillard),<br/>
1873    More updates and cleanups on autotools and Makefiles (Daniel Richard G),<br/>
1874    More changes for Win32 compilation (Eric Zurcher),<br/>
1875    Basic changes for Win32 builds of release 2.9.0: compile buf.c (Eric Zurcher),<br/>
1876    Bundles all generated files for python into the distribution (Daniel Richard G),<br/>
1877    Fix compiler warnings of wincecompat.c (Patrick Gansterer),<br/>
1878    Fix non __GNUC__ build (Patrick Gansterer),<br/>
1879    Fix windows unicode build (Patrick Gansterer),<br/>
1880    clean redefinition of {v}snprintf in C-source (Roumen Petrov),<br/>
1881    use xmlBuf... if DEBUG_INPUT is defined (Roumen Petrov),<br/>
1882    fix runtests to use pthreads support for various Unix platforms (Daniel Richard G),<br/>
1883    Various "make distcheck" and portability fixups 2nd part (Daniel Richard G),<br/>
1884    Various "make distcheck" and portability fixups (Daniel Richard G),<br/>
1885    Fix compilation on older Visual Studio (Daniel Veillard)<br/>
1886  </li>
1887
1888  <li> Bug Fixes:<br/>
1889    Change the XPath code to percolate allocation errors (Daniel Veillard),<br/>
1890    Fix reuse of xmlInitParser (Daniel Veillard),<br/>
1891    Fix potential crash on entities errors (Daniel Veillard),<br/>
1892    initialize var (Rob Richards),<br/>
1893    Fix the XPath arity check to also check the XPath stack limits (Daniel Veillard),<br/>
1894    Fix problem with specific and generic error handlers (Pietro Cerutti),<br/>
1895    Avoid a potential infinite recursion (Daniel Veillard),<br/>
1896    Fix an XSD error when generating internal automata (Daniel Veillard),<br/>
1897    Patch for xinclude of text using multibyte characters (Vitaly Ostanin),<br/>
1898    Fix a segfault on XSD validation on pattern error (Daniel Veillard),<br/>
1899    Fix missing xmlsave.h module which was ignored in recent builds (Daniel Veillard),<br/>
1900    Add a missing element check (Daniel Veillard),<br/>
1901    Adding various checks on node type though the API (Daniel Veillard),<br/>
1902    Namespace nodes can't be unlinked with xmlUnlinkNode (Daniel Veillard),<br/>
1903    Fix make dist to include new private header files (Daniel Veillard),<br/>
1904    More fixups on the push parser behaviour (Daniel Veillard),<br/>
1905    Strengthen behaviour of the push parser in problematic situations (Daniel Veillard),<br/>
1906    Enforce XML_PARSER_EOF state handling through the parser (Daniel Veillard),<br/>
1907    Fixup limits parser (Daniel Veillard),<br/>
1908    Do not fetch external parsed entities (Daniel Veillard),<br/>
1909    Fix an error in previous commit (Aron Xu),<br/>
1910    Fix entities local buffers size problems (Daniel Veillard),<br/>
1911    Fix parser local buffers size problems (Daniel Veillard),<br/>
1912    Fix a failure to report xmlreader parsing failures (Daniel Veillard)<br/>
1913  </li>
1914
1915  <li> Improvements:<br/>
1916    Keep libxml2.syms when running "make distclean" (Daniel Veillard),<br/>
1917    Allow to set the quoting character of an xmlWriter (Csaba Raduly),<br/>
1918    Keep non-significant blanks node in HTML parser (Daniel Veillard),<br/>
1919    Add a forbidden variable error number and message to XPath (Daniel Veillard),<br/>
1920    Support long path names on WNT (Michael Stahl),<br/>
1921    Improve HTML escaping of attribute on output (Daniel Veillard),<br/>
1922    Handle ICU_LIBS as LIBADD, not LDFLAGS to prevent linking errors (Arfrever Frehtes Taifersar Arahesis),<br/>
1923    Switching XPath node sorting to Timsort (Vojtech Fried),<br/>
1924    Optimizing '//' in XPath expressions (Nick Wellnhofer),<br/>
1925    Expose xmlBufShrink in the public tree API (Daniel Veillard),<br/>
1926    Visible HTML elements close the head tag (Conrad Irwin),<br/>
1927    Fix file and line report for XSD SAX and reader streaming validation (Daniel Veillard),<br/>
1928    Fix const qualifyer to definition of xmlBufferDetach (Daniel Veillard),<br/>
1929    minimize use of HAVE_CONFIG_H (Roumen Petrov),<br/>
1930    fixup regression in Various "make distcheck" and portability fixups (Roumen Petrov),<br/>
1931    Add support for big line numbers in error reporting (Daniel Veillard),<br/>
1932    Avoid using xmlBuffer for serialization (Daniel Veillard),<br/>
1933    Improve compatibility between xmlBuf and xmlBuffer (Daniel Veillard),<br/>
1934    Provide new accessors for xmlOutputBuffer (Daniel Veillard),<br/>
1935    Improvements for old buffer compatibility (Daniel Veillard),<br/>
1936    Expand the limit test program (Daniel Veillard),<br/>
1937    Improve error reporting on parser errors (Daniel Veillard),<br/>
1938    Implement some default limits in the XPath module (Daniel Veillard),<br/>
1939    Introduce some default parser limits (Daniel Veillard),<br/>
1940    Cleanups and new limit APIs for dictionaries (Daniel Veillard),<br/>
1941    Fixup for buf.c (Daniel Veillard),<br/>
1942    Cleanup URI module memory allocation code (Daniel Veillard),<br/>
1943    Extend testlimits (Daniel Veillard),<br/>
1944    More avoid quadratic behaviour (Daniel Veillard),<br/>
1945    Impose a reasonable limit on PI size (Daniel Veillard),<br/>
1946    first version of testlimits new test (Daniel Veillard),<br/>
1947    Avoid quadratic behaviour in some push parsing cases (Daniel Veillard),<br/>
1948    Impose a reasonable limit on comment size (Daniel Veillard),<br/>
1949    Impose a reasonable limit on attribute size (Daniel Veillard),<br/>
1950    Harden the buffer code and make it more compatible (Daniel Veillard),<br/>
1951    More cleanups for input/buffers code (Daniel Veillard),<br/>
1952    Cleanup function xmlBufResetInput(),<br/> to set input from Buffer (Daniel Veillard)
1953    Switch the test program for characters to new input buffers (Daniel Veillard),<br/>
1954    Convert the HTML tree module to the new buffers (Daniel Veillard),<br/>
1955    Convert of the HTML parser to new input buffers (Daniel Veillard),<br/>
1956    Convert the writer to new output buffer and save APIs (Daniel Veillard),<br/>
1957    Convert XMLReader to the new input buffers (Daniel Veillard),<br/>
1958    New saving functions using xmlBuf and conversion (Daniel Veillard),<br/>
1959    Provide new xmlBuf based saving functions (Daniel Veillard),<br/>
1960    Convert XInclude to the new input buffers (Daniel Veillard),<br/>
1961    Convert catalog code to the new input buffers (Daniel Veillard),<br/>
1962    Convert C14N to the new Input buffer (Daniel Veillard),<br/>
1963    Convert xmlIO.c to the new input and output buffers (Daniel Veillard),<br/>
1964    Convert XML parser to the new input buffers (Daniel Veillard),<br/>
1965    Incompatible change to the Input and Output buffers (Daniel Veillard),<br/>
1966    Adding new encoding function to deal with the new structures (Daniel Veillard),<br/>
1967    Convert XPath to xmlBuf (Daniel Veillard),<br/>
1968    Adding a new buf module for buffers (Daniel Veillard),<br/>
1969    Memory error within SAX2 reuse common framework (Daniel Veillard),<br/>
1970    Fix xmllint --xpath node initialization (Daniel Veillard)<br/>
1971  </li>
1972
1973  <li> Cleanups:<br/>
1974    Various cleanups to avoid compiler warnings (Daniel Veillard),<br/>
1975    Big space and tab cleanup (Daniel Veillard),<br/>
1976    Followup to LibXML2 docs/examples cleanup patch (Daniel Veillard),<br/>
1977    Second round of cleanups for LibXML2 docs/examples (Daniel Richard),<br/>
1978    Remove all .cvsignore as they are not used anymore (Daniel Veillard),<br/>
1979    Fix a Timsort function helper comment (Daniel Veillard),<br/>
1980    Small cleanup for valgrind target (Daniel Veillard),<br/>
1981    Patch for portability of latin characters in C files (Daniel Veillard),<br/>
1982    Cleanup some of the parser code (Daniel Veillard),<br/>
1983    Fix a variable name in comment (Daniel Veillard),<br/>
1984    Regenerated testapi.c (Daniel Veillard),<br/>
1985    Regenerating docs and API files (Daniel Veillard),<br/>
1986    Small cleanup of unused variables in test (Daniel Veillard),<br/>
1987    Expand .gitignore with more files (Daniel Veillard)<br/>
1988  </li>
1989</ul>
1990<h3>2.8.0: May 23 2012</h3>
1991<ul>
1992  <li>Features:
1993  add lzma compression support (Anders F Bjorklund)
1994  </li>
1995
1996  <li>Documentation:
1997    xmlcatalog: Add uri and delegateURI to possible add types in man page. (Ville Skyttä),
1998    Update README.tests (Daniel Veillard),
1999    URI handling code is not OOM resilient (Daniel Veillard),
2000    Fix an error in comment (Daniel Veillard),
2001    Fixed bug #617016 (Daniel Mustieles),
2002    Fixed two typos in the README document (Daniel Neel),
2003    add generated html files (Anders F Bjorklund),
2004    Clarify the need to use xmlFreeNode after xmlUnlinkNode (Daniel Veillard),
2005    Improve documentation a bit (Daniel Veillard),
2006    Updated URL for lxml python bindings (Daniel Veillard)
2007  </li>
2008
2009  <li>Portability:
2010    Restore code for Windows compilation (Daniel Veillard),
2011    Remove git error message during configure (Christian Dywan),
2012    xmllint: Build fix for endTimer if !defined(HAVE_GETTIMEOFDAY) (Patrick R. Gansterer),
2013    remove a bashism in confgure.in (John Hein),
2014    undef ERROR if already defined (Patrick R. Gansterer),
2015    Fix library problems with mingw-w64 (Michael Cronenworth),
2016    fix windows build. ifdef addition from bug 666491 makes no sense (Rob Richards),
2017    prefer native threads on win32 (Sam Thursfield),
2018    Allow to compile with Visual Studio 2010 (Thomas Lemm),
2019    Fix mingw's snprintf configure check (Andoni Morales),
2020    fixed a 64bit big endian issue (Marcus Meissner),
2021    Fix portability failure if netdb.h lacks NO_ADDRESS (Daniel Veillard),
2022    Fix windows build from lzma addition (Rob Richards),
2023    autogen: Only check for libtoolize (Colin Walters),
2024    Fix the Windows build files (Patrick von Reth),
2025    634846 Remove a linking option breaking Windows VC10 (Daniel Veillard),
2026    599241 fix an initialization problem on Win64 (Andrew W. Nosenko),
2027    fix win build (Rob Richards)
2028  </li>
2029
2030  <li>Bug fixes:
2031    Part for rand_r checking missing (Daniel Veillard),
2032    Cleanup on randomization (Daniel Veillard),
2033    Fix undefined reference in python module (Pacho Ramos),
2034    Fix a race in xmlNewInputStream (Daniel Veillard),
2035    Fix weird streaming RelaxNG errors (Noam),
2036    Fix various bugs in new code raised by the API checking (Daniel Veillard),
2037    Fix various problems with "make dist" (Daniel Veillard),
2038    Fix a memory leak in the xzlib code (Daniel Veillard),
2039    HTML parser error with &lt;noscript&gt; in the &lt;head&gt; (Denis Pauk),
2040    XSD: optional element in complex type extension (Remi Gacogne),
2041    Fix html serialization error and htmlSetMetaEncoding() (Daniel Veillard),
2042    Fix a wrong return value in previous patch (Daniel Veillard),
2043    Fix an uninitialized variable use (Daniel Veillard),
2044    Fix a compilation problem with --minimum (Brandon Slack),
2045    Remove redundant and ungarded include of resolv.h (Daniel Veillard),
2046    xinclude with parse="text" does not use the entity loader (Shaun McCance),
2047    Allow to parse 1 byte HTML files (Denis Pauk),
2048    Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag (Martin Schröder),
2049    Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
2050    Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
2051    xmlParseNodeInContext problems with an empty document (Tim Elliott),
2052    HTML element position is not detected properly (Pavel Andrejs),
2053    Fix an off by one pointer access (Jüri Aedla),
2054    Try to fix a problem with entities in SAX mode (Daniel Veillard),
2055    Fix a crash with xmllint --path on empty results (Daniel Veillard),
2056    Fixed bug #667946 (Daniel Mustieles),
2057    Fix a logic error in Schemas Component Constraints (Ryan Sleevi),
2058    Fix a wrong enum type use in Schemas Types (Nico Weber),
2059    Fix SAX2 builder in case of undefined attributes namespace (Daniel Veillard),
2060    Fix SAX2 builder in case of undefined element namespaces (Daniel Veillard),
2061    fix reference to STDOUT_FILENO on MSVC (Tay Ray Chuan),
2062    fix a pair of possible out of array char references (Daniel Veillard),
2063    Fix an allocation error when copying entities (Daniel Veillard),
2064    Make sure the parser returns when getting a Stop order (Chris Evans),
2065    Fix some potential problems on reallocation failures(parser.c) (Xia Xinfeng),
2066    Fix a schema type duration comparison overflow (Daniel Veillard),
2067    Fix an unimplemented part in RNG value validation (Daniel Veillard),
2068    Fix missing error status in XPath evaluation (Daniel Veillard),
2069    Hardening of XPath evaluation (Daniel Veillard),
2070    Fix an off by one error in encoding (Daniel Veillard),
2071    Fix RELAX NG include bug #655288 (Shaun McCance),
2072    Fix XSD validation bug #630130 (Toyoda Eizi),
2073    Fix some potential problems on reallocation failures (Chris Evans),
2074    __xmlRaiseError: fix use of the structured callback channel (Dmitry V. Levin),
2075    __xmlRaiseError: fix the structured callback channel's data initialization (Dmitry V. Levin),
2076    Fix memory corruption when xmlParseBalancedChunkMemoryInternal is called from xmlParseBalancedChunk (Rob Richards),
2077    Small fix for previous commit (Daniel Veillard),
2078    Fix a potential freeing error in XPath (Daniel Veillard),
2079    Fix a potential memory access error (Daniel Veillard),
2080    Reactivate the shared library versioning script (Daniel Veillard)
2081  </li>
2082
2083  <li>Improvements:
2084    use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime (Roumen Petrov),
2085    New symbols added for the next release (Daniel Veillard),
2086    xmlTextReader bails too quickly on error (Andy Lutomirski),
2087    Use a hybrid allocation scheme in xmlNodeSetContent (Conrad Irwin),
2088    Use buffers when constructing string node lists. (Conrad Irwin),
2089    Add HTML parser support for HTML5 meta charset encoding declaration (Denis Pauk),
2090    wrong message for double hyphen in comment XML error (Bryan Henderson),
2091    Fix "make tst" to grab lzma lib too (Daniel Veillard),
2092    Add "whereis" command to xmllint shell (Ryan),
2093    Improve xmllint shell (Ryan),
2094    add function xmlTextReaderRelaxNGValidateCtxt() (Noam Postavsky),
2095    Add --system support to autogen.sh (Daniel Veillard),
2096    Add hash randomization to hash and dict structures (Daniel Veillard),
2097    included xzlib in dist (Anders F Bjorklund),
2098    move xz/lzma helpers to separate included files (Anders F Bjorklund),
2099    add generated devhelp files (Anders F Bjorklund),
2100    add XML_WITH_LZMA to api (Anders F Bjorklund),
2101    autogen.sh: Honor NOCONFIGURE environment variable (Colin Walters),
2102    Improve the error report on undefined REFs (Daniel Veillard),
2103    Add exception for new W3C PI xml-model (Daniel Veillard),
2104    Add options to ignore the internal encoding (Daniel Veillard),
2105    testapi: use the right type for the check (Stefan Kost),
2106    various: handle return values of write calls (Stefan Kost),
2107    testWriter: xmlTextWriterWriteFormatElement wants an int instead of a long int (Stefan Kost),
2108    runxmlconf: update to latest testsuite version (Stefan Kost),
2109    configure: add -Wno-long-long to CFLAGS (Stefan Kost),
2110    configure: support silent automake rules if possible (Stefan Kost),
2111    xmlmemory: add a cast as size_t has no portable printf modifier (Stefan Kost),
2112    __xmlRaiseError: remove redundant schannel initialization (Dmitry V. Levin),
2113    __xmlRaiseError: do cheap code check early (Dmitry V. Levin)
2114  </li>
2115
2116  <li>Cleanups:
2117    Cleanups before 2.8.0-rc2 (Daniel Veillard),
2118    Avoid an extra operation (Daniel Veillard),
2119    Remove vestigial de-ANSI-fication support. (Javier Jardón),
2120    autogen.sh: Fix typo (Javier Jardón),
2121    Do not use unsigned but unsigned int (Daniel Veillard),
2122    Remove two references to u_short (Daniel Veillard),
2123    Fix -Wempty-body warning from clang (Nico Weber),
2124    Cleanups of lzma support (Daniel Veillard),
2125    Augment the list of ignored files (Daniel Veillard),
2126    python: remove unused variable (Stefan Kost),
2127    python: flag two unused args (Stefan Kost),
2128    configure: acconfig.h is deprecated since autoconf-2.50 (Stefan Kost),
2129    xpath: remove unused variable (Stefan Kost)
2130  </li>
2131</ul>
2132<h3>2.7.8: Nov 4 2010</h3>
2133<ul>
2134  <li> Features:
2135    480323 add code to plug in ICU converters by default (Giuseppe Iuculano),
2136    Add xmlSaveOption XML_SAVE_WSNONSIG (Adam Spragg)
2137  </li>
2138  <li> Documentation:
2139    Fix devhelp documentation installation (Mike Hommey),
2140    Fix web site encoding problems (Daniel Veillard),
2141    Fix a couple of typo in HTML parser error messages (Michael Day),
2142    Forgot to update the news page for 0.7.7 (Daniel Veillard)
2143  </li>
2144  <li> Portability:
2145    607273 Fix python detection on MSys/Windows (LRN),
2146    614087 Fix Socket API usage to allow Windows64 compilation (Ozkan Sezer),
2147    Fix compilation with Clang (Koop Mast),
2148    Fix Win32 build (Rob Richards)
2149  </li>
2150  <li> Bug Fixes:
2151    595789 fix a remaining potential Solaris problem (Daniel Veillard),
2152    617468 fix progressive HTML parsing with style using "'" (Denis Pauk),
2153    616478 Fix xmllint shell write command (Gwenn Kahz),
2154    614005 Possible erroneous HTML parsing on unterminated script (Pierre Belzile),
2155    627987 Fix XSD IDC errors in imported schemas (Jim Panetta),
2156    629325 XPath rounding errors first cleanup (Phil Shafer),
2157    630140 fix iso995x encoding error (Daniel Veillard),
2158    make sure htmlCtxtReset do reset the disableSAX field (Daniel Veillard),
2159    Fix a change of semantic on XPath preceding and following axis (Daniel Veillard),
2160    Fix a potential segfault due to weak symbols on pthreads (Mike Hommey),
2161    Fix a leak in XPath compilation (Daniel Veillard),
2162    Fix the semantic of XPath axis for namespace/attribute context nodes (Daniel Veillard),
2163    Avoid a descriptor leak in catalog loading code (Carlo Bramini),
2164    Fix a small bug in XPath evaluation code (Marius Wachtler),
2165    Fix handling of XML-1.0 XML namespace declaration (Daniel Veillard),
2166    Fix errors in XSD double validation check (Csaba Raduly),
2167    Fix handling of apos in URIs (Daniel Veillard),
2168    xmlTextReaderReadOuterXml should handle DTD (Rob Richards),
2169    Autogen.sh needs to create m4 directory (Rob Richards)
2170  </li>
2171  <li> Improvements:
2172    606592 update language ID parser to RFC 5646 (Daniel Veillard),
2173    Sort python generated stubs (Mike Hommey),
2174    Add an HTML parser option to avoid a default doctype (Daniel Veillard)
2175  </li>
2176  <li> Cleanups:
2177    618831 don't ship generated files in git (Adrian Bunk),
2178    Switch from the obsolete mkinstalldirs to AC_PROG_MKDIR_P (Adrian Bunk),
2179    Various cleanups on encoding handling (Daniel Veillard),
2180    Fix xmllint to use format=1 for default formatting (Adam Spragg),
2181    Force _xmlSaveCtxt.format to be 0 or 1 (Adam Spragg),
2182    Cleanup encoding pointer comparison (Nikolay Sivov),
2183    Small code cleanup on previous patch (Daniel Veillard)
2184  </li>
2185</ul>
2186<h3>2.7.7: Mar 15 2010</h3>
2187<ul>
2188  <li> Improvements:
2189    Adding a --xpath option to xmllint (Daniel Veillard),
2190    Make HTML parser non-recursive (Eugene Pimenov)
2191  </li>
2192  <li> Portability:
2193    relaxng.c: cast to allow compilation with sun studio 11 (Ben Walton),
2194    Fix build failure on Sparc solaris (Roumen Petrov),
2195    use autoreconf in autogen.sh (Daniel Veillard),
2196    Fix build with mingw (Roumen Petrov),
2197    Upgrade some of the configure and autogen (Daniel Veillard),
2198    Fix relaxNG tests in runtest for Windows runtest.c: initialize ret (Rob Richards),
2199    Fix a const warning in xmlNodeSetBase (Martin Trappel),
2200    Fix python generator to not use deprecated xmllib (Daniel Veillard),
2201    Update some automake files (Daniel Veillard),
2202    598785 Fix nanohttp on Windows (spadix)
2203  </li>
2204  <li> Bug Fixes:
2205    libxml violates the zlib interface and crashes (Mark Adler),
2206    Fix broken escape behaviour in regexp ranges (Daniel Veillard),
2207    Fix  missing win32 libraries in libxml-2.0.pc (Volker Grabsch),
2208    Fix detection of python linker flags (Daniel Macks),
2209    fix build error in libxml2/python (Paul Smith),
2210    ChunkParser: Incorrect decoding of small xml files (Raul Hudea),
2211    htmlCheckEncoding doesn't update input-end after shrink (Eugene Pimenov),
2212    Fix a missing #ifdef (Daniel Veillard),
2213    Fix encoding selection for xmlParseInNodeContext (Daniel Veillard),
2214    xmlPreviousElementSibling mistake (François Delyon),
2215    608773 add a missing check in xmlGROW (Daniel Veillard),
2216    Fix xmlParseInNodeContext for HTML content (Daniel Veillard),
2217    Fix lost namespace when copying node * tree.c: reconcile namespace if not found (Rob Richards),
2218    Fix some missing commas in HTML element lists (Eugene Pimenov),
2219    Correct variable type to unsigned (Nikolay Sivov),
2220    Recognize ID attribute in HTML without DOCTYPE (Daniel Veillard),
2221    Fix memory leak in xmlXPathEvalExpression() (Martin),
2222    Fix an init bug in global.c (Kai Henning),
2223    Fix xmlNodeSetBase() comment (Daniel Veillard),
2224    Fix broken escape behaviour in regexp ranges (Daniel Veillard),
2225    Don't give default HTML boolean attribute values in parser (Daniel Veillard),
2226    xmlCtxtResetLastError should reset ctxt-errNo (Daniel Veillard)
2227  </li>
2228  <li> Cleanups:
2229    Cleanup a couple of weirdness in HTML parser (Eugene Pimenov)
2230  </li>
2231</ul>
2232<h3>2.7.6: Oct  6 2009</h3>
2233<ul>
2234  <li> Bug Fixes:
2235     Restore thread support in default configuration (Andrew W. Nosenko),
2236     URI with no path parsing problem (Daniel Veillard),
2237     Minor patch for conditional defines in threads.c (Eric Zurcher)
2238  </li>
2239</ul>
2240<h3>2.7.5: Sep 24 2009</h3>
2241<ul>
2242  <li> Bug Fixes:
2243    Restore behavior of --with-threads without argument (Andrew W. Nosenko),
2244    Fix memory leak when doc is NULL (Rob Richards),
2245    595792 fixing a RelaxNG bug introduced in 2.7.4 (Daniel Veillard),
2246    Fix a Relaxng bug raised by libvirt test suite (Daniel Veillard),
2247    Fix a parsing problem with little data at startup (Daniel Veillard),
2248    link python module with python library (Frederic Crozat),
2249    594874 Forgot an fclose in xmllint (Daniel Veillard)
2250  </li>
2251  <li> Cleanup:
2252    Adding symbols.xml to EXTRA_DIST (Daniel Veillard)
2253  </li>
2254</ul>
2255<h3>2.7.4: Sep 10 2009</h3>
2256<ul>
2257  <li>Improvements:
2258    Switch to GIT (GNOME),
2259    Add symbol versioning to libxml2 shared libs (Daniel Veillard)
2260  </li>
2261  <li>Portability:
2262    593857 try to work around thread pbm MinGW 4.4 (Daniel Veillard),
2263    594250 rename ATTRIBUTE_ALLOC_SIZE to avoid clashes (Daniel Veillard),
2264    Fix Windows build * relaxng.c: fix windows build (Rob Richards),
2265    Fix the globals.h to use XMLPUBFUN (Paul Smith),
2266    Problem with extern extern in header (Daniel Veillard),
2267    Add -lnetwork for compiling on Haiku (Scott McCreary),
2268    Runtest portability patch for Solaris (Tim Rice),
2269    Small patch to accommodate the Haiku OS (Scott McCreary),
2270    584605 package VxWorks folder in the distribution (Daniel Veillard),
2271    574017 Realloc too expensive on most platform (Daniel Veillard),
2272    Fix windows build (Rob Richards),
2273    545579 doesn't compile without schema support (Daniel Veillard),
2274    xmllint use xmlGetNodePath when not compiled in (Daniel Veillard),
2275    Try to avoid __imp__xmlFree link trouble on msys (Daniel Veillard),
2276    Allow to select the threading system on Windows (LRN),
2277    Fix Solaris binary links, cleanups (Daniel Veillard),
2278    Bug 571059 – MSVC doesn't work with the bakefile (Intron),
2279    fix ATTRIBUTE_PRINTF header clash (Belgabor and Mike Hommey),
2280    fixes for Borland/CodeGear/Embarcadero compilers (Eric Zurcher)
2281  </li>
2282  <li>Documentation:
2283    544910 typo: "renciliateNs" (Leonid Evdokimov),
2284    Add VxWorks to list of OSes (Daniel Veillard),
2285    Regenerate the documentation and update for git (Daniel Veillard),
2286    560524 ¿ xmlTextReaderLocalName description (Daniel Veillard),
2287    Added sponsoring by AOE media for the server (Daniel Veillard),
2288    updated URLs for GNOME (Vincent Lefevre),
2289    more warnings about xmlCleanupThreads and xmlCleanupParser (Daniel Veillard)
2290  </li>
2291  <li>Bug fixes:
2292    594514 memory leaks - duplicate initialization (MOD),
2293    Wrong block opening in htmlNodeDumpOutputInternal (Daniel Veillard),
2294    492317 Fix  Relax-NG validation problems (Daniel Veillard),
2295    558452 fight with reg test and error report (Daniel Veillard),
2296    558452 RNG compilation of optional multiple child (Daniel Veillard),
2297    579746 XSD validation not correct / nilable groups (Daniel Veillard),
2298    502960 provide namespace stack when parsing entity (Daniel Veillard),
2299    566012 part 2 fix regression tests and push mode (Daniel Veillard),
2300    566012 autodetected encoding and encoding conflict (Daniel Veillard),
2301    584220 xpointer(/) and xinclude problems (Daniel Veillard),
2302    587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
2303    444994 HTML chunked failure for attribute with &lt;&gt; (Daniel Veillard),
2304    Fix end of buffer char being split in XML parser (Daniel Veillard),
2305    Non ASCII character may be split at buffer end (Adiel Mittmann),
2306    440226 Add xmlXIncludeProcessTreeFlagsData API (Stefan Behnel),
2307    572129 speed up parsing of large HTML text nodes (Markus Kull),
2308    Fix HTML parsing with 0 character in CDATA (Daniel Veillard),
2309    Fix SetGenericErrorFunc and SetStructured clash (Wang Lam),
2310    566012  Incomplete EBCDIC parsing support (Martin Kogler),
2311    541335 HTML avoid creating 2 head or 2 body element (Daniel Veillard),
2312    541237 error correcting missing end tags in HTML (Daniel Veillard),
2313    583439 missing line numbers in push mode (Daniel Veillard),
2314    587867 xmllint --html --xmlout serializing as HTML (Daniel Veillard),
2315    559501 avoid select and use poll for nanohttp (Raphael Prevost),
2316    559410 -  Regexp bug on (...)? constructs (Daniel Veillard),
2317    Fix a small problem on previous HTML parser patch (Daniel Veillard),
2318    592430 -  HTML parser runs into endless loop (Daniel Veillard),
2319    447899 potential double free in xmlFreeTextReader (Daniel Veillard),
2320    446613 small validation bug mixed content with NS (Daniel Veillard),
2321    Fix the problem of revalidating a doc with RNG (Daniel Veillard),
2322    Fix xmlKeepBlanksDefault to not break indent (Nick Wellnhofer),
2323    512131 refs from externalRef part need to be added (Daniel Veillard),
2324    512131 crash in xmlRelaxNGValidateFullElement (Daniel Veillard),
2325    588441 allow '.' in HTML Names even if invalid (Daniel Veillard),
2326    582913 Fix htmlSetMetaEncoding() to be nicer (Daniel Veillard),
2327    579317 Try to find the HTML encoding information (Daniel Veillard),
2328    575875 don't output charset=html (Daniel Veillard),
2329    571271 fix semantic of xsd:all with minOccurs=0 (Daniel Veillard),
2330    570702 fix a bug in regexp determinism checking (Daniel Veillard),
2331    567619 xmlValidateNotationUse missing param test (Daniel Veillard),
2332    574393 ¿ utf-8 filename magic for compressed files (Hans Breuer),
2333    Fix a couple of problems in the parser (Daniel Veillard),
2334    585505 ¿ Document ids and refs populated by XSD (Wayne Jensen),
2335    582906 XSD validating multiple imports of the same schema (Jason Childs),
2336    Bug 582887 ¿ problems validating complex schemas (Jason Childs),
2337    Bug 579729 ¿ fix XSD schemas parsing crash (Miroslav Bajtos),
2338    576368 ¿ htmlChunkParser with special attributes (Jiri Netolicky),
2339    Bug 565747 ¿ relax anyURI data character checking (Vincent Lefevre),
2340    Preserve attributes of include start on tree copy (Petr Pajas),
2341    Skip silently unrecognized XPointer schemes (Jakub Wilk),
2342    Fix leak on SAX1, xmllint --sax1 option and debug (Daniel Veillard),
2343    potential NULL dereference on non-glibc (Jim Meyering),
2344    Fix an XSD validation crash (Daniel Veillard),
2345    Fix a regression in streaming entities support (Daniel Veillard),
2346    Fix a couple of ABI issues with C14N 1.1 (Aleksey Sanin),
2347    Aleksey Sanin support for c14n 1.1 (Aleksey Sanin),
2348    reader bug fix with entities (Daniel Veillard),
2349    use options from current parser ctxt for external entities (Rob Richards),
2350    581612 use %s to printf strings (Christian Persch),
2351    584605 change the threading initialization sequence (Igor Novoseltsev),
2352    580705 keep line numbers in HTML parser (Aaron Patterson),
2353    581803 broken HTML table attributes init (Roland Steiner),
2354    do not set error code in xmlNsWarn (Rob Richards),
2355    564217 fix structured error handling problems,
2356    reuse options from current parser for entities (Rob Richards),
2357    xmlXPathRegisterNs should not allow enpty prefixes (Daniel Veillard),
2358    add a missing check in xmlAddSibling (Kris Breuker),
2359    avoid leaks on errors (Jinmei Tatuya)
2360  </li>
2361  <li>Cleanup:
2362    Chasing dead assignments reported by clang-scan (Daniel Veillard),
2363    A few more safety cleanup raised by scan (Daniel Veillard),
2364    Fixing assorted potential problems raised by scan (Daniel Veillard),
2365    Potential uninitialized arguments raised by scan (Daniel Veillard),
2366    Fix a bunch of scan 'dead increments' and cleanup (Daniel Veillard),
2367    Remove a pedantic warning (Daniel Veillard),
2368    555833 always use rm -f in uninstall-local (Daniel Veillard),
2369    542394 xmlRegisterOutputCallbacks MAX_INPUT_CALLBACK (Daniel Veillard),
2370    Autoregenerate libxml2.syms automated checkings (Daniel Veillard),
2371    Make xmlRecoverDoc const (Martin Trappel) (Daniel Veillard),
2372    Both args of xmlStrcasestr are const (Daniel Veillard),
2373    hide the nbParse* variables used for debugging (Mike Hommey),
2374    570806 changed include of config.h (William M. Brack),
2375    cleanups and error reports when xmlTextWriterVSprintf fails (Jinmei Tatuya)
2376  </li>
2377</ul>
2378<h3>2.7.3: Jan 18 2009</h3>
2379<ul>
2380  <li>Build fix: fix build when HTML support is not included.</li>
2381  <li>Bug fixes: avoid memory overflow in gigantic text nodes,
2382      indentation problem on the writed (Rob Richards),
2383      xmlAddChildList pointer problem (Rob Richards and Kevin Milburn),
2384      xmlAddChild problem with attribute (Rob Richards and Kris Breuker),
2385      avoid a memory leak in an edge case (Daniel Zimmermann),
2386      deallocate some pthread data (Alex Ott).</li>
2387  <li>Improvements: configure option to avoid rebuilding docs (Adrian Bunk),
2388      limit text nodes to 10MB max by default, add element traversal
2389      APIs, add a parser option to enable pre 2.7 SAX behavior (Rob Richards),
2390      add gcc malloc checking (Marcus Meissner), add gcc printf like functions
2391      parameters checking (Marcus Meissner).</li>
2392</ul>
2393<h3>2.7.2: Oct 3 2008</h3>
2394<ul>
2395    <li>Portability fix: fix solaris compilation problem, fix compilation
2396        if XPath is not configured in</li>
2397    <li>Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour
2398        when saving an HTML doc with an xml dump function, HTML UTF-8 parsing
2399        bug, fix reader custom error handlers (Riccardo Scussat)
2400    <li>Improvement: xmlSave options for more flexibility to save as
2401        XML/HTML/XHTML, handle leading BOM in HTML documents</li>
2402</ul>
2403
2404<h3>2.7.1: Sep 1 2008</h3>
2405<ul>
2406    <li>Portability fix: Borland C fix (Moritz Both)</li>
2407    <li>Bug fixes: python serialization wrappers, XPath QName corner
2408        case handking and leaks (Martin)</li>
2409    <li>Improvement: extend the xmlSave to handle HTML documents and trees</li>
2410    <li>Cleanup: python serialization wrappers</li>
2411</ul>
2412
2413<h3>2.7.0: Aug 30 2008</h3>
2414<ul>
2415  <li>Documentation: switch ChangeLog to UTF-8, improve mutithreads and
2416      xmlParserCleanup docs</li>
2417  <li>Portability fixes: Older Win32 platforms (Rob Richards), MSVC
2418      porting fix (Rob Richards), Mac OS X regression tests (Sven Herzberg),
2419      non GNUCC builds (Rob Richards), compilation on Haiku (Andreas Färber)
2420      </li>
2421  <li>Bug fixes: various realloc problems (Ashwin), potential double-free
2422      (Ashwin), regexp crash, icrash with invalid whitespace facets (Rob
2423      Richards), pattern fix when streaming (William Brack), various XML
2424      parsing and validation fixes based on the W3C regression tests, reader
2425      tree skipping function fix (Ashwin), Schemas regexps escaping fix
2426      (Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
2427      when encoder can't serialize characters on output</li>
2428  <li>Code cleanup: compilation fix without the reader, without the output
2429      (Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
2430      serious cleanup of the entity handling code</li>
2431  <li>Improvement: switch parser to XML-1.0 5th edition, add parsing flags
2432      for old versions, switch URI parsing to RFC 3986,
2433      add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
2434      new hashing functions for dictionaries (based on Stefan Behnel work),
2435      improve handling of misplaced html/head/body in HTML parser, better
2436      regression test tools and code coverage display, better algorithms
2437      to detect various versions of the billion laughts attacks, make
2438      arbitrary parser limits avoidable as a parser option</li>
2439</ul>
2440<h3>2.6.32: Apr 8 2008</h3>
2441<ul>
2442  <li>Documentation: returning heap memory to kernel (Wolfram Sang),
2443      trying to clarify xmlCleanupParser() use, xmlXPathContext improvement
2444      (Jack Jansen), improve the *Recover* functions documentation,
2445      XmlNodeType doc link fix (Martijn Arts)</li>
2446  <li>Bug fixes: internal subset memory leak (Ashwin), avoid problem with
2447      paths starting with // (Petr Sumbera), streaming XSD validation callback
2448      patches (Ashwin), fix redirection on port other than 80 (William Brack),
2449      SAX2 leak (Ashwin), XInclude fragment of own document (Chris Ryan),
2450      regexp bug with '.' (Andrew Tosh), flush the writer at the end of the
2451      document (Alfred Mickautsch), output I/O bug fix (William Brack),
2452      writer CDATA output after a text node (Alex Khesin), UTF-16 encoding
2453      detection (William Brack), fix handling of empty CDATA nodes for Safari
2454      team, python binding problem with namespace nodes, improve HTML parsing
2455      (Arnold Hendriks), regexp automata build bug, memory leak fix (Vasily
2456      Chekalkin), XSD test crash, weird system parameter entity parsing problem,
2457      allow save to file:///X:/ windows paths, various attribute normalisation
2458      problems, externalSubsetSplit fix (Ashwin), attribute redefinition in
2459      the DTD (Ashwin), fix in char ref parsing check (Alex Khesin), many
2460      out of memory handling fixes (Ashwin), XPath out of memory handling fixes
2461      (Alvaro Herrera), various realloc problems (Ashwin), UCS4 encoding
2462      conversion buffer size (Christian Fruth), problems with EatName
2463      functions on memory errors, BOM handling in external parsed entities
2464      (Mark Rowe)</li>
2465  <li>Code cleanup: fix build under VS 2008 (David Wimsey), remove useless
2466      mutex in xmlDict (Florent Guilian), Mingw32 compilation fix (Carlo
2467      Bramini), Win and MacOS EOL cleanups (Florent Guiliani), iconv need
2468      a const detection (Roumen Petrov), simplify xmlSetProp (Julien Charbon),
2469      cross compilation fixes for Mingw (Roumen Petrov), SCO Openserver build
2470      fix (Florent Guiliani), iconv uses const on Win32 (Rob Richards),
2471      duplicate code removal (Ashwin), missing malloc test and error reports
2472      (Ashwin), VMS makefile fix (Tycho Hilhorst)</li>
2473  <li>improvements: better plug of schematron in the normal error handling
2474      (Tobias Minich)</li>
2475</ul>
2476
2477<h3>2.6.31: Jan 11 2008</h3>
2478<ul>
2479  <li>Security fix: missing of checks in UTF-8 parsing</li>
2480  <li>Bug fixes: regexp bug, dump attribute from XHTML document, fix
2481      xmlFree(NULL) to not crash in debug mode, Schematron parsing crash
2482      (Rob Richards), global lock free on Windows (Marc-Antoine Ruel),
2483      XSD crash due to double free (Rob Richards), indentation fix in
2484      xmlTextWriterFullEndElement (Felipe Pena), error in attribute type
2485      parsing if attribute redeclared, avoid crash in hash list scanner if
2486      deleting elements, column counter bug fix (Christian Schmidt),
2487      HTML embed element saving fix (Stefan Behnel), avoid -L/usr/lib
2488      output from xml2-config (Fred Crozat), avoid an xmllint crash
2489      (Stefan Kost), don't stop HTML parsing on out of range chars.
2490      </li>
2491  <li>Code cleanup: fix open() call third argument, regexp cut'n paste
2492      copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
2493      some make distcheck related fixes (John Carr)</li>
2494  <li>Improvements: HTTP Header: includes port number (William Brack),
2495      testURI --debug option, </li>
2496</ul>
2497<h3>2.6.30: Aug 23 2007</h3>
2498<ul>
2499  <li>Portability: Solaris crash on error handling, windows path fixes
2500      (Roland Schwarz and Rob Richards), mingw build (Roland Schwarz)</li>
2501  <li>Bugfixes: xmlXPathNodeSetSort problem (William Brack), leak when
2502      reusing a writer for a new document (Dodji Seketeli), Schemas
2503      xsi:nil handling patch (Frank Gross), relative URI build problem
2504      (Patrik Fimml), crash in xmlDocFormatDump, invalid char in comment
2505      detection bug, fix disparity with xmlSAXUserParseMemory, automata
2506      generation for complex regexp counts problems, Schemas IDC import
2507      problems (Frank Gross), xpath predicate evailation error handling
2508      (William Brack)</li>
2509</ul>
2510<h3>2.6.29: Jun 12 2007</h3>
2511<ul>
2512  <li>Portability: patches from Andreas Stricke for WinCEi,
2513      fix compilation warnings (William Brack), avoid warnings on Apple OS/X
2514      (Wendy Doyle and Mark Rowe), Windows compilation and threading
2515      improvements (Rob Richards), compilation against old Python versions,
2516      new GNU tar changes (Ryan Hill)</li>
2517  <li>Documentation: xmlURIUnescapeString comment, </li>
2518  <li>Bugfixes: xmlBufferAdd problem (Richard Jones), 'make valgrind'
2519      flag fix (Richard Jones), regexp interpretation of \,
2520      htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
2521      typo (Bjorn Reese), entity content failure, xmlListAppend() fix
2522      (Georges-André Silber), XPath number serialization (William Brack),
2523      nanohttp gzipped stream fix (William Brack and Alex Cornejo),
2524      xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
2525      XPath string value of PI nodes (William Brack), XPath node set
2526      sorting bugs (William Brack), avoid outputting namespace decl
2527      dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
2528      error handling, recustion on next in catalogs, fix a Relax-NG crash,
2529      workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
2530      invalid character in attribute detection bug, big comments before
2531      internal subset streaming bug, HTML parsing of attributes with : in
2532      the name, IDness of name in HTML (Dagfinn I. Mannsåker) </li>
2533  <li>Improvement: keep URI query parts in raw form (Richard Jones),
2534      embed tag support in HTML (Michael Day) </li>
2535</ul>
2536
2537<h3>2.6.28: Apr 17 2007</h3>
2538<ul>
2539  <li>Documentation: comment fixes (Markus Keim), xpath comments fixes too
2540      (James Dennett)</li>
2541  <li>Bug fixes: XPath bug (William Brack), HTML parser autoclose stack usage
2542      (Usamah Malik), various regexp bug fixes (DV and William), path conversion
2543      on Windows (Igor Zlatkovic), htmlCtxtReset fix (Michael Day), XPath
2544      principal node of axis bug, HTML serialization of some codepoint
2545      (Steven Rainwater), user data propagation in XInclude (Michael Day),
2546      standalone and XML decl detection (Michael Day), Python id output
2547      for some id, fix the big python string memory leak, URI parsing fixes
2548      (Stéphane Bidoul and William), long comments parsing bug (William),
2549      concurrent threads initialization (Ted Phelps), invalid char
2550      in text XInclude (William), XPath memory leak (William), tab in
2551      python problems (Andreas Hanke), XPath node comparison error
2552      (Oleg Paraschenko), cleanup patch for reader (Julien Reichel),
2553      XML Schemas attribute group (William), HTML parsing problem (William),
2554      fix char 0x2d in regexps (William), regexp quantifier range with
2555      min occurs of 0 (William), HTML script/style parsing (Mike Day)</li>
2556  <li>Improvement: make xmlTextReaderSetup() public</li>
2557  <li>Compilation and postability: fix a missing include problem (William),
2558      __ss_family on AIX again (Björn Wiberg), compilation without zlib
2559      (Michael Day), catalog patch for Win32 (Christian Ehrlicher),
2560      Windows CE fixes (Andreas Stricke)</li>
2561  <li>Various CVS to SVN infrastructure changes</li>
2562</ul>
2563<h3>2.6.27: Oct 25 2006</h3>
2564<ul>
2565  <li>Portability fixes: file names on windows (Roland Schwingel,
2566      Emelyanov Alexey), windows compile fixup (Rob Richards),
2567      AIX iconv() is apparently case sensitive</li>
2568  <li>improvements: Python XPath types mapping (Nic Ferrier), XPath optimization
2569      (Kasimier), add xmlXPathCompiledEvalToBoolean (Kasimier), Python node
2570      equality and comparison (Andreas Pakulat), xmlXPathCollectAndTest
2571      improvememt (Kasimier), expose if library was compiled with zlib
2572      support (Andrew Nosenko), cache for xmlSchemaIDCMatcher structs
2573      (Kasimier), xmlTextConcat should work with comments and PIs (Rob
2574      Richards), export htmlNewParserCtxt needed by Michael Day, refactoring
2575      of catalog entity loaders (Michael Day), add XPointer support to
2576      python bindings (Ross Reedstrom, Brian West and Stefan Anca),
2577      try to sort out most file path to URI conversions and xmlPathToUri,
2578      add --html --memory case to xmllint</li>
2579  <li>building fix: fix --with-minimum (Felipe Contreras), VMS fix,
2580      const'ification of HTML parser structures (Matthias Clasen),
2581      portability fix (Emelyanov Alexey), wget autodetection (Peter
2582      Breitenlohner),  remove the build path recorded in the python
2583      shared module, separate library flags for shared and static builds
2584      (Mikhail Zabaluev), fix --with-minimum --with-sax1 builds, fix
2585      --with-minimum --with-schemas builds</li>
2586  <li>bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
2587      attribute (Kasimier), crash when using the recover mode,
2588      xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
2589      missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
2590      (Kasimier), warning on entities processing, XHTML script and style
2591      serialization (Kasimier), python generator for long types, bug in
2592      xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
2593      allocation bug (Marton Illes), error message end of line (Rob Richards),
2594      fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
2595      crash, parser safety patch (Ben Darnell), _private context propagation
2596      when parsing entities (with Michael Day), fix entities behaviour when
2597      using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
2598      context, arg error in SAX callback (Mike Hommey), fix mixed-content
2599      autodetect when using --noblanks, fix xmlIOParseDTD error handling,
2600      fix bug in xmlSplitQName on special Names, fix Relax-NG element content
2601      validation bug, fix xmlReconciliateNs bug, fix potential attribute
2602      XML parsing bug, fix line/column accounting in XML parser, chunking bug
2603      in the HTML parser on script, try to detect obviously buggy HTML
2604      meta encoding indications, bugs with encoding BOM and xmlSaveDoc,
2605      HTML entities in attributes parsing, HTML minimized attribute values,
2606      htmlReadDoc and htmlReadIO were broken, error handling bug in
2607      xmlXPathEvalExpression (Olaf Walkowiak), fix a problem in
2608      htmlCtxtUseOptions, xmlNewInputFromFile could leak (Marius Konitzer),
2609      bug on misformed SSD regexps (Christopher Boumenot)
2610      </li>
2611  <li>documentation: warning about XML_PARSE_COMPACT (Kasimier Buchcik),
2612      fix xmlXPathCastToString documentation, improve man pages for
2613      xmllitn and xmlcatalog (Daniel Leidert), fixed comments of a few
2614      functions</li>
2615</ul>
2616<h3>2.6.26: Jun 6 2006</h3>
2617<ul>
2618  <li>portability fixes: Python detection (Joseph Sacco), compilation
2619    error(William Brack and Graham Bennett), LynxOS patch (Olli Savia)</li>
2620  <li>bug fixes: encoding buffer problem, mix of code and data in
2621    xmlIO.c(Kjartan Maraas), entities in XSD validation (Kasimier Buchcik),
2622    variousXSD validation fixes (Kasimier), memory leak in pattern (Rob
2623    Richards andKasimier), attribute with colon in name (Rob Richards), XPath
2624    leak inerror reporting (Aleksey Sanin), XInclude text include of
2625    selfdocument.</li>
2626  <li>improvements: Xpath optimizations (Kasimier), XPath object
2627    cache(Kasimier)</li>
2628</ul>
2629
2630<h3>2.6.25: Jun 6 2006:</h3>
2631
2632<p>Do not use or package 2.6.25</p>
2633
2634<h3>2.6.24: Apr 28 2006</h3>
2635<ul>
2636  <li>Portability fixes: configure on Windows, testapi compile on windows
2637      (Kasimier Buchcik, venkat naidu), Borland C++ 6 compile (Eric Zurcher),
2638      HP-UX compiler workaround (Rick Jones), xml2-config bugfix, gcc-4.1
2639      cleanups, Python detection scheme (Joseph Sacco), UTF-8 file paths on
2640      Windows (Roland Schwingel).
2641      </li>
2642  <li>Improvements: xmlDOMWrapReconcileNamespaces xmlDOMWrapCloneNode (Kasimier
2643      Buchcik), XML catalog debugging (Rick Jones), update to Unicode 4.01.</li>
2644  <li>Bug fixes: xmlParseChunk() problem in 2.6.23, xmlParseInNodeContext()
2645      on HTML docs, URI behaviour on Windows (Rob Richards), comment streaming
2646      bug, xmlParseComment (with William Brack), regexp bug fixes (DV &amp;
2647      Youri Golovanov), xmlGetNodePath on text/CDATA (Kasimier),
2648      one Relax-NG interleave bug, xmllint --path and --valid,
2649      XSD bugfixes (Kasimier), remove debug
2650      left in Python bindings (Nic Ferrier), xmlCatalogAdd bug (Martin Cole),
2651      xmlSetProp fixes (Rob Richards), HTML IDness (Rob Richards), a large
2652      number of cleanups and small fixes based on Coverity reports, bug
2653      in character ranges, Unicode tables const (Aivars Kalvans), schemas
2654      fix (Stefan Kost), xmlRelaxNGParse error deallocation,
2655      xmlSchemaAddSchemaDoc error deallocation, error handling on unallowed
2656      code point, ixmllint --nonet to never reach the net (Gary Coady),
2657      line break in writer after end PI (Jason Viers). </li>
2658  <li>Documentation: man pages updates and cleanups (Daniel Leidert).</li>
2659  <li>New features: Relax NG structure error handlers.</li>
2660</ul>
2661
2662<h3>2.6.23: Jan 5 2006</h3>
2663<ul>
2664  <li>portability fixes: Windows (Rob Richards), getaddrinfo on Windows
2665    (Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas),
2666    --with-minimum compilation fixes (William Brack), error case handling fix
2667    on Solaris (Albert Chin), don't use 'list' as parameter name reported by
2668    Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin),
2669    MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick
2670  Jones),</li>
2671  <li>code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose
2672    (Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring
2673    parsing code (Bjorn Reese)</li>
2674  <li>bug fixes: xmlBuildRelativeURI and empty path (William Brack),
2675    combinatory explosion and performances in regexp code, leak in
2676    xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo
2677    Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik),
2678    XPath pattern based evaluation bugs (DV &amp; Kasimier),
2679    xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in
2680    xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of
2681    vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF
2682    split problem (William), issues with non-namespaced attributes in
2683    xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards),
2684    HTML parsing of script, Python must not output to stdout (Nic Ferrier),
2685    exclusive C14N namespace visibility (Aleksey Sanin), XSD datatype
2686    totalDigits bug (Kasimier Buchcik), error handling when writing to an
2687    xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi
2688    Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix
2689    XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier),
2690    fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml
2691    (Gary Coady), regexp bug affecting schemas (Kasimier), configuration of
2692    runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs
2693    (Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair),
2694    compilation and build fixes (Michael Day), removed dependencies on
2695    xmlSchemaValidError (Kasimier), bug with &lt;xml:foo/&gt;, more XPath
2696    pattern based evaluation fixes (Kasimier)</li>
2697  <li>improvements: XSD Schemas redefinitions/restrictions (Kasimier
2698    Buchcik), node copy checks and fix for attribute (Rob Richards), counted
2699    transition bug in regexps, ctxt-&gt;standalone = -2 to indicate no
2700    standalone attribute was found, add xmlSchemaSetParserStructuredErrors()
2701    (Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API
2702    (Kasimier), handle gzipped HTTP resources (Gary Coady), add
2703    htmlDocDumpMemoryFormat. (Rob Richards),</li>
2704  <li>documentation: typo (Michael Day), libxml man page (Albert Chin), save
2705    function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik),</li>
2706</ul>
2707
2708<h3>2.6.22: Sep 12 2005</h3>
2709<ul>
2710  <li>build fixes: compile without schematron (Stéphane Bidoul)</li>
2711  <li>bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i,
2712    CDATA push parser bug, xmlElemDump problem with XHTML1 doc,
2713    XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some
2714    output formatting for meta element (Rob Richards), script and style
2715    XHTML1 serialization (David Madore), Attribute derivation fixups in XSD
2716    (Kasimier Buchcik), better IDC error reports (Kasimier Buchcik)</li>
2717  <li>improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add
2718    XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for
2719    derive (Kasimier Buchcik).</li>
2720  <li>documentation: generation of gtk-doc like docs, integration with
2721    devhelp.</li>
2722</ul>
2723
2724<h3>2.6.21: Sep 4 2005</h3>
2725<ul>
2726  <li>build fixes: Cygwin portability fixes (Gerrit P. Haase), calling
2727    convention problems on Windows (Marcus Boerger), cleanups based on Linus'
2728    sparse tool, update of win32/configure.js (Rob Richards), remove warnings
2729    on Windows(Marcus Boerger), compilation without SAX1, detection of the
2730    Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko),
2731    compilation/link with threads and old gcc, compile problem by C370 on
2732    Z/OS,</li>
2733  <li>bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8
2734    bug (Jiri Netolicky), XPath NaN compare bug (William Brack),
2735    htmlParseScript potential bug, Schemas regexp handling of spaces, Base64
2736    Schemas comparisons NIST passes, automata build error xsd:all,
2737    xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas
2738    foreign namespaces handling, XML Schemas facet comparison (Kupriyanov
2739    Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
2740    namespace ahndling in Schemas (Kasimier), empty model group in Schemas
2741    (Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
2742    xs:anyType in Schemas (Kasimier), Python resolver emitting error
2743    messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
2744    fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
2745    Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
2746    serialization, streaming XPath, Schemas determinism detection problem,
2747    XInclude bug, Schemas context type (Dean Hill), validation fix (Derek
2748    Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas
2749    type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling,
2750    xmlGetLineNo fixes, bug on entities handling, entity name extraction in
2751    error handling with XInclude, text nodes in HTML body tags (Gary Coady),
2752    xml:id and IDness at the treee level fixes, XPath streaming patterns
2753  bugs.</li>
2754  <li>improvements: structured interfaces for schemas and RNG error reports
2755    (Marcus Boerger), optimization of the char data inner loop parsing
2756    (thanks to Behdad Esfahbod for the idea), schematron validation though
2757    not finished yet, xmlSaveOption to omit XML declaration, keyref match
2758    error reports (Kasimier), formal expression handling code not plugged
2759    yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option
2760    for text nodes allocation.</li>
2761  <li>documentation: xmllint man page had --nonet duplicated</li>
2762</ul>
2763
2764<h3>2.6.20: Jul 10 2005</h3>
2765<ul>
2766  <li>build fixes: Windows build (Rob Richards), Mingw compilation (Igor
2767    Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
2768    andriy@google.com), use gcc weak references to pthread to avoid the
2769    pthread dependency on Linux, compilation problem (Steve Nairn), compiling
2770    of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
2771    compilation when disabling parts of the library, standalone test
2772    distribution.</li>
2773  <li>bug fixes: bug in lang(), memory cleanup on errors (William Brack),
2774    HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer
2775    overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup
2776    (Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch
2777    (Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup
2778    on XInclude (William), pattern fixes (William), attribute bug in
2779    exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob
2780    Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type
2781    QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug
2782    (Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob
2783    Richards), a small RelaxNG leak, HTML parsing in push mode bug (James
2784    Bursa), failure to detect UTF-8 parsing bugs in CDATA sections,
2785    areBlanks() heuristic failure, duplicate attributes in DTD bug
2786  (William).</li>
2787  <li>improvements: lot of work on Schemas by Kasimier Buchcik both on
2788    conformance and streaming, Schemas validation messages (Kasimier Buchcik,
2789    Matthew Burgess), namespace removal at the python level (Brent
2790    Hendricks), Update to new Schemas regression tests from W3C/Nist
2791    (Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of
2792    xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert),
2793    standalone test framework and programs, new DOM import APIs
2794    xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and
2795    xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and
2796    Schemas regression tests, xmlStopParser() available in pull mode too,
2797    ienhancement to xmllint --shell namespaces support, Windows port of the
2798    standalone testing tools (Kasimier and William),
2799    xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX
2800    Schemas APIs, Schemas xmlReader support.</li>
2801</ul>
2802
2803<h3>2.6.19: Apr 02 2005</h3>
2804<ul>
2805  <li>build fixes: drop .la from RPMs, --with-minimum build fix (William
2806    Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX
2807    5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on
2808    Linux/ELF/gcc4</li>
2809  <li>bug fixes: schemas type decimal fixups (William Brack), xmmlint return
2810    code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
2811    Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
2812    segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
2813    (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
2814    HTML serialization of name attribute on a elements, Python error handlers
2815    leaks and improvement (Brent Hendricks), uninitialized variable in
2816    encoding code, Relax-NG validation bug, potential crash if
2817    gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures,
2818    switched back to assuming UTF-8 in case no encoding is given at
2819    serialization time</li>
2820  <li>improvements: lot of work on Schemas by Kasimier Buchcik on facets
2821    checking and also mixed handling.</li>
2822  <li></li>
2823</ul>
2824
2825<h3>2.6.18: Mar 13 2005</h3>
2826<ul>
2827  <li>build fixes: warnings (Peter Breitenlohner), testapi.c generation,
2828    Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
2829    some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li>
2830  <li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
2831    xmlreader stopping on non-fatal errors, thread support for dictionaries
2832    reference counting (Gary Coady), internal subset and push problem, URL
2833    saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
2834    fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
2835    (Mike Hommey), warning should not count as error (William Brack),
2836    xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup
2837    FTP and HTTP code to reuse the uri parsing and IPv6 (William),
2838    xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being
2839    empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows
2840    (Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent
2841    Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug
2842    (Rob Richards), Schemas decimal type fixes (William Brack),
2843    xmlByteConsumed static buffer (Ben Maurer).</li>
2844  <li>improvement: speedup parsing comments and DTDs, dictionary support for
2845    hash tables, Schemas Identity constraints (Kasimier), streaming XPath
2846    subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical
2847    values handling (Kasimier), add xmlTextReaderByteConsumed (Aron
2848  Stansvik),</li>
2849  <li>Documentation: Wiki support (Joel Reed)</li>
2850</ul>
2851
2852<h3>2.6.17: Jan 16 2005</h3>
2853<ul>
2854  <li>build fixes: Windows, warnings removal (William Brack),
2855    maintainer-clean dependency(William), build in a different directory
2856    (William), fixing --with-minimum configure build (William), BeOS build
2857    (Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan
2858    McNichol)</li>
2859  <li>bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile()
2860    to use the catalog(s), loop on output (William Brack), XPath memory leak,
2861    ID deallocation problem (Steve Shepard), debugDumpNode crash (William),
2862    warning not using error callback (William), xmlStopParser bug (William),
2863    UTF-16 with BOM on DTDs (William), namespace bug on empty elements in
2864    push mode (Rob Richards), line and col computations fixups (Aleksey
2865    Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William),
2866    patterns with too many steps, bug in RNG choice optimization, line number
2867    sometimes missing.</li>
2868  <li>improvements: XSD Schemas (Kasimier Buchcik), python generator
2869    (William), xmlUTF8Strpos speedup (William), unicode Python strings
2870    (William), XSD error reports (Kasimier Buchcik), Python __str__ call
2871    serialize().</li>
2872  <li>new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for
2873    the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel
2874    Reed), error extraction API from regexps, new XMLSave option for format
2875    (Phil Shafer)</li>
2876  <li>documentation: site improvement (John Fleck), FAQ entries
2877  (William).</li>
2878</ul>
2879
2880<h3>2.6.16: Nov 10 2004</h3>
2881<ul>
2882  <li>general hardening and bug fixing crossing all the API based on new
2883    automated regression testing</li>
2884  <li>build fix: IPv6 build and test on AIX (Dodji Seketeli)</li>
2885  <li>bug fixes: problem with XML::Libxml reported by Petr Pajas,  encoding
2886    conversion functions return values, UTF-8 bug affecting XPath reported by
2887    Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
2888  <li>documentation: fix to xmllint man page, some API function description
2889    were updated.</li>
2890  <li>improvements: DTD validation APIs provided at the Python level (Brent
2891    Hendricks)</li>
2892</ul>
2893
2894<h3>2.6.15: Oct 27 2004</h3>
2895<ul>
2896  <li>security fixes on the nanoftp and nanohttp modules</li>
2897  <li>build fixes: xmllint detection bug in configure, building outside the
2898    source tree (Thomas Fitzsimmons)</li>
2899  <li>bug fixes: HTML parser on broken ASCII chars in names (William), Python
2900    paths (Malcolm Tredinnick), xmlHasNsProp and default namespace (William),
2901    saving to python file objects (Malcolm Tredinnick), DTD lookup fix
2902    (Malcolm), save back &lt;group&gt; in catalogs (William), tree build
2903    fixes (DV and Rob Richards), Schemas memory bug, structured error handler
2904    on Python 64bits, thread local memory deallocation, memory leak reported
2905    by Volker Roth, xmlValidateDtd in the presence of an internal subset,
2906    entities and _private problem (William), xmlBuildRelativeURI error
2907    (William).</li>
2908  <li>improvements: better XInclude error reports (William), tree debugging
2909    module and tests, convenience functions at the Reader API (Graham
2910    Bennett), add support for PI in the HTML parser.</li>
2911</ul>
2912
2913<h3>2.6.14: Sep 29 2004</h3>
2914<ul>
2915  <li>build fixes: configure paths for xmllint and xsltproc, compilation
2916    without HTML parser, compilation warning cleanups (William Brack &amp;
2917    Malcolm Tredinnick), VMS makefile update (Craig Berry),</li>
2918  <li>bug fixes: xmlGetUTF8Char (William Brack), QName properties (Kasimier
2919    Buchcik), XInclude testing, Notation serialization, UTF8ToISO8859x
2920    transcoding (Mark Itzcovitz), lots of XML Schemas cleanup and fixes
2921    (Kasimier), ChangeLog cleanup (Stepan Kasal), memory fixes (Mark Vakoc),
2922    handling of failed realloc(), out of bound array addressing in Schemas
2923    date handling, Python space/tabs cleanups (Malcolm Tredinnick), NMTOKENS
2924    E20 validation fix (Malcolm),</li>
2925  <li>improvements: added W3C XML Schemas testsuite (Kasimier Buchcik), add
2926    xmlSchemaValidateOneElement (Kasimier), Python exception hierearchy
2927    (Malcolm Tredinnick), Python libxml2 driver improvement (Malcolm
2928    Tredinnick), Schemas support for xsi:schemaLocation,
2929    xsi:noNamespaceSchemaLocation, xsi:type (Kasimier Buchcik)</li>
2930</ul>
2931
2932<h3>2.6.13: Aug 31 2004</h3>
2933<ul>
2934  <li>build fixes: Windows and zlib (Igor Zlatkovic), -O flag with gcc,
2935    Solaris compiler warning, fixing RPM BuildRequires,</li>
2936  <li>fixes: DTD loading on Windows (Igor), Schemas error reports APIs
2937    (Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 (William Brack
2938    and Julius Mittenzwei), Schemas facet check (Kasimier), default namespace
2939    problem (William), Schemas hexbinary empty values, encoding error could
2940    generate a serialization loop.</li>
2941  <li>Improvements: Schemas validity improvements (Kasimier), added --path
2942    and --load-trace options to xmllint</li>
2943  <li>documentation: tutorial update (John Fleck)</li>
2944</ul>
2945
2946<h3>2.6.12: Aug 22 2004</h3>
2947<ul>
2948  <li>build fixes: fix --with-minimum, elfgcchack.h fixes (Peter
2949    Breitenlohner), perl path lookup (William), diff on Solaris (Albert
2950    Chin), some 64bits cleanups.</li>
2951  <li>Python: avoid a warning with 2.3 (William Brack), tab and space mixes
2952    (William), wrapper generator fixes (William), Cygwin support (Gerrit P.
2953    Haase), node wrapper fix (Marc-Antoine Parent), XML Schemas support
2954    (Torkel Lyng)</li>
2955  <li>Schemas: a lot of bug fixes and improvements from Kasimier Buchcik</li>
2956  <li>fixes: RVT fixes (William), XPath context resets bug (William), memory
2957    debug (Steve Hay), catalog white space handling (Peter Breitenlohner),
2958    xmlReader state after attribute reading (William), structured error
2959    handler (William), XInclude generated xml:base fixup (William), Windows
2960    memory reallocation problem (Steve Hay), Out of Memory conditions
2961    handling (William and Olivier Andrieu), htmlNewDoc() charset bug,
2962    htmlReadMemory init (William), a posteriori validation DTD base
2963    (William), notations serialization missing, xmlGetNodePath (Dodji),
2964    xmlCheckUTF8 (Diego Tartara), missing line numbers on entity
2965  (William)</li>
2966  <li>improvements: DocBook catalog build scrip (William), xmlcatalog tool
2967    (Albert Chin), xmllint --c14n option, no_proxy environment (Mike Hommey),
2968    xmlParseInNodeContext() addition, extend xmllint --shell, allow XInclude
2969    to not generate start/end nodes, extend xmllint --version to include CVS
2970    tag (William)</li>
2971  <li>documentation: web pages fixes, validity API docs fixes (William)
2972    schemas API fix (Eric Haszlakiewicz), xmllint man page (John Fleck)</li>
2973</ul>
2974
2975<h3>2.6.11: July 5 2004</h3>
2976<ul>
2977  <li>Schemas: a lot of changes and improvements by Kasimier Buchcik for
2978    attributes, namespaces and simple types.</li>
2979  <li>build fixes: --with-minimum (William Brack),  some gcc cleanup
2980    (William), --with-thread-alloc (William)</li>
2981  <li>portability: Windows binary package change (Igor Zlatkovic), Catalog
2982    path on Windows</li>
2983  <li>documentation: update to the tutorial (John Fleck), xmllint return code
2984    (John Fleck), man pages (Ville Skytta),</li>
2985  <li>bug fixes: C14N bug serializing namespaces (Aleksey Sanin), testSAX
2986    properly initialize the library (William), empty node set in XPath
2987    (William), xmlSchemas errors (William), invalid charref problem pointed
2988    by Morus Walter, XInclude xml:base generation (William), Relax-NG bug
2989    with div processing (William), XPointer and xml:base problem(William),
2990    Reader and entities, xmllint return code for schemas (William), reader
2991    streaming problem (Steve Ball), DTD serialization problem (William),
2992    libxml.m4 fixes (Mike Hommey), do not provide destructors as methods on
2993    Python classes, xmlReader buffer bug, Python bindings memory interfaces
2994    improvement (with Stéphane Bidoul), Fixed the push parser to be back to
2995    synchronous behaviour.</li>
2996  <li>improvement: custom per-thread I/O enhancement (Rob Richards), register
2997    namespace in debug shell (Stefano Debenedetti), Python based regression
2998    test for non-Unix users (William), dynamically increase the number of
2999    XPath extension functions in Python and fix a memory leak (Marc-Antoine
3000    Parent and William)</li>
3001  <li>performance: hack done with Arjan van de Ven to reduce ELF footprint
3002    and generated code on Linux, plus use gcc runtime profiling to optimize
3003    the code generated in the RPM packages.</li>
3004</ul>
3005
3006<h3>2.6.10: May 17 2004</h3>
3007<ul>
3008  <li>Web page generated for ChangeLog</li>
3009  <li>build fixes: --without-html problems, make check without make all</li>
3010  <li>portability: problem with xpath.c on Windows (MSC and Borland), memcmp
3011    vs. strncmp on Solaris, XPath tests on Windows (Mark Vakoc), C++ do not
3012    use "list" as parameter name, make tests work with Python 1.5 (Ed
3013  Davis),</li>
3014  <li>improvements: made xmlTextReaderMode public, small buffers resizing
3015    (Morten Welinder), add --maxmem option to xmllint, add
3016    xmlPopInputCallback() for Matt Sergeant, refactoring of serialization
3017    escaping, added escaping customization</li>
3018  <li>bugfixes: xsd:extension (Taihei Goi), assorted regexp bugs (William
3019    Brack), xmlReader end of stream problem, node deregistration with reader,
3020    URI escaping and filemanes,  XHTML1 formatting (Nick Wellnhofer), regexp
3021    transition reduction (William), various XSD Schemas fixes (Kasimier
3022    Buchcik), XInclude fallback problem (William), weird problems with DTD
3023    (William), structured error handler callback context (William), reverse
3024    xmlEncodeSpecialChars() behaviour back to escaping '"'</li>
3025</ul>
3026
3027<h3>2.6.9: Apr 18 2004</h3>
3028<ul>
3029  <li>implement xml:id Working Draft, relaxed XPath id() checking</li>
3030  <li>bugfixes: xmlCtxtReset (Brent Hendricks), line number and CDATA (Dave
3031    Beckett), Relax-NG compilation (William Brack), Regexp patches (with
3032    William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
3033    William), Relax-NG name classes compares (William), XInclude duplicate
3034    fallback (William), external DTD encoding detection (William), a DTD
3035    validation bug (William), xmlReader Close() fix, recursive extension
3036    schemas</li>
3037  <li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
3038    save optimization, better handle IIS broken HTTP redirect  behaviour (Ian
3039    Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
3040    dependency, XML Schemas union support (Kasimier Buchcik), warning removal
3041    clanup (William), keep ChangeLog compressed when installing from RPMs</li>
3042  <li>documentation: examples and xmlDocDumpMemory docs (John Fleck), new
3043    example (load, xpath, modify, save), xmlCatalogDump() comments,</li>
3044  <li>Windows: Borland C++ builder (Eric Zurcher), work around Microsoft
3045    compiler NaN handling bug (Mark Vakoc)</li>
3046</ul>
3047
3048<h3>2.6.8: Mar 23 2004</h3>
3049<ul>
3050  <li>First step of the cleanup of the serialization code and APIs</li>
3051  <li>XML Schemas: mixed content (Adam Dickmeiss), QName handling fixes (Adam
3052    Dickmeiss), anyURI for "" (John Belmonte)</li>
3053  <li>Python: Canonicalization C14N support added (Anthony Carrico)</li>
3054  <li>xmlDocCopyNode() extension (William)</li>
3055  <li>Relax-NG: fix when processing XInclude results (William), external
3056    reference in interleave (William), missing error on &lt;choice&gt;
3057    failure (William), memory leak in schemas datatype facets.</li>
3058  <li>xmlWriter: patch for better DTD support (Alfred Mickautsch)</li>
3059  <li>bug fixes: xmlXPathLangFunction memory leak (Mike Hommey and William
3060    Brack), no ID errors if using HTML_PARSE_NOERROR, xmlcatalog fallbacks to
3061    URI on SYSTEM lookup failure, XInclude parse flags inheritance (William),
3062    XInclude and XPointer fixes for entities (William), XML parser bug
3063    reported by Holger Rauch, nanohttp fd leak (William),  regexps char
3064    groups '-' handling (William), dictionary reference counting problems,
3065    do not close stderr.</li>
3066  <li>performance patches from Petr Pajas</li>
3067  <li>Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)</li>
3068  <li>compilation and portability fixes: --without-valid, catalog cleanups
3069    (Peter Breitenlohner), MingW patch (Roland Schwingel), cross-compilation
3070    to Windows (Christophe de Vienne),  --with-html-dir fixup (Julio Merino
3071    Vidal), Windows build (Eric Zurcher)</li>
3072</ul>
3073
3074<h3>2.6.7: Feb 23 2004</h3>
3075<ul>
3076  <li>documentation: tutorial updates (John Fleck), benchmark results</li>
3077  <li>xmlWriter: updates and fixes (Alfred Mickautsch, Lucas Brasilino)</li>
3078  <li>XPath optimization (Petr Pajas)</li>
3079  <li>DTD ID handling optimization</li>
3080  <li>bugfixes: xpath number with  &gt; 19 fractional (William Brack), push
3081    mode with unescaped '&gt;' characters, fix xmllint --stream --timing, fix
3082    xmllint --memory --stream memory usage, xmlAttrSerializeTxtContent
3083    handling NULL, trying to fix Relax-NG/Perl interface.</li>
3084  <li>python: 2.3 compatibility, whitespace fixes (Malcolm Tredinnick)</li>
3085  <li>Added relaxng option to xmllint --shell</li>
3086</ul>
3087
3088<h3>2.6.6: Feb 12 2004</h3>
3089<ul>
3090  <li>nanohttp and nanoftp: buffer overflow error on URI parsing (Igor and
3091    William) reported by Yuuichi Teranishi</li>
3092  <li>bugfixes: make test and path issues, xmlWriter attribute serialization
3093    (William Brack), xmlWriter indentation (William), schemas validation
3094    (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
3095    Paraschenko), XInclude empty fallback (William), HTML warnings (William),
3096    XPointer in XInclude (William), Python namespace serialization,
3097    isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
3098    entities in internal subset (William), internal subset bug in push mode,
3099    &lt;xs:all&gt; fix (Alexey Sarytchev)</li>
3100  <li>Build: fix for automake-1.8 (Alexander Winston), warnings removal
3101    (Philip Ludlam), SOCKLEN_T detection fixes (Daniel Richard), fix
3102    --with-minimum configuration.</li>
3103  <li>XInclude: allow the 2001 namespace without warning.</li>
3104  <li>Documentation: missing example/index.html (John Fleck), version
3105    dependencies (John Fleck)</li>
3106  <li>reader API: structured error reporting (Steve Ball)</li>
3107  <li>Windows compilation: mingw, msys (Mikhail Grushinskiy), function
3108    prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
3109  patch</li>
3110  <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
3111    input.</li>
3112</ul>
3113
3114<h3>2.6.5: Jan 25 2004</h3>
3115<ul>
3116  <li>Bugfixes: dictionaries for schemas (William Brack), regexp segfault
3117    (William), xs:all problem (William), a number of XPointer bugfixes
3118    (William), xmllint error go to stderr, DTD validation problem with
3119    namespace, memory leak (William), SAX1 cleanup and minimal options fixes
3120    (Mark Vadoc), parser context reset on error (Shaun McCance), XPath union
3121    evaluation problem (William) , xmlReallocLoc with NULL (Aleksey Sanin),
3122    XML Schemas double free (Steve Ball), XInclude with no href, argument
3123    callbacks order for XPath callbacks (Frederic Peters)</li>
3124  <li>Documentation: python scripts (William Brack), xslt stylesheets (John
3125    Fleck), doc (Sven Zimmerman), I/O example.</li>
3126  <li>Python bindings: fixes (William), enum support (Stéphane Bidoul),
3127    structured error reporting (Stéphane Bidoul)</li>
3128  <li>XInclude: various fixes for conformance, problem related to dictionary
3129    references (William &amp; me), recursion (William)</li>
3130  <li>xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred
3131    Mickautsch),</li>
3132  <li>xmlSchemas: normalizedString datatype (John Belmonte)</li>
3133  <li>code cleanup for strings functions (William)</li>
3134  <li>Windows: compiler patches (Mark Vakoc)</li>
3135  <li>Parser optimizations, a few new XPath and dictionary APIs for future
3136    XSLT optimizations.</li>
3137</ul>
3138
3139<h3>2.6.4: Dec 24 2003</h3>
3140<ul>
3141  <li>Windows build fixes (Igor Zlatkovic)</li>
3142  <li>Some serious XInclude problems reported by Oleg Paraschenko and</li>
3143  <li>Unix and Makefile packaging fixes (me, William Brack,</li>
3144  <li>Documentation improvements (John Fleck, William Brack), example fix
3145    (Lucas Brasilino)</li>
3146  <li>bugfixes: xmlTextReaderExpand() with xmlReaderWalker, XPath handling of
3147    NULL strings (William Brack) , API building reader or parser from
3148    filedescriptor should not close it, changed XPath sorting to be stable
3149    again (William Brack), xmlGetNodePath() generating '(null)' (William
3150    Brack), DTD validation and namespace bug (William Brack), XML Schemas
3151    double inclusion behaviour</li>
3152</ul>
3153
3154<h3>2.6.3: Dec 10 2003</h3>
3155<ul>
3156  <li>documentation updates and cleanup (DV, William Brack, John Fleck)</li>
3157  <li>added a repository of examples, examples from Aleksey Sanin, Dodji
3158    Seketeli, Alfred Mickautsch</li>
3159  <li>Windows updates: Mark Vakoc, Igor Zlatkovic, Eric Zurcher, Mingw
3160    (Kenneth Haley)</li>
3161  <li>Unicode range checking (William Brack)</li>
3162  <li>code cleanup (William Brack)</li>
3163  <li>Python bindings: doc (John Fleck),  bug fixes</li>
3164  <li>UTF-16 cleanup and BOM issues (William Brack)</li>
3165  <li>bug fixes: ID and xmlReader validation, XPath (William Brack),
3166    xmlWriter (Alfred Mickautsch), hash.h inclusion problem, HTML parser
3167    (James Bursa), attribute defaulting and validation, some serialization
3168    cleanups, XML_GET_LINE macro, memory debug when using threads (William
3169    Brack), serialization of attributes and entities content, xmlWriter
3170    (Daniel Schulman)</li>
3171  <li>XInclude bugfix, new APIs and update to the last version including the
3172    namespace change.</li>
3173  <li>XML Schemas improvements: include (Robert Stepanek), import and
3174    namespace handling, fixed the regression tests troubles, added examples
3175    based on Eric van der Vlist book, regexp fixes</li>
3176  <li>preliminary pattern support for streaming (needed for schemas
3177    constraints), added xmlTextReaderPreservePattern() to collect subdocument
3178    when streaming.</li>
3179  <li>various fixes in the structured error handling</li>
3180</ul>
3181
3182<h3>2.6.2: Nov 4 2003</h3>
3183<ul>
3184  <li>XPath context unregistration fixes</li>
3185  <li>text node coalescing fixes (Mark Lilback)</li>
3186  <li>API to screate a W3C Schemas from an existing document (Steve Ball)</li>
3187  <li>BeOS patches (Marcin 'Shard' Konicki)</li>
3188  <li>xmlStrVPrintf function added (Aleksey Sanin)</li>
3189  <li>compilation fixes (Mark Vakoc)</li>
3190  <li>stdin parsing fix (William Brack)</li>
3191  <li>a posteriori DTD validation fixes</li>
3192  <li>xmlReader bug fixes: Walker fixes, python bindings</li>
3193  <li>fixed xmlStopParser() to really stop the parser and errors</li>
3194  <li>always generate line numbers when using the new xmlReadxxx
3195  functions</li>
3196  <li>added XInclude support to the xmlReader interface</li>
3197  <li>implemented XML_PARSE_NONET parser option</li>
3198  <li>DocBook XSLT processing bug fixed</li>
3199  <li>HTML serialization for &lt;p&gt; elements (William Brack and me)</li>
3200  <li>XPointer failure in XInclude are now handled as resource errors</li>
3201  <li>fixed xmllint --html to use the HTML serializer on output (added
3202    --xmlout to implement the previous behaviour of saving it using the XML
3203    serializer)</li>
3204</ul>
3205
3206<h3>2.6.1: Oct 28 2003</h3>
3207<ul>
3208  <li>Mostly bugfixes after the big 2.6.0 changes</li>
3209  <li>Unix compilation patches: libxml.m4 (Patrick Welche), warnings cleanup
3210    (William Brack)</li>
3211  <li>Windows compilation patches (Joachim Bauch, Stephane Bidoul, Igor
3212    Zlatkovic)</li>
3213  <li>xmlWriter bugfix (Alfred Mickautsch)</li>
3214  <li>chvalid.[ch]: couple of fixes from Stephane Bidoul</li>
3215  <li>context reset: error state reset, push parser reset (Graham
3216  Bennett)</li>
3217  <li>context reuse: generate errors if file is not readable</li>
3218  <li>defaulted attributes for element coming from internal entities
3219    (Stephane Bidoul)</li>
3220  <li>Python: tab and spaces mix (William Brack)</li>
3221  <li>Error handler could crash in DTD validation in 2.6.0</li>
3222  <li>xmlReader: do not use the document or element _private field</li>
3223  <li>testSAX.c: avoid a problem with some PIs (Massimo Morara)</li>
3224  <li>general bug fixes: mandatory encoding in text decl, serializing
3225    Document Fragment nodes, xmlSearchNs 2.6.0 problem (Kasimier Buchcik),
3226    XPath errors not reported,  slow HTML parsing of large documents.</li>
3227</ul>
3228
3229<h3>2.6.0: Oct 20 2003</h3>
3230<ul>
3231  <li>Major revision release: should be API and ABI compatible but got a lot
3232    of change</li>
3233  <li>Increased the library modularity, far more options can be stripped out,
3234    a --with-minimum configuration will weight around 160KBytes</li>
3235  <li>Use per parser and per document dictionary, allocate names and small
3236    text nodes from the dictionary</li>
3237  <li>Switch to a SAX2 like parser rewrote most of the XML parser core,
3238    provides namespace resolution and defaulted attributes, minimize memory
3239    allocations and copies, namespace checking and specific error handling,
3240    immutable buffers, make predefined entities static structures, etc...</li>
3241  <li>rewrote all the error handling in the library, all errors can be
3242    intercepted at a structured level, with precise information
3243  available.</li>
3244  <li>New simpler and more generic XML and HTML parser APIs, allowing to
3245    easily modify the parsing options and reuse parser context for multiple
3246    consecutive documents.</li>
3247  <li>Similar new APIs for the xmlReader, for options and reuse, provided new
3248    functions to access content as const strings, use them for Python
3249  bindings</li>
3250  <li>a  lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
3251    Walker i.e. reader on a document tree based on Alfred Mickautsch code,
3252    make room in nodes for line numbers, reference counting and future PSVI
3253    extensions, generation of character ranges to be checked with faster
3254    algorithm (William),  xmlParserMaxDepth (Crutcher Dunnavant), buffer
3255    access</li>
3256  <li>New xmlWriter API provided by Alfred Mickautsch</li>
3257  <li>Schemas: base64 support by Anthony Carrico</li>
3258  <li>Parser&lt;-&gt;HTTP integration fix, proper processing of the Mime-Type
3259    and charset information if available.</li>
3260  <li>Relax-NG: bug fixes including the one reported by Martijn Faassen and
3261    zeroOrMore, better error reporting.</li>
3262  <li>Python bindings (Stéphane Bidoul), never use stdout for errors
3263  output</li>
3264  <li>Portability: all the headers have macros for export and calling
3265    convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
3266    Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher,  Igor),
3267    Mingw (Igor), typos (Mark Vakoc),  beta version (Stephane Bidoul),
3268    warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
3269    'Shard' Konicki)</li>
3270  <li>Documentation fixes and README (William Brack), search fix (William),
3271    tutorial updates (John Fleck), namespace docs (Stefan Kost)</li>
3272  <li>Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
3273    mutexes, HTML doctype lowercase,  SAX/IO (William), compression detection
3274    and restore (William), attribute declaration in DTDs (William), namespace
3275    on attribute in HTML output (William), input filename (Rob Richards),
3276    namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
3277    (Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
3278    Derr), high codepoint charref like &amp;#x10FFFF;, buffer access in push
3279    mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
3280    (William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
3281    error handling.</li>
3282  <li>xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
3283    testing,  --nodict for building without tree dictionary, --nocdata to
3284    replace CDATA by text, --nsclean to remove surperfluous  namespace
3285    declarations</li>
3286  <li>added xml2-config --libtool-libs option from Kevin P. Fleming</li>
3287  <li>a lot of profiling and tuning of the code, speedup patch for
3288    xmlSearchNs() by Luca Padovani. The xmlReader should do far less
3289    allocation and it speed should get closer to SAX. Chris Anderson worked
3290    on speeding and cleaning up repetitive checking code.</li>
3291  <li>cleanup of "make tests"</li>
3292  <li>libxml-2.0-uninstalled.pc from Malcolm Tredinnick</li>
3293  <li>deactivated the broken docBook SGML parser code and plugged the XML
3294    parser instead.</li>
3295</ul>
3296
3297<h3>2.5.11: Sep 9 2003</h3>
3298
3299<p>A bugfix only release:</p>
3300<ul>
3301  <li>risk of crash in Relax-NG</li>
3302  <li>risk of crash when using multithreaded programs</li>
3303</ul>
3304
3305<h3>2.5.10: Aug 15 2003</h3>
3306
3307<p>A bugfixes only release</p>
3308<ul>
3309  <li>Windows Makefiles (William Brack)</li>
3310  <li>UTF-16 support fixes (Mark Itzcovitz)</li>
3311  <li>Makefile and portability (William Brack) automake, Linux alpha, Mingw
3312    on Windows (Mikhail Grushinskiy)</li>
3313  <li>HTML parser (Oliver Stoeneberg)</li>
3314  <li>XInclude performance problem reported by Kevin Ruscoe</li>
3315  <li>XML parser performance problem reported by Grant Goodale</li>
3316  <li>xmlSAXParseDTD() bug fix from Malcolm Tredinnick</li>
3317  <li>and a couple other cleanup</li>
3318</ul>
3319
3320<h3>2.5.9: Aug 9 2003</h3>
3321<ul>
3322  <li>bugfixes: IPv6 portability, xmlHasNsProp (Markus Keim), Windows build
3323    (Wiliam Brake, Jesse Pelton, Igor), Schemas (Peter Sobisch), threading
3324    (Rob Richards), hexBinary type (), UTF-16 BOM (Dodji Seketeli),
3325    xmlReader, Relax-NG schemas compilation, namespace handling,  EXSLT (Sean
3326    Griffin), HTML parsing problem (William Brack), DTD validation for mixed
3327    content + namespaces, HTML serialization, library initialization,
3328    progressive HTML parser</li>
3329  <li>better interfaces for Relax-NG error handling (Joachim Bauch, )</li>
3330  <li>adding xmlXIncludeProcessTree() for XInclud'ing in a subtree</li>
3331  <li>doc fixes and improvements (John Fleck)</li>
3332  <li>configure flag for -with-fexceptions when embedding in C++</li>
3333  <li>couple of new UTF-8 helper functions (William Brack)</li>
3334  <li>general encoding cleanup + ISO-8859-x without iconv (Peter Jacobi)</li>
3335  <li>xmlTextReader cleanup + enum for node types (Bjorn Reese)</li>
3336  <li>general compilation/warning cleanup Solaris/HP-UX/... (William
3337  Brack)</li>
3338</ul>
3339
3340<h3>2.5.8: Jul 6 2003</h3>
3341<ul>
3342  <li>bugfixes: XPath, XInclude, file/URI mapping, UTF-16 save (Mark
3343    Itzcovitz), UTF-8 checking, URI saving, error printing (William Brack),
3344    PI related memleak, compilation without schemas or without xpath (Joerg
3345    Schmitz-Linneweber/Garry Pennington), xmlUnlinkNode problem with DTDs,
3346    rpm problem on , i86_64, removed a few compilation problems from 2.5.7,
3347    xmlIOParseDTD, and xmlSAXParseDTD (Malcolm Tredinnick)</li>
3348  <li>portability: DJGPP (MsDos) , OpenVMS (Craig A. Berry)</li>
3349  <li>William Brack fixed multithreading lock problems</li>
3350  <li>IPv6 patch for FTP and HTTP accesses (Archana Shah/Wipro)</li>
3351  <li>Windows fixes (Igor Zlatkovic,  Eric Zurcher), threading (Stéphane
3352    Bidoul)</li>
3353  <li>A few W3C Schemas Structure improvements</li>
3354  <li>W3C Schemas Datatype improvements (Charlie Bozeman)</li>
3355  <li>Python bindings for thread globals (Stéphane Bidoul), and method/class
3356    generator</li>
3357  <li>added --nonet option to xmllint</li>
3358  <li>documentation improvements (John Fleck)</li>
3359</ul>
3360
3361<h3>2.5.7: Apr 25 2003</h3>
3362<ul>
3363  <li>Relax-NG: Compiling to regexp and streaming validation on top of the
3364    xmlReader interface, added to xmllint --stream</li>
3365  <li>xmlReader: Expand(), Next() and DOM access glue, bug fixes</li>
3366  <li>Support for large files: RGN validated a 4.5GB instance</li>
3367  <li>Thread support is now configured in by default</li>
3368  <li>Fixes: update of the Trio code (Bjorn), WXS Date and Duration fixes
3369    (Charles Bozeman), DTD and namespaces (Brent Hendricks), HTML push parser
3370    and zero bytes handling, some missing Windows file path conversions,
3371    behaviour of the parser and validator in the presence of "out of memory"
3372    error conditions</li>
3373  <li>extended the API to be able to plug a garbage collecting memory
3374    allocator, added xmlMallocAtomic() and modified the allocations
3375    accordingly.</li>
3376  <li>Performances: removed excessive malloc() calls, speedup of the push and
3377    xmlReader interfaces, removed excessive thread locking</li>
3378  <li>Documentation: man page (John Fleck), xmlReader documentation</li>
3379  <li>Python: adding binding for xmlCatalogAddLocal (Brent M Hendricks)</li>
3380</ul>
3381
3382<h3>2.5.6: Apr 1 2003</h3>
3383<ul>
3384  <li>Fixed W3C XML Schemas datatype, should be compliant now except for
3385    binHex and base64 which are not supported yet.</li>
3386  <li>bug fixes: non-ASCII IDs, HTML output, XInclude on large docs and
3387    XInclude entities handling, encoding detection on external subsets, XML
3388    Schemas bugs and memory leaks, HTML parser (James Bursa)</li>
3389  <li>portability: python/trio (Albert Chin), Sun compiler warnings</li>
3390  <li>documentation: added --relaxng option to xmllint man page (John)</li>
3391  <li>improved error reporting: xml:space, start/end tag mismatches, Relax NG
3392    errors</li>
3393</ul>
3394
3395<h3>2.5.5: Mar 24 2003</h3>
3396<ul>
3397  <li>Lot of fixes on the Relax NG implementation. More testing including
3398    DocBook and TEI examples.</li>
3399  <li>Increased the support for W3C XML Schemas datatype</li>
3400  <li>Several bug fixes in the URI handling layer</li>
3401  <li>Bug fixes: HTML parser, xmlReader, DTD validation, XPath, encoding
3402    conversion, line counting in the parser.</li>
3403  <li>Added support for $XMLLINT_INDENT environment variable, FTP delete</li>
3404  <li>Fixed the RPM spec file name</li>
3405</ul>
3406
3407<h3>2.5.4: Feb 20 2003</h3>
3408<ul>
3409  <li>Conformance testing and lot of fixes on Relax NG and XInclude
3410    implementation</li>
3411  <li>Implementation of XPointer element() scheme</li>
3412  <li>Bug fixes: XML parser, XInclude entities merge, validity checking on
3413    namespaces,
3414    <p>2 serialization bugs, node info generation problems, a DTD regexp
3415    generation problem.</p>
3416  </li>
3417  <li>Portability: windows updates and path canonicalization (Igor)</li>
3418  <li>A few typo fixes (Kjartan Maraas)</li>
3419  <li>Python bindings generator fixes (Stephane Bidoul)</li>
3420</ul>
3421
3422<h3>2.5.3: Feb 10 2003</h3>
3423<ul>
3424  <li>RelaxNG and XML Schemas datatypes improvements, and added a first
3425    version of RelaxNG Python bindings</li>
3426  <li>Fixes: XLink (Sean Chittenden), XInclude (Sean Chittenden), API fix for
3427    serializing namespace nodes, encoding conversion bug, XHTML1
3428  serialization</li>
3429  <li>Portability fixes: Windows (Igor), AMD 64bits RPM spec file</li>
3430</ul>
3431
3432<h3>2.5.2: Feb 5 2003</h3>
3433<ul>
3434  <li>First implementation of RelaxNG, added --relaxng flag to xmllint</li>
3435  <li>Schemas support now compiled in by default.</li>
3436  <li>Bug fixes: DTD validation, namespace checking, XInclude and entities,
3437    delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane Bidoul),
3438    XPath parser and evaluation,  UTF8ToUTF8 serialization, XML reader memory
3439    consumption, HTML parser, HTML serialization in the presence of
3440  namespaces</li>
3441  <li>added an HTML API to check elements and attributes.</li>
3442  <li>Documentation improvement, PDF for the tutorial (John Fleck), doc
3443    patches (Stefan Kost)</li>
3444  <li>Portability fixes: NetBSD (Julio Merino), Windows (Igor Zlatkovic)</li>
3445  <li>Added python bindings for XPointer, contextual error reporting
3446    (Stéphane Bidoul)</li>
3447  <li>URI/file escaping problems (Stefano Zacchiroli)</li>
3448</ul>
3449
3450<h3>2.5.1: Jan 8 2003</h3>
3451<ul>
3452  <li>Fixes a memory leak and configuration/compilation problems in 2.5.0</li>
3453  <li>documentation updates (John)</li>
3454  <li>a couple of XmlTextReader fixes</li>
3455</ul>
3456
3457<h3>2.5.0: Jan 6 2003</h3>
3458<ul>
3459  <li>New <a href="xmlreader.html">XmltextReader interface</a> based on C#
3460    API (with help of Stéphane Bidoul)</li>
3461  <li>Windows: more exports, including the new API (Igor)</li>
3462  <li>XInclude fallback fix</li>
3463  <li>Python: bindings for the new API, packaging (Stéphane Bidoul),
3464    drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, speedup
3465    and iterators for Python-2.2 (Hannu Krosing)</li>
3466  <li>Tutorial fixes (john Fleck and Niraj Tolia) xmllint man update
3467  (John)</li>
3468  <li>Fix an XML parser bug raised by Vyacheslav Pindyura</li>
3469  <li>Fix for VMS serialization (Nigel Hall) and config (Craig A. Berry)</li>
3470  <li>Entities handling fixes</li>
3471  <li>new API to optionally track node creation and deletion (Lukas
3472  Schroeder)</li>
3473  <li>Added documentation for the XmltextReader interface and some <a
3474    href="guidelines.html">XML guidelines</a></li>
3475</ul>
3476
3477<h3>2.4.30: Dec 12 2002</h3>
3478<ul>
3479  <li>2.4.29 broke the python bindings, rereleasing</li>
3480  <li>Improvement/fixes of the XML API generator, and couple of minor code
3481    fixes.</li>
3482</ul>
3483
3484<h3>2.4.29: Dec 11 2002</h3>
3485<ul>
3486  <li>Windows fixes (Igor): Windows CE port, pthread linking, python bindings
3487    (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates</li>
3488  <li>Fix for prev in python bindings (ERDI Gergo)</li>
3489  <li>Fix for entities handling (Marcus Clarke)</li>
3490  <li>Refactored the XML and HTML dumps to a single code path, fixed XHTML1
3491    dump</li>
3492  <li>Fix for URI parsing when handling URNs with fragment identifiers</li>
3493  <li>Fix for HTTP URL escaping problem</li>
3494  <li>added an TextXmlReader (C#) like API (work in progress)</li>
3495  <li>Rewrote the API in XML generation script, includes a C parser and saves
3496    more information needed for C# bindings</li>
3497</ul>
3498
3499<h3>2.4.28: Nov 22 2002</h3>
3500<ul>
3501  <li>a couple of python binding fixes</li>
3502  <li>2 bug fixes in the XML push parser</li>
3503  <li>potential memory leak removed (Martin Stoilov)</li>
3504  <li>fix to the configure script for Unix (Dimitri Papadopoulos)</li>
3505  <li>added encoding support for XInclude parse="text"</li>
3506  <li>autodetection of XHTML1 and specific serialization rules added</li>
3507  <li>nasty threading bug fixed (William Brack)</li>
3508</ul>
3509
3510<h3>2.4.27: Nov 17 2002</h3>
3511<ul>
3512  <li>fixes for the Python bindings</li>
3513  <li>a number of bug fixes: SGML catalogs, xmlParseBalancedChunkMemory(),
3514    HTML parser,  Schemas (Charles Bozeman), document fragment support
3515    (Christian Glahn), xmlReconciliateNs (Brian Stafford), XPointer,
3516    xmlFreeNode(), xmlSAXParseMemory (Peter Jones), xmlGetNodePath (Petr
3517    Pajas), entities processing</li>
3518  <li>added grep to xmllint --shell</li>
3519  <li>VMS update patch from Craig A. Berry</li>
3520  <li>cleanup of the Windows build with support for more compilers (Igor),
3521    better thread support on Windows</li>
3522  <li>cleanup of Unix Makefiles and spec file</li>
3523  <li>Improvements to the documentation (John Fleck)</li>
3524</ul>
3525
3526<h3>2.4.26: Oct 18 2002</h3>
3527<ul>
3528  <li>Patches for Windows CE port, improvements on Windows paths handling</li>
3529  <li>Fixes to the validation  code (DTD and Schemas), xmlNodeGetPath() ,
3530    HTML serialization, Namespace compliance,  and a number of small
3531  problems</li>
3532</ul>
3533
3534<h3>2.4.25: Sep 26 2002</h3>
3535<ul>
3536  <li>A number of bug fixes: XPath, validation, Python bindings, DOM and
3537    tree, xmlI/O,  Html</li>
3538  <li>Serious rewrite of XInclude</li>
3539  <li>Made XML Schemas regexp part of the default build and APIs, small fix
3540    and improvement of the regexp core</li>
3541  <li>Changed the validation code to reuse XML Schemas regexp APIs</li>
3542  <li>Better handling of Windows file paths, improvement of Makefiles (Igor,
3543    Daniel Gehriger, Mark Vakoc)</li>
3544  <li>Improved the python I/O bindings, the tests, added resolver and regexp
3545    APIs</li>
3546  <li>New logos from Marc Liyanage</li>
3547  <li>Tutorial improvements: John Fleck, Christopher Harris</li>
3548  <li>Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR (Christophe
3549  Merlet)</li>
3550  <li>removal of all stderr/perror use for error reporting</li>
3551  <li>Better error reporting: XPath and DTD validation</li>
3552  <li>update of the trio portability layer (Bjorn Reese)</li>
3553</ul>
3554
3555<p><strong>2.4.24: Aug 22 2002</strong></p>
3556<ul>
3557  <li>XPath fixes (William), xf:escape-uri() (Wesley Terpstra)</li>
3558  <li>Python binding fixes: makefiles (William), generator, rpm build, x86-64
3559    (fcrozat)</li>
3560  <li>HTML &lt;style&gt; and boolean attributes serializer fixes</li>
3561  <li>C14N improvements by Aleksey</li>
3562  <li>doc cleanups: Rick Jones</li>
3563  <li>Windows compiler makefile updates: Igor and Elizabeth Barham</li>
3564  <li>XInclude: implementation of fallback and xml:base fixup added</li>
3565</ul>
3566
3567<h3>2.4.23: July 6 2002</h3>
3568<ul>
3569  <li>performances patches: Peter Jacobi</li>
3570  <li>c14n fixes, testsuite and performances: Aleksey Sanin</li>
3571  <li>added xmlDocFormatDump: Chema Celorio</li>
3572  <li>new tutorial: John Fleck</li>
3573  <li>new hash functions and performances: Sander Vesik, portability fix from
3574    Peter Jacobi</li>
3575  <li>a number of bug fixes: XPath (William Brack, Richard Jinks), XML and
3576    HTML parsers, ID lookup function</li>
3577  <li>removal of all remaining sprintf: Aleksey Sanin</li>
3578</ul>
3579
3580<h3>2.4.22: May 27 2002</h3>
3581<ul>
3582  <li>a number of bug fixes: configure scripts, base handling, parser, memory
3583    usage, HTML parser, XPath, documentation (Christian Cornelssen),
3584    indentation, URI parsing</li>
3585  <li>Optimizations for XMLSec, fixing and making public some of the network
3586    protocol handlers (Aleksey)</li>
3587  <li>performance patch from Gary Pennington</li>
3588  <li>Charles Bozeman provided date and time support for XML Schemas
3589  datatypes</li>
3590</ul>
3591
3592<h3>2.4.21: Apr 29 2002</h3>
3593
3594<p>This release is both a bug fix release and also contains the early XML
3595Schemas <a href="http://www.w3.org/TR/xmlschema-1/">structures</a> and <a
3596href="http://www.w3.org/TR/xmlschema-2/">datatypes</a> code, beware, all
3597interfaces are likely to change, there is huge holes, it is clearly a work in
3598progress and don't even think of putting this code in a production system,
3599it's actually not compiled in by default. The real fixes are:
3600</p>
3601
3602<ul>
3603  <li>a couple of bugs or limitations introduced in 2.4.20</li>
3604  <li>patches for Borland C++ and MSC by Igor</li>
3605  <li>some fixes on XPath strings and conformance patches by Richard
3606  Jinks</li>
3607  <li>patch from Aleksey for the ExcC14N specification</li>
3608  <li>OSF/1 bug fix by Bjorn</li>
3609</ul>
3610
3611<h3>2.4.20: Apr 15 2002</h3>
3612<ul>
3613  <li>bug fixes: file descriptor leak, XPath, HTML output, DTD validation</li>
3614  <li>XPath conformance testing by Richard Jinks</li>
3615  <li>Portability fixes: Solaris, MPE/iX, Windows, OSF/1, python bindings,
3616    libxml.m4</li>
3617</ul>
3618
3619<h3>2.4.19: Mar 25 2002</h3>
3620<ul>
3621  <li>bug fixes: half a dozen XPath bugs, Validation, ISO-Latin to UTF8
3622    encoder</li>
3623  <li>portability fixes in the HTTP code</li>
3624  <li>memory allocation checks using valgrind, and profiling tests</li>
3625  <li>revamp of the Windows build and Makefiles</li>
3626</ul>
3627
3628<h3>2.4.18: Mar 18 2002</h3>
3629<ul>
3630  <li>bug fixes: tree, SAX, canonicalization, validation, portability,
3631  XPath</li>
3632  <li>removed the --with-buffer option it was becoming unmaintainable</li>
3633  <li>serious cleanup of the Python makefiles</li>
3634  <li>speedup patch to XPath very effective for DocBook stylesheets</li>
3635  <li>Fixes for Windows build, cleanup of the documentation</li>
3636</ul>
3637
3638<h3>2.4.17: Mar 8 2002</h3>
3639<ul>
3640  <li>a lot of bug fixes, including "namespace nodes have no parents in
3641  XPath"</li>
3642  <li>fixed/improved the Python wrappers, added more examples and more
3643    regression tests, XPath extension functions can now return node-sets</li>
3644  <li>added the XML Canonicalization support from Aleksey Sanin</li>
3645</ul>
3646
3647<h3>2.4.16: Feb 20 2002</h3>
3648<ul>
3649  <li>a lot of bug fixes, most of them were triggered by the XML Testsuite
3650    from OASIS and W3C. Compliance has been significantly improved.</li>
3651  <li>a couple of portability fixes too.</li>
3652</ul>
3653
3654<h3>2.4.15: Feb 11 2002</h3>
3655<ul>
3656  <li>Fixed the Makefiles, especially the python module ones</li>
3657  <li>A few bug fixes and cleanup</li>
3658  <li>Includes cleanup</li>
3659</ul>
3660
3661<h3>2.4.14: Feb 8 2002</h3>
3662<ul>
3663  <li>Change of License to the <a
3664    href="http://www.opensource.org/licenses/mit-license.html">MIT
3665    License</a> basically for integration in XFree86 codebase, and removing
3666    confusion around the previous dual-licensing</li>
3667  <li>added Python bindings, beta software but should already be quite
3668    complete</li>
3669  <li>a large number of fixes and cleanups, especially for all tree
3670    manipulations</li>
3671  <li>cleanup of the headers, generation of a reference API definition in
3672  XML</li>
3673</ul>
3674
3675<h3>2.4.13: Jan 14 2002</h3>
3676<ul>
3677  <li>update of the documentation: John Fleck and Charlie Bozeman</li>
3678  <li>cleanup of timing code from Justin Fletcher</li>
3679  <li>fixes for Windows and initial thread support on Win32: Igor and Serguei
3680    Narojnyi</li>
3681  <li>Cygwin patch from Robert Collins</li>
3682  <li>added xmlSetEntityReferenceFunc() for Keith Isdale work on xsldbg</li>
3683</ul>
3684
3685<h3>2.4.12: Dec 7 2001</h3>
3686<ul>
3687  <li>a few bug fixes: thread (Gary Pennington), xmllint (Geert Kloosterman),
3688    XML parser (Robin Berjon), XPointer (Danny Jamshy), I/O cleanups
3689  (robert)</li>
3690  <li>Eric Lavigne contributed project files for MacOS</li>
3691  <li>some makefiles cleanups</li>
3692</ul>
3693
3694<h3>2.4.11: Nov 26 2001</h3>
3695<ul>
3696  <li>fixed a couple of errors in the includes, fixed a few bugs, some code
3697    cleanups</li>
3698  <li>xmllint man pages improvement by Heiko Rupp</li>
3699  <li>updated VMS build instructions from John A Fotheringham</li>
3700  <li>Windows Makefiles updates from Igor</li>
3701</ul>
3702
3703<h3>2.4.10: Nov 10 2001</h3>
3704<ul>
3705  <li>URI escaping fix (Joel Young)</li>
3706  <li>added xmlGetNodePath() (for paths or XPointers generation)</li>
3707  <li>Fixes namespace handling problems when using DTD and validation</li>
3708  <li>improvements on xmllint: Morus Walter patches for --format and
3709    --encode, Stefan Kost and Heiko Rupp improvements on the --shell</li>
3710  <li>fixes for xmlcatalog linking pointed by Weiqi Gao</li>
3711  <li>fixes to the HTML parser</li>
3712</ul>
3713
3714<h3>2.4.9: Nov 6 2001</h3>
3715<ul>
3716  <li>fixes more catalog bugs</li>
3717  <li>avoid a compilation problem, improve xmlGetLineNo()</li>
3718</ul>
3719
3720<h3>2.4.8: Nov 4 2001</h3>
3721<ul>
3722  <li>fixed SGML catalogs broken in previous release, updated xmlcatalog
3723  tool</li>
3724  <li>fixed a compile errors and some includes troubles.</li>
3725</ul>
3726
3727<h3>2.4.7: Oct 30 2001</h3>
3728<ul>
3729  <li>exported some debugging interfaces</li>
3730  <li>serious rewrite of the catalog code</li>
3731  <li>integrated Gary Pennington thread safety patch, added configure option
3732    and regression tests</li>
3733  <li>removed an HTML parser bug</li>
3734  <li>fixed a couple of potentially serious validation bugs</li>
3735  <li>integrated the SGML DocBook support in xmllint</li>
3736  <li>changed the nanoftp anonymous login passwd</li>
3737  <li>some I/O cleanup and a couple of interfaces for Perl wrapper</li>
3738  <li>general bug fixes</li>
3739  <li>updated xmllint man page by John Fleck</li>
3740  <li>some VMS and Windows updates</li>
3741</ul>
3742
3743<h3>2.4.6: Oct 10 2001</h3>
3744<ul>
3745  <li>added an updated man pages by John Fleck</li>
3746  <li>portability and configure fixes</li>
3747  <li>an infinite loop on the HTML parser was removed (William)</li>
3748  <li>Windows makefile patches from Igor</li>
3749  <li>fixed half a dozen bugs reported for libxml or libxslt</li>
3750  <li>updated xmlcatalog to be able to modify SGML super catalogs</li>
3751</ul>
3752
3753<h3>2.4.5: Sep 14 2001</h3>
3754<ul>
3755  <li>Remove a few annoying bugs in 2.4.4</li>
3756  <li>forces the HTML serializer to output decimal charrefs since some
3757    version of Netscape can't handle hexadecimal ones</li>
3758</ul>
3759
3760<h3>1.8.16: Sep 14 2001</h3>
3761<ul>
3762  <li>maintenance release of the old libxml1 branch, couple of bug and
3763    portability fixes</li>
3764</ul>
3765
3766<h3>2.4.4: Sep 12 2001</h3>
3767<ul>
3768  <li>added --convert to xmlcatalog, bug fixes and cleanups of XML
3769  Catalog</li>
3770  <li>a few bug fixes and some portability changes</li>
3771  <li>some documentation cleanups</li>
3772</ul>
3773
3774<h3>2.4.3:  Aug 23 2001</h3>
3775<ul>
3776  <li>XML Catalog support see the doc</li>
3777  <li>New NaN/Infinity floating point code</li>
3778  <li>A few bug fixes</li>
3779</ul>
3780
3781<h3>2.4.2:  Aug 15 2001</h3>
3782<ul>
3783  <li>adds xmlLineNumbersDefault() to control line number generation</li>
3784  <li>lot of bug fixes</li>
3785  <li>the Microsoft MSC projects files should now be up to date</li>
3786  <li>inheritance of namespaces from DTD defaulted attributes</li>
3787  <li>fixes a serious potential security bug</li>
3788  <li>added a --format option to xmllint</li>
3789</ul>
3790
3791<h3>2.4.1:  July 24 2001</h3>
3792<ul>
3793  <li>possibility to keep line numbers in the tree</li>
3794  <li>some computation NaN fixes</li>
3795  <li>extension of the XPath API</li>
3796  <li>cleanup for alpha and ia64 targets</li>
3797  <li>patch to allow saving through HTTP PUT or POST</li>
3798</ul>
3799
3800<h3>2.4.0: July 10 2001</h3>
3801<ul>
3802  <li>Fixed a few bugs in XPath, validation, and tree handling.</li>
3803  <li>Fixed XML Base implementation, added a couple of examples to the
3804    regression tests</li>
3805  <li>A bit of cleanup</li>
3806</ul>
3807
3808<h3>2.3.14: July 5 2001</h3>
3809<ul>
3810  <li>fixed some entities problems and reduce memory requirement when
3811    substituting them</li>
3812  <li>lots of improvements in the XPath queries interpreter can be
3813    substantially faster</li>
3814  <li>Makefiles and configure cleanups</li>
3815  <li>Fixes to XPath variable eval, and compare on empty node set</li>
3816  <li>HTML tag closing bug fixed</li>
3817  <li>Fixed an URI reference computation problem when validating</li>
3818</ul>
3819
3820<h3>2.3.13: June 28 2001</h3>
3821<ul>
3822  <li>2.3.12 configure.in was broken as well as the push mode XML parser</li>
3823  <li>a few more fixes for compilation on Windows MSC by Yon Derek</li>
3824</ul>
3825
3826<h3>1.8.14: June 28 2001</h3>
3827<ul>
3828  <li>Zbigniew Chyla gave a patch to use the old XML parser in push mode</li>
3829  <li>Small Makefile fix</li>
3830</ul>
3831
3832<h3>2.3.12: June 26 2001</h3>
3833<ul>
3834  <li>lots of cleanup</li>
3835  <li>a couple of validation fix</li>
3836  <li>fixed line number counting</li>
3837  <li>fixed serious problems in the XInclude processing</li>
3838  <li>added support for UTF8 BOM at beginning of entities</li>
3839  <li>fixed a strange gcc optimizer bugs in xpath handling of float, gcc-3.0
3840    miscompile uri.c (William), Thomas Leitner provided a fix for the
3841    optimizer on Tru64</li>
3842  <li>incorporated Yon Derek and Igor Zlatkovic  fixes and improvements for
3843    compilation on Windows MSC</li>
3844  <li>update of libxml-doc.el (Felix Natter)</li>
3845  <li>fixed 2 bugs in URI normalization code</li>
3846</ul>
3847
3848<h3>2.3.11: June 17 2001</h3>
3849<ul>
3850  <li>updates to trio, Makefiles and configure should fix some portability
3851    problems (alpha)</li>
3852  <li>fixed some HTML serialization problems (pre, script, and block/inline
3853    handling), added encoding aware APIs, cleanup of this code</li>
3854  <li>added xmlHasNsProp()</li>
3855  <li>implemented a specific PI for encoding support in the DocBook SGML
3856    parser</li>
3857  <li>some XPath fixes (-Infinity, / as a function parameter and namespaces
3858    node selection)</li>
3859  <li>fixed a performance problem and an error in the validation code</li>
3860  <li>fixed XInclude routine to implement the recursive behaviour</li>
3861  <li>fixed xmlFreeNode problem when libxml is included statically twice</li>
3862  <li>added --version to xmllint for bug reports</li>
3863</ul>
3864
3865<h3>2.3.10: June 1 2001</h3>
3866<ul>
3867  <li>fixed the SGML catalog support</li>
3868  <li>a number of reported bugs got fixed, in XPath, iconv detection,
3869    XInclude processing</li>
3870  <li>XPath string function should now handle unicode correctly</li>
3871</ul>
3872
3873<h3>2.3.9: May 19 2001</h3>
3874
3875<p>Lots of bugfixes, and added a basic SGML catalog support:
3876</p>
3877<ul>
3878  <li>HTML push bugfix #54891 and another patch from Jonas Borgstrom</li>
3879  <li>some serious speed optimization again</li>
3880  <li>some documentation cleanups</li>
3881  <li>trying to get better linking on Solaris (-R)</li>
3882  <li>XPath API cleanup from Thomas Broyer</li>
3883  <li>Validation bug fixed #54631, added a patch from Gary Pennington, fixed
3884    xmlValidGetValidElements()</li>
3885  <li>Added an INSTALL file</li>
3886  <li>Attribute removal added to API: #54433</li>
3887  <li>added a basic support for SGML catalogs</li>
3888  <li>fixed xmlKeepBlanksDefault(0) API</li>
3889  <li>bugfix in xmlNodeGetLang()</li>
3890  <li>fixed a small configure portability problem</li>
3891  <li>fixed an inversion of SYSTEM and PUBLIC identifier in HTML document</li>
3892</ul>
3893
3894<h3>1.8.13: May 14 2001</h3>
3895<ul>
3896  <li>bugfixes release of the old libxml1 branch used by Gnome</li>
3897</ul>
3898
3899<h3>2.3.8: May 3 2001</h3>
3900<ul>
3901  <li>Integrated an SGML DocBook parser for the Gnome project</li>
3902  <li>Fixed a few things in the HTML parser</li>
3903  <li>Fixed some XPath bugs raised by XSLT use, tried to fix the floating
3904    point portability issue</li>
3905  <li>Speed improvement (8M/s for SAX, 3M/s for DOM, 1.5M/s for
3906    DOM+validation using the XML REC as input and a 700MHz celeron).</li>
3907  <li>incorporated more Windows cleanup</li>
3908  <li>added xmlSaveFormatFile()</li>
3909  <li>fixed problems in copying nodes with entities references (gdome)</li>
3910  <li>removed some troubles surrounding the new validation module</li>
3911</ul>
3912
3913<h3>2.3.7: April 22 2001</h3>
3914<ul>
3915  <li>lots of small bug fixes, corrected XPointer</li>
3916  <li>Non deterministic content model validation support</li>
3917  <li>added xmlDocCopyNode for gdome2</li>
3918  <li>revamped the way the HTML parser handles end of tags</li>
3919  <li>XPath: corrections of namespaces support and number formatting</li>
3920  <li>Windows: Igor Zlatkovic patches for MSC compilation</li>
3921  <li>HTML output fixes from P C Chow and William M. Brack</li>
3922  <li>Improved validation speed sensible for DocBook</li>
3923  <li>fixed a big bug with ID declared in external parsed entities</li>
3924  <li>portability fixes, update of Trio from Bjorn Reese</li>
3925</ul>
3926
3927<h3>2.3.6: April 8 2001</h3>
3928<ul>
3929  <li>Code cleanup using extreme gcc compiler warning options, found and
3930    cleared half a dozen potential problem</li>
3931  <li>the Eazel team found an XML parser bug</li>
3932  <li>cleaned up the user of some of the string formatting function. used the
3933    trio library code to provide the one needed when the platform is missing
3934    them</li>
3935  <li>xpath: removed a memory leak and fixed the predicate evaluation
3936    problem, extended the testsuite and cleaned up the result. XPointer seems
3937    broken ...</li>
3938</ul>
3939
3940<h3>2.3.5: Mar 23 2001</h3>
3941<ul>
3942  <li>Biggest change is separate parsing and evaluation of XPath expressions,
3943    there is some new APIs for this too</li>
3944  <li>included a number of bug fixes(XML push parser, 51876, notations,
3945  52299)</li>
3946  <li>Fixed some portability issues</li>
3947</ul>
3948
3949<h3>2.3.4: Mar 10 2001</h3>
3950<ul>
3951  <li>Fixed bugs #51860 and #51861</li>
3952  <li>Added a global variable xmlDefaultBufferSize to allow default buffer
3953    size to be application tunable.</li>
3954  <li>Some cleanup in the validation code, still a bug left and this part
3955    should probably be rewritten to support ambiguous content model :-\</li>
3956  <li>Fix a couple of serious bugs introduced or raised by changes in 2.3.3
3957    parser</li>
3958  <li>Fixed another bug in xmlNodeGetContent()</li>
3959  <li>Bjorn fixed XPath node collection and Number formatting</li>
3960  <li>Fixed a loop reported in the HTML parsing</li>
3961  <li>blank space are reported even if the Dtd content model proves that they
3962    are formatting spaces, this is for XML conformance</li>
3963</ul>
3964
3965<h3>2.3.3: Mar 1 2001</h3>
3966<ul>
3967  <li>small change in XPath for XSLT</li>
3968  <li>documentation cleanups</li>
3969  <li>fix in validation by Gary Pennington</li>
3970  <li>serious parsing performances improvements</li>
3971</ul>
3972
3973<h3>2.3.2: Feb 24 2001</h3>
3974<ul>
3975  <li>chasing XPath bugs, found a bunch, completed some TODO</li>
3976  <li>fixed a Dtd parsing bug</li>
3977  <li>fixed a bug in xmlNodeGetContent</li>
3978  <li>ID/IDREF support partly rewritten by Gary Pennington</li>
3979</ul>
3980
3981<h3>2.3.1: Feb 15 2001</h3>
3982<ul>
3983  <li>some XPath and HTML bug fixes for XSLT</li>
3984  <li>small extension of the hash table interfaces for DOM gdome2
3985    implementation</li>
3986  <li>A few bug fixes</li>
3987</ul>
3988
3989<h3>2.3.0: Feb 8 2001 (2.2.12 was on 25 Jan but I didn't kept track)</h3>
3990<ul>
3991  <li>Lots of XPath bug fixes</li>
3992  <li>Add a mode with Dtd lookup but without validation error reporting for
3993    XSLT</li>
3994  <li>Add support for text node without escaping (XSLT)</li>
3995  <li>bug fixes for xmlCheckFilename</li>
3996  <li>validation code bug fixes from Gary Pennington</li>
3997  <li>Patch from Paul D. Smith correcting URI path normalization</li>
3998  <li>Patch to allow simultaneous install of libxml-devel and
3999  libxml2-devel</li>
4000  <li>the example Makefile is now fixed</li>
4001  <li>added HTML to the RPM packages</li>
4002  <li>tree copying bugfixes</li>
4003  <li>updates to Windows makefiles</li>
4004  <li>optimization patch from Bjorn Reese</li>
4005</ul>
4006
4007<h3>2.2.11: Jan 4 2001</h3>
4008<ul>
4009  <li>bunch of bug fixes (memory I/O, xpath, ftp/http, ...)</li>
4010  <li>added htmlHandleOmittedElem()</li>
4011  <li>Applied Bjorn Reese's IPV6 first patch</li>
4012  <li>Applied Paul D. Smith patches for validation of XInclude results</li>
4013  <li>added XPointer xmlns() new scheme support</li>
4014</ul>
4015
4016<h3>2.2.10: Nov 25 2000</h3>
4017<ul>
4018  <li>Fix the Windows problems of 2.2.8</li>
4019  <li>integrate OpenVMS patches</li>
4020  <li>better handling of some nasty HTML input</li>
4021  <li>Improved the XPointer implementation</li>
4022  <li>integrate a number of provided patches</li>
4023</ul>
4024
4025<h3>2.2.9: Nov 25 2000</h3>
4026<ul>
4027  <li>erroneous release :-(</li>
4028</ul>
4029
4030<h3>2.2.8: Nov 13 2000</h3>
4031<ul>
4032  <li>First version of <a href="http://www.w3.org/TR/xinclude">XInclude</a>
4033    support</li>
4034  <li>Patch in conditional section handling</li>
4035  <li>updated MS compiler project</li>
4036  <li>fixed some XPath problems</li>
4037  <li>added an URI escaping function</li>
4038  <li>some other bug fixes</li>
4039</ul>
4040
4041<h3>2.2.7: Oct 31 2000</h3>
4042<ul>
4043  <li>added message redirection</li>
4044  <li>XPath improvements (thanks TOM !)</li>
4045  <li>xmlIOParseDTD() added</li>
4046  <li>various small fixes in the HTML, URI, HTTP and XPointer support</li>
4047  <li>some cleanup of the Makefile, autoconf and the distribution content</li>
4048</ul>
4049
4050<h3>2.2.6: Oct 25 2000:</h3>
4051<ul>
4052  <li>Added an hash table module, migrated a number of internal structure to
4053    those</li>
4054  <li>Fixed a posteriori validation problems</li>
4055  <li>HTTP module cleanups</li>
4056  <li>HTML parser improvements (tag errors, script/style handling, attribute
4057    normalization)</li>
4058  <li>coalescing of adjacent text nodes</li>
4059  <li>couple of XPath bug fixes, exported the internal API</li>
4060</ul>
4061
4062<h3>2.2.5: Oct 15 2000:</h3>
4063<ul>
4064  <li>XPointer implementation and testsuite</li>
4065  <li>Lot of XPath fixes, added variable and functions registration, more
4066    tests</li>
4067  <li>Portability fixes, lots of enhancements toward an easy Windows build
4068    and release</li>
4069  <li>Late validation fixes</li>
4070  <li>Integrated a lot of contributed patches</li>
4071  <li>added memory management docs</li>
4072  <li>a performance problem when using large buffer seems fixed</li>
4073</ul>
4074
4075<h3>2.2.4: Oct 1 2000:</h3>
4076<ul>
4077  <li>main XPath problem fixed</li>
4078  <li>Integrated portability patches for Windows</li>
4079  <li>Serious bug fixes on the URI and HTML code</li>
4080</ul>
4081
4082<h3>2.2.3: Sep 17 2000</h3>
4083<ul>
4084  <li>bug fixes</li>
4085  <li>cleanup of entity handling code</li>
4086  <li>overall review of all loops in the parsers, all sprintf usage has been
4087    checked too</li>
4088  <li>Far better handling of larges Dtd. Validating against DocBook XML Dtd
4089    works smoothly now.</li>
4090</ul>
4091
4092<h3>1.8.10: Sep 6 2000</h3>
4093<ul>
4094  <li>bug fix release for some Gnome projects</li>
4095</ul>
4096
4097<h3>2.2.2: August 12 2000</h3>
4098<ul>
4099  <li>mostly bug fixes</li>
4100  <li>started adding routines to access xml parser context options</li>
4101</ul>
4102
4103<h3>2.2.1: July 21 2000</h3>
4104<ul>
4105  <li>a purely bug fixes release</li>
4106  <li>fixed an encoding support problem when parsing from a memory block</li>
4107  <li>fixed a DOCTYPE parsing problem</li>
4108  <li>removed a bug in the function allowing to override the memory
4109    allocation routines</li>
4110</ul>
4111
4112<h3>2.2.0: July 14 2000</h3>
4113<ul>
4114  <li>applied a lot of portability fixes</li>
4115  <li>better encoding support/cleanup and saving (content is now always
4116    encoded in UTF-8)</li>
4117  <li>the HTML parser now correctly handles encodings</li>
4118  <li>added xmlHasProp()</li>
4119  <li>fixed a serious problem with &amp;#38;</li>
4120  <li>propagated the fix to FTP client</li>
4121  <li>cleanup, bugfixes, etc ...</li>
4122  <li>Added a page about <a href="encoding.html">libxml Internationalization
4123    support</a></li>
4124</ul>
4125
4126<h3>1.8.9:  July 9 2000</h3>
4127<ul>
4128  <li>fixed the spec the RPMs should be better</li>
4129  <li>fixed a serious bug in the FTP implementation, released 1.8.9 to solve
4130    rpmfind users problem</li>
4131</ul>
4132
4133<h3>2.1.1: July 1 2000</h3>
4134<ul>
4135  <li>fixes a couple of bugs in the 2.1.0 packaging</li>
4136  <li>improvements on the HTML parser</li>
4137</ul>
4138
4139<h3>2.1.0 and 1.8.8: June 29 2000</h3>
4140<ul>
4141  <li>1.8.8 is mostly a commodity package for upgrading to libxml2 according
4142    to <a href="upgrade.html">new instructions</a>. It fixes a nasty problem
4143    about &amp;#38; charref parsing</li>
4144  <li>2.1.0 also ease the upgrade from libxml v1 to the recent version. it
4145    also contains numerous fixes and enhancements:
4146    <ul>
4147      <li>added xmlStopParser() to stop parsing</li>
4148      <li>improved a lot parsing speed when there is large CDATA blocks</li>
4149      <li>includes XPath patches provided by Picdar Technology</li>
4150      <li>tried to fix as much as possible DTD validation and namespace
4151        related problems</li>
4152      <li>output to a given encoding has been added/tested</li>
4153      <li>lot of various fixes</li>
4154    </ul>
4155  </li>
4156</ul>
4157
4158<h3>2.0.0: Apr 12 2000</h3>
4159<ul>
4160  <li>First public release of libxml2. If you are using libxml, it's a good
4161    idea to check the 1.x to 2.x upgrade instructions. NOTE: while initially
4162    scheduled for Apr 3 the release occurred only on Apr 12 due to massive
4163    workload.</li>
4164  <li>The include are now located under $prefix/include/libxml (instead of
4165    $prefix/include/gnome-xml), they also are referenced by
4166    <pre>#include &lt;libxml/xxx.h&gt;</pre>
4167    <p>instead of</p>
4168    <pre>#include "xxx.h"</pre>
4169  </li>
4170  <li>a new URI module for parsing URIs and following strictly RFC 2396</li>
4171  <li>the memory allocation routines used by libxml can now be overloaded
4172    dynamically by using xmlMemSetup()</li>
4173  <li>The previously CVS only tool tester has been renamed
4174    <strong>xmllint</strong> and is now installed as part of the libxml2
4175    package</li>
4176  <li>The I/O interface has been revamped. There is now ways to plug in
4177    specific I/O modules, either at the URI scheme detection level using
4178    xmlRegisterInputCallbacks()  or by passing I/O functions when creating a
4179    parser context using xmlCreateIOParserCtxt()</li>
4180  <li>there is a C preprocessor macro LIBXML_VERSION providing the version
4181    number of the libxml module in use</li>
4182  <li>a number of optional features of libxml can now be excluded at
4183    configure time (FTP/HTTP/HTML/XPath/Debug)</li>
4184</ul>
4185
4186<h3>2.0.0beta: Mar 14 2000</h3>
4187<ul>
4188  <li>This is a first Beta release of libxml version 2</li>
4189  <li>It's available only from<a href="ftp://xmlsoft.org/libxml2/">xmlsoft.org
4190    FTP</a>, it's packaged as libxml2-2.0.0beta and available as tar and
4191  RPMs</li>
4192  <li>This version is now the head in the Gnome CVS base, the old one is
4193    available under the tag LIB_XML_1_X</li>
4194  <li>This includes a very large set of changes. From a  programmatic point
4195    of view applications should not have to be modified too much, check the
4196    <a href="upgrade.html">upgrade page</a></li>
4197  <li>Some interfaces may changes (especially a bit about encoding).</li>
4198  <li>the updates includes:
4199    <ul>
4200      <li>fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
4201        handled now</li>
4202      <li>Better handling of entities, especially well-formedness checking
4203        and proper PEref extensions in external subsets</li>
4204      <li>DTD conditional sections</li>
4205      <li>Validation now correctly handle entities content</li>
4206      <li><a href="http://rpmfind.net/tools/gdome/messages/0039.html">change
4207        structures to accommodate DOM</a></li>
4208    </ul>
4209  </li>
4210  <li>Serious progress were made toward compliance, <a
4211    href="conf/result.html">here are the result of the test</a> against the
4212    OASIS testsuite (except the Japanese tests since I don't support that
4213    encoding yet). This URL is rebuilt every couple of hours using the CVS
4214    head version.</li>
4215</ul>
4216
4217<h3>1.8.7: Mar 6 2000</h3>
4218<ul>
4219  <li>This is a bug fix release:</li>
4220  <li>It is possible to disable the ignorable blanks heuristic used by
4221    libxml-1.x, a new function  xmlKeepBlanksDefault(0) will allow this. Note
4222    that for adherence to XML spec, this behaviour will be disabled by
4223    default in 2.x . The same function will allow to keep compatibility for
4224    old code.</li>
4225  <li>Blanks in &lt;a&gt;  &lt;/a&gt; constructs are not ignored anymore,
4226    avoiding heuristic is really the Right Way :-\</li>
4227  <li>The unchecked use of snprintf which was breaking libxml-1.8.6
4228    compilation on some platforms has been fixed</li>
4229  <li>nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when processing
4230  URIs</li>
4231</ul>
4232
4233<h3>1.8.6: Jan 31 2000</h3>
4234<ul>
4235  <li>added a nanoFTP transport module, debugged until the new version of <a
4236    href="http://rpmfind.net/linux/rpm2html/rpmfind.html">rpmfind</a> can use
4237    it without troubles</li>
4238</ul>
4239
4240<h3>1.8.5: Jan 21 2000</h3>
4241<ul>
4242  <li>adding APIs to parse a well balanced chunk of XML (production <a
4243    href="http://www.w3.org/TR/REC-xml#NT-content">[43] content</a> of the
4244    XML spec)</li>
4245  <li>fixed a hideous bug in xmlGetProp pointed by Rune.Djurhuus@fast.no</li>
4246  <li>Jody Goldberg &lt;jgoldberg@home.com&gt; provided another patch trying
4247    to solve the zlib checks problems</li>
4248  <li>The current state in gnome CVS base is expected to ship as 1.8.5 with
4249    gnumeric soon</li>
4250</ul>
4251
4252<h3>1.8.4: Jan 13 2000</h3>
4253<ul>
4254  <li>bug fixes, reintroduced xmlNewGlobalNs(), fixed xmlNewNs()</li>
4255  <li>all exit() call should have been removed from libxml</li>
4256  <li>fixed a problem with INCLUDE_WINSOCK on WIN32 platform</li>
4257  <li>added newDocFragment()</li>
4258</ul>
4259
4260<h3>1.8.3: Jan 5 2000</h3>
4261<ul>
4262  <li>a Push interface for the XML and HTML parsers</li>
4263  <li>a shell-like interface to the document tree (try tester --shell :-)</li>
4264  <li>lots of bug fixes and improvement added over XMas holidays</li>
4265  <li>fixed the DTD parsing code to work with the xhtml DTD</li>
4266  <li>added xmlRemoveProp(), xmlRemoveID() and xmlRemoveRef()</li>
4267  <li>Fixed bugs in xmlNewNs()</li>
4268  <li>External entity loading code has been revamped, now it uses
4269    xmlLoadExternalEntity(), some fix on entities processing were added</li>
4270  <li>cleaned up WIN32 includes of socket stuff</li>
4271</ul>
4272
4273<h3>1.8.2: Dec 21 1999</h3>
4274<ul>
4275  <li>I got another problem with includes and C++, I hope this issue is fixed
4276    for good this time</li>
4277  <li>Added a few tree modification functions: xmlReplaceNode,
4278    xmlAddPrevSibling, xmlAddNextSibling, xmlNodeSetName and
4279    xmlDocSetRootElement</li>
4280  <li>Tried to improve the HTML output with help from <a
4281    href="mailto:clahey@umich.edu">Chris Lahey</a></li>
4282</ul>
4283
4284<h3>1.8.1: Dec 18 1999</h3>
4285<ul>
4286  <li>various patches to avoid troubles when using libxml with C++ compilers
4287    the "namespace" keyword and C escaping in include files</li>
4288  <li>a problem in one of the core macros IS_CHAR was corrected</li>
4289  <li>fixed a bug introduced in 1.8.0 breaking default namespace processing,
4290    and more specifically the Dia application</li>
4291  <li>fixed a posteriori validation (validation after parsing, or by using a
4292    Dtd not specified in the original document)</li>
4293  <li>fixed a bug in</li>
4294</ul>
4295
4296<h3>1.8.0: Dec 12 1999</h3>
4297<ul>
4298  <li>cleanup, especially memory wise</li>
4299  <li>the parser should be more reliable, especially the HTML one, it should
4300    not crash, whatever the input !</li>
4301  <li>Integrated various patches, especially a speedup improvement for large
4302    dataset from <a href="mailto:cnygard@bellatlantic.net">Carl Nygard</a>,
4303    configure with --with-buffers to enable them.</li>
4304  <li>attribute normalization, oops should have been added long ago !</li>
4305  <li>attributes defaulted from DTDs should be available, xmlSetProp() now
4306    does entities escaping by default.</li>
4307</ul>
4308
4309<h3>1.7.4: Oct 25 1999</h3>
4310<ul>
4311  <li>Lots of HTML improvement</li>
4312  <li>Fixed some errors when saving both XML and HTML</li>
4313  <li>More examples, the regression tests should now look clean</li>
4314  <li>Fixed a bug with contiguous charref</li>
4315</ul>
4316
4317<h3>1.7.3: Sep 29 1999</h3>
4318<ul>
4319  <li>portability problems fixed</li>
4320  <li>snprintf was used unconditionally, leading to link problems on system
4321    were it's not available, fixed</li>
4322</ul>
4323
4324<h3>1.7.1: Sep 24 1999</h3>
4325<ul>
4326  <li>The basic type for strings manipulated by libxml has been renamed in
4327    1.7.1 from <strong>CHAR</strong> to <strong>xmlChar</strong>. The reason
4328    is that CHAR was conflicting with a predefined type on Windows. However
4329    on non WIN32 environment, compatibility is provided by the way of  a
4330    <strong>#define </strong>.</li>
4331  <li>Changed another error : the use of a structure field called errno, and
4332    leading to troubles on platforms where it's a macro</li>
4333</ul>
4334
4335<h3>1.7.0: Sep 23 1999</h3>
4336<ul>
4337  <li>Added the ability to fetch remote DTD or parsed entities, see the <a
4338    href="html/libxml-nanohttp.html">nanohttp</a> module.</li>
4339  <li>Added an errno to report errors by another mean than a simple printf
4340    like callback</li>
4341  <li>Finished ID/IDREF support and checking when validation</li>
4342  <li>Serious memory leaks fixed (there is now a <a
4343    href="html/libxml-xmlmemory.html">memory wrapper</a> module)</li>
4344  <li>Improvement of <a href="http://www.w3.org/TR/xpath">XPath</a>
4345    implementation</li>
4346  <li>Added an HTML parser front-end</li>
4347</ul>
4348
4349<h2><a name="XML">XML</a></h2>
4350
4351<p><a href="http://www.w3.org/TR/REC-xml">XML is a standard</a> for
4352markup-based structured documents. Here is <a name="example">an example XML
4353document</a>:</p>
4354<pre>&lt;?xml version="1.0"?&gt;
4355&lt;EXAMPLE prop1="gnome is great" prop2="&amp;amp; linux too"&gt;
4356  &lt;head&gt;
4357   &lt;title&gt;Welcome to Gnome&lt;/title&gt;
4358  &lt;/head&gt;
4359  &lt;chapter&gt;
4360   &lt;title&gt;The Linux adventure&lt;/title&gt;
4361   &lt;p&gt;bla bla bla ...&lt;/p&gt;
4362   &lt;image href="linus.gif"/&gt;
4363   &lt;p&gt;...&lt;/p&gt;
4364  &lt;/chapter&gt;
4365&lt;/EXAMPLE&gt;</pre>
4366
4367<p>The first line specifies that it is an XML document and gives useful
4368information about its encoding.  Then the rest of the document is a text
4369format whose structure is specified by tags between brackets. <strong>Each
4370tag opened has to be closed</strong>. XML is pedantic about this. However, if
4371a tag is empty (no content), a single tag can serve as both the opening and
4372closing tag if it ends with <code>/&gt;</code> rather than with
4373<code>&gt;</code>. Note that, for example, the image tag has no content (just
4374an attribute) and is closed by ending the tag with <code>/&gt;</code>.</p>
4375
4376<p>XML can be applied successfully to a wide range of tasks, ranging from
4377long term structured document maintenance (where it follows the steps of
4378SGML) to simple data encoding mechanisms like configuration file formatting
4379(glade), spreadsheets (gnumeric), or even shorter lived documents such as
4380WebDAV where it is used to encode remote calls between a client and a
4381server.</p>
4382
4383<h2><a name="XSLT">XSLT</a></h2>
4384
4385<p>Check <a href="http://xmlsoft.org/XSLT">the separate libxslt page</a></p>
4386
4387<p><a href="http://www.w3.org/TR/xslt">XSL Transformations</a>,  is a
4388language for transforming XML documents into other XML documents (or
4389HTML/textual output).</p>
4390
4391<p>A separate library called libxslt is available implementing XSLT-1.0 for
4392libxml2. This module "libxslt" too can be found in the Gnome SVN base.</p>
4393
4394<p>You can check the progresses on the libxslt <a
4395href="http://xmlsoft.org/XSLT/ChangeLog.html">Changelog</a>.</p>
4396
4397<h2><a name="Python">Python and bindings</a></h2>
4398
4399<p>There are a number of language bindings and wrappers available for
4400libxml2, the list below is not exhaustive. Please contact the <a
4401href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>
4402(<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in
4403order to get updates to this list or to discuss the specific topic of libxml2
4404or libxslt wrappers or bindings:</p>
4405<ul>
4406  <li><a href="http://libxmlplusplus.sourceforge.net/">Libxml++</a> seems the
4407    most up-to-date C++ bindings for libxml2, check the <a
4408    href="http://libxmlplusplus.sourceforge.net/reference/html/hierarchy.html">documentation</a>
4409    and the <a
4410    href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/libxmlplusplus/libxml%2b%2b/examples/">examples</a>.</li>
4411  <li>There is another <a href="http://libgdome-cpp.berlios.de/">C++ wrapper
4412    based on the gdome2 bindings</a> maintained by Tobias Peters.</li>
4413  <li>and a third C++ wrapper by Peter Jones &lt;pjones@pmade.org&gt;
4414    <p>Website: <a
4415    href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p>
4416  </li>
4417  <li>XML::LibXML <a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl
4418      bindings</a> are available on CPAN, as well as XML::LibXSLT
4419      <a href="http://cpan.uwinnipeg.ca/dist/XML-LibXSLT">Perl libxslt
4420      bindings</a>.</li>
4421  <li>If you're interested into scripting XML processing, have a look at <a
4422    href="http://xsh.sourceforge.net/">XSH</a> an XML editing shell based on
4423    Libxml2 Perl bindings.</li>
4424  <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provides an
4425    earlier version of the libxml/libxslt <a
4426    href="http://www.rexx.com/~dkuhlman">wrappers for Python</a>.</li>
4427  <li>Gopal.V and Peter Minten develop <a
4428    href="http://savannah.gnu.org/projects/libxmlsharp">libxml#</a>, a set of
4429    C# libxml2 bindings.</li>
4430  <li>Petr Kozelka provides <a
4431    href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
4432    libxml2</a> with Kylix, Delphi and other Pascal compilers.</li>
4433  <li>Uwe Fechner also provides <a
4434    href="http://sourceforge.net/projects/idom2-pas/">idom2</a>, a DOM2
4435    implementation for Kylix2/D5/D6 from Borland.</li>
4436  <li>There is <a href="http://libxml.rubyforge.org/">bindings for Ruby</a>
4437    and libxml2 bindings are also available in Ruby through the <a
4438    href="http://libgdome-ruby.berlios.de/">libgdome-ruby</a> module
4439    maintained by Tobias Peters.</li>
4440  <li>Steve Ball and contributors maintains <a
4441    href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings for
4442    Tcl</a>.</li>
4443  <li>libxml2 and libxslt are the default XML libraries for PHP5.</li>
4444  <li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
4445    an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
4446    libxslt as part of GNU ClasspathX project.</li>
4447  <li>Patrick McPhee provides Rexx bindings for libxml2 and libxslt, look for
4448    <a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
4449  <li><a
4450    href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
4451    provides <a
4452    href="http://www.satimage.fr/software/en/downloads_osaxen.html">XMLLib
4453    osax</a>. This is an osax for Mac OS X with a set of commands to
4454    implement in AppleScript the XML DOM, XPATH and XSLT. Also includes
4455    commands for Property-lists (Apple's fast lookup table XML format.)</li>
4456  <li>Francesco Montorsi developed <a
4457    href="https://sourceforge.net/project/showfiles.php?group_id=51305&amp;package_id=45182">wxXml2</a>
4458    wrappers that interface libxml2, allowing wxWidgets applications to
4459    load/save/edit XML instances.</li>
4460</ul>
4461
4462<p>The distribution includes a set of Python bindings, which are guaranteed
4463to be maintained as part of the library in the future, though the Python
4464interface have not yet reached the completeness of the C API.</p>
4465
4466<p>Note that some of the Python purist dislike the default set of Python
4467bindings, rather than complaining I suggest they have a look at <a
4468href="http://lxml.de/">lxml the more pythonic bindings for libxml2
4469and libxslt</a> and <a
4470href="http://lxml.de/mailinglist/">check the mailing-list</a>.</p>
4471
4472<p><a href="mailto:stephane.bidoul@softwareag.com">Stéphane Bidoul</a>
4473maintains <a href="http://users.skynet.be/sbi/libxml-python/">a Windows port
4474of the Python bindings</a>.</p>
4475
4476<p>Note to people interested in building bindings, the API is formalized as
4477<a href="libxml2-api.xml">an XML API description file</a> which allows to
4478automate a large part of the Python bindings, this includes function
4479descriptions, enums, structures, typedefs, etc... The Python script used to
4480build the bindings is python/generator.py in the source distribution.</p>
4481
4482<p>To install the Python bindings there are 2 options:</p>
4483<ul>
4484  <li>If you use an RPM based distribution, simply install the <a
4485    href="http://rpmfind.net/linux/rpm2html/search.php?query=libxml2-python">libxml2-python
4486    RPM</a> (and if needed the <a
4487    href="http://rpmfind.net/linux/rpm2html/search.php?query=libxslt-python">libxslt-python
4488    RPM</a>).</li>
4489  <li>Otherwise use the <a href="ftp://xmlsoft.org/libxml2/python/">libxml2-python
4490    module distribution</a> corresponding to your installed version of
4491    libxml2 and libxslt. Note that to install it you will need both libxml2
4492    and libxslt installed and run "python setup.py build install" in the
4493    module tree.</li>
4494</ul>
4495
4496<p>The distribution includes a set of examples and regression tests for the
4497python bindings in the <code>python/tests</code> directory. Here are some
4498excerpts from those tests:</p>
4499
4500<h3>tst.py:</h3>
4501
4502<p>This is a basic test of the file interface and DOM navigation:</p>
4503<pre>import libxml2, sys
4504
4505doc = libxml2.parseFile("tst.xml")
4506if doc.name != "tst.xml":
4507    print "doc.name failed"
4508    sys.exit(1)
4509root = doc.children
4510if root.name != "doc":
4511    print "root.name failed"
4512    sys.exit(1)
4513child = root.children
4514if child.name != "foo":
4515    print "child.name failed"
4516    sys.exit(1)
4517doc.freeDoc()</pre>
4518
4519<p>The Python module is called libxml2; parseFile is the equivalent of
4520xmlParseFile (most of the bindings are automatically generated, and the xml
4521prefix is removed and the casing convention are kept). All node seen at the
4522binding level share the same subset of accessors:</p>
4523<ul>
4524  <li><code>name</code> : returns the node name</li>
4525  <li><code>type</code> : returns a string indicating the node type</li>
4526  <li><code>content</code> : returns the content of the node, it is based on
4527    xmlNodeGetContent() and hence is recursive.</li>
4528  <li><code>parent</code> , <code>children</code>, <code>last</code>,
4529    <code>next</code>, <code>prev</code>, <code>doc</code>,
4530    <code>properties</code>: pointing to the associated element in the tree,
4531    those may return None in case no such link exists.</li>
4532</ul>
4533
4534<p>Also note the need to explicitly deallocate documents with freeDoc() .
4535Reference counting for libxml2 trees would need quite a lot of work to
4536function properly, and rather than risk memory leaks if not implemented
4537correctly it sounds safer to have an explicit function to free a tree. The
4538wrapper python objects like doc, root or child are them automatically garbage
4539collected.</p>
4540
4541<h3>validate.py:</h3>
4542
4543<p>This test check the validation interfaces and redirection of error
4544messages:</p>
4545<pre>import libxml2
4546
4547#deactivate error messages from the validation
4548def noerr(ctx, str):
4549    pass
4550
4551libxml2.registerErrorHandler(noerr, None)
4552
4553ctxt = libxml2.createFileParserCtxt("invalid.xml")
4554ctxt.validate(1)
4555ctxt.parseDocument()
4556doc = ctxt.doc()
4557valid = ctxt.isValid()
4558doc.freeDoc()
4559if valid != 0:
4560    print "validity check failed"</pre>
4561
4562<p>The first thing to notice is the call to registerErrorHandler(), it
4563defines a new error handler global to the library. It is used to avoid seeing
4564the error messages when trying to validate the invalid document.</p>
4565
4566<p>The main interest of that test is the creation of a parser context with
4567createFileParserCtxt() and how the behaviour can be changed before calling
4568parseDocument() . Similarly the information resulting from the parsing phase
4569is also available using context methods.</p>
4570
4571<p>Contexts like nodes are defined as class and the libxml2 wrappers maps the
4572C function interfaces in terms of objects method as much as possible. The
4573best to get a complete view of what methods are supported is to look at the
4574libxml2.py module containing all the wrappers.</p>
4575
4576<h3>push.py:</h3>
4577
4578<p>This test show how to activate the push parser interface:</p>
4579<pre>import libxml2
4580
4581ctxt = libxml2.createPushParser(None, "&lt;foo", 4, "test.xml")
4582ctxt.parseChunk("/&gt;", 2, 1)
4583doc = ctxt.doc()
4584
4585doc.freeDoc()</pre>
4586
4587<p>The context is created with a special call based on the
4588xmlCreatePushParser() from the C library. The first argument is an optional
4589SAX callback object, then the initial set of data, the length and the name of
4590the resource in case URI-References need to be computed by the parser.</p>
4591
4592<p>Then the data are pushed using the parseChunk() method, the last call
4593setting the third argument terminate to 1.</p>
4594
4595<h3>pushSAX.py:</h3>
4596
4597<p>this test show the use of the event based parsing interfaces. In this case
4598the parser does not build a document, but provides callback information as
4599the parser makes progresses analyzing the data being provided:</p>
4600<pre>import libxml2
4601log = ""
4602
4603class callback:
4604    def startDocument(self):
4605        global log
4606        log = log + "startDocument:"
4607
4608    def endDocument(self):
4609        global log
4610        log = log + "endDocument:"
4611
4612    def startElement(self, tag, attrs):
4613        global log
4614        log = log + "startElement %s %s:" % (tag, attrs)
4615
4616    def endElement(self, tag):
4617        global log
4618        log = log + "endElement %s:" % (tag)
4619
4620    def characters(self, data):
4621        global log
4622        log = log + "characters: %s:" % (data)
4623
4624    def warning(self, msg):
4625        global log
4626        log = log + "warning: %s:" % (msg)
4627
4628    def error(self, msg):
4629        global log
4630        log = log + "error: %s:" % (msg)
4631
4632    def fatalError(self, msg):
4633        global log
4634        log = log + "fatalError: %s:" % (msg)
4635
4636handler = callback()
4637
4638ctxt = libxml2.createPushParser(handler, "&lt;foo", 4, "test.xml")
4639chunk = " url='tst'&gt;b"
4640ctxt.parseChunk(chunk, len(chunk), 0)
4641chunk = "ar&lt;/foo&gt;"
4642ctxt.parseChunk(chunk, len(chunk), 1)
4643
4644reference = "startDocument:startElement foo {'url': 'tst'}:" + \
4645            "characters: bar:endElement foo:endDocument:"
4646if log != reference:
4647    print "Error got: %s" % log
4648    print "Expected: %s" % reference</pre>
4649
4650<p>The key object in that test is the handler, it provides a number of entry
4651points which can be called by the parser as it makes progresses to indicate
4652the information set obtained. The full set of callback is larger than what
4653the callback class in that specific example implements (see the SAX
4654definition for a complete list). The wrapper will only call those supplied by
4655the object when activated. The startElement receives the names of the element
4656and a dictionary containing the attributes carried by this element.</p>
4657
4658<p>Also note that the reference string generated from the callback shows a
4659single character call even though the string "bar" is passed to the parser
4660from 2 different call to parseChunk()</p>
4661
4662<h3>xpath.py:</h3>
4663
4664<p>This is a basic test of XPath wrappers support</p>
4665<pre>import libxml2
4666
4667doc = libxml2.parseFile("tst.xml")
4668ctxt = doc.xpathNewContext()
4669res = ctxt.xpathEval("//*")
4670if len(res) != 2:
4671    print "xpath query: wrong node set size"
4672    sys.exit(1)
4673if res[0].name != "doc" or res[1].name != "foo":
4674    print "xpath query: wrong node set value"
4675    sys.exit(1)
4676doc.freeDoc()
4677ctxt.xpathFreeContext()</pre>
4678
4679<p>This test parses a file, then create an XPath context to evaluate XPath
4680expression on it. The xpathEval() method execute an XPath query and returns
4681the result mapped in a Python way. String and numbers are natively converted,
4682and node sets are returned as a tuple of libxml2 Python nodes wrappers. Like
4683the document, the XPath context need to be freed explicitly, also not that
4684the result of the XPath query may point back to the document tree and hence
4685the document must be freed after the result of the query is used.</p>
4686
4687<h3>xpathext.py:</h3>
4688
4689<p>This test shows how to extend the XPath engine with functions written in
4690python:</p>
4691<pre>import libxml2
4692
4693def foo(ctx, x):
4694    return x + 1
4695
4696doc = libxml2.parseFile("tst.xml")
4697ctxt = doc.xpathNewContext()
4698libxml2.registerXPathFunction(ctxt._o, "foo", None, foo)
4699res = ctxt.xpathEval("foo(1)")
4700if res != 2:
4701    print "xpath extension failure"
4702doc.freeDoc()
4703ctxt.xpathFreeContext()</pre>
4704
4705<p>Note how the extension function is registered with the context (but that
4706part is not yet finalized, this may change slightly in the future).</p>
4707
4708<h3>tstxpath.py:</h3>
4709
4710<p>This test is similar to the previous one but shows how the extension
4711function can access the XPath evaluation context:</p>
4712<pre>def foo(ctx, x):
4713    global called
4714
4715    #
4716    # test that access to the XPath evaluation contexts
4717    #
4718    pctxt = libxml2.xpathParserContext(_obj=ctx)
4719    ctxt = pctxt.context()
4720    called = ctxt.function()
4721    return x + 1</pre>
4722
4723<p>All the interfaces around the XPath parser(or rather evaluation) context
4724are not finalized, but it should be sufficient to do contextual work at the
4725evaluation point.</p>
4726
4727<h3>Memory debugging:</h3>
4728
4729<p>last but not least, all tests starts with the following prologue:</p>
4730<pre>#memory debug specific
4731libxml2.debugMemory(1)</pre>
4732
4733<p>and ends with the following epilogue:</p>
4734<pre>#memory debug specific
4735libxml2.cleanupParser()
4736if libxml2.debugMemory(1) == 0:
4737    print "OK"
4738else:
4739    print "Memory leak %d bytes" % (libxml2.debugMemory(1))
4740    libxml2.dumpMemory()</pre>
4741
4742<p>Those activate the memory debugging interface of libxml2 where all
4743allocated block in the library are tracked. The prologue then cleans up the
4744library state and checks that all allocated memory has been freed. If not it
4745calls dumpMemory() which saves that list in a <code>.memdump</code> file.</p>
4746
4747<h2><a name="architecture">libxml2 architecture</a></h2>
4748
4749<p>Libxml2 is made of multiple components; some of them are optional, and
4750most of the block interfaces are public. The main components are:</p>
4751<ul>
4752  <li>an Input/Output layer</li>
4753  <li>FTP and HTTP client layers (optional)</li>
4754  <li>an Internationalization layer managing the encodings support</li>
4755  <li>a URI module</li>
4756  <li>the XML parser and its basic SAX interface</li>
4757  <li>an HTML parser using the same SAX interface (optional)</li>
4758  <li>a SAX tree module to build an in-memory DOM representation</li>
4759  <li>a tree module to manipulate the DOM representation</li>
4760  <li>a validation module using the DOM representation (optional)</li>
4761  <li>an XPath module for global lookup in a DOM representation
4762  (optional)</li>
4763  <li>a debug module (optional)</li>
4764</ul>
4765
4766<p>Graphically this gives the following:</p>
4767
4768<p><img src="libxml.gif" alt="a graphical view of the various"></p>
4769
4770<p></p>
4771
4772<h2><a name="tree">The tree output</a></h2>
4773
4774<p>The parser returns a tree built during the document analysis. The value
4775returned is an <strong>xmlDocPtr</strong> (i.e., a pointer to an
4776<strong>xmlDoc</strong> structure). This structure contains information such
4777as the file name, the document type, and a <strong>children</strong> pointer
4778which is the root of the document (or more exactly the first child under the
4779root which is the document). The tree is made of <strong>xmlNode</strong>s,
4780chained in double-linked lists of siblings and with a children&lt;-&gt;parent
4781relationship. An xmlNode can also carry properties (a chain of xmlAttr
4782structures). An attribute may have a value which is a list of TEXT or
4783ENTITY_REF nodes.</p>
4784
4785<p>Here is an example (erroneous with respect to the XML spec since there
4786should be only one ELEMENT under the root):</p>
4787
4788<p><img src="structure.gif" alt=" structure.gif "></p>
4789
4790<p>In the source package there is a small program (not installed by default)
4791called <strong>xmllint</strong> which parses XML files given as argument and
4792prints them back as parsed. This is useful for detecting errors both in XML
4793code and in the XML parser itself. It has an option <strong>--debug</strong>
4794which prints the actual in-memory structure of the document; here is the
4795result with the <a href="#example">example</a> given before:</p>
4796<pre>DOCUMENT
4797version=1.0
4798standalone=true
4799  ELEMENT EXAMPLE
4800    ATTRIBUTE prop1
4801      TEXT
4802      content=gnome is great
4803    ATTRIBUTE prop2
4804      ENTITY_REF
4805      TEXT
4806      content= linux too
4807    ELEMENT head
4808      ELEMENT title
4809        TEXT
4810        content=Welcome to Gnome
4811    ELEMENT chapter
4812      ELEMENT title
4813        TEXT
4814        content=The Linux adventure
4815      ELEMENT p
4816        TEXT
4817        content=bla bla bla ...
4818      ELEMENT image
4819        ATTRIBUTE href
4820          TEXT
4821          content=linus.gif
4822      ELEMENT p
4823        TEXT
4824        content=...</pre>
4825
4826<p>This should be useful for learning the internal representation model.</p>
4827
4828<h2><a name="interface">The SAX interface</a></h2>
4829
4830<p>Sometimes the DOM tree output is just too large to fit reasonably into
4831memory. In that case (and if you don't expect to save back the XML document
4832loaded using libxml), it's better to use the SAX interface of libxml. SAX is
4833a <strong>callback-based interface</strong> to the parser. Before parsing,
4834the application layer registers a customized set of callbacks which are
4835called by the library as it progresses through the XML input.</p>
4836
4837<p>To get more detailed step-by-step guidance on using the SAX interface of
4838libxml, see the <a
4839href="http://www.jamesh.id.au/articles/libxml-sax/libxml-sax.html">nice
4840documentation</a>.written by <a href="mailto:james@daa.com.au">James
4841Henstridge</a>.</p>
4842
4843<p>You can debug the SAX behaviour by using the <strong>testSAX</strong>
4844program located in the gnome-xml module (it's usually not shipped in the
4845binary packages of libxml, but you can find it in the tar source
4846distribution). Here is the sequence of callbacks that would be reported by
4847testSAX when parsing the example XML document shown earlier:</p>
4848<pre>SAX.setDocumentLocator()
4849SAX.startDocument()
4850SAX.getEntity(amp)
4851SAX.startElement(EXAMPLE, prop1='gnome is great', prop2='&amp;amp; linux too')
4852SAX.characters(   , 3)
4853SAX.startElement(head)
4854SAX.characters(    , 4)
4855SAX.startElement(title)
4856SAX.characters(Welcome to Gnome, 16)
4857SAX.endElement(title)
4858SAX.characters(   , 3)
4859SAX.endElement(head)
4860SAX.characters(   , 3)
4861SAX.startElement(chapter)
4862SAX.characters(    , 4)
4863SAX.startElement(title)
4864SAX.characters(The Linux adventure, 19)
4865SAX.endElement(title)
4866SAX.characters(    , 4)
4867SAX.startElement(p)
4868SAX.characters(bla bla bla ..., 15)
4869SAX.endElement(p)
4870SAX.characters(    , 4)
4871SAX.startElement(image, href='linus.gif')
4872SAX.endElement(image)
4873SAX.characters(    , 4)
4874SAX.startElement(p)
4875SAX.characters(..., 3)
4876SAX.endElement(p)
4877SAX.characters(   , 3)
4878SAX.endElement(chapter)
4879SAX.characters( , 1)
4880SAX.endElement(EXAMPLE)
4881SAX.endDocument()</pre>
4882
4883<p>Most of the other interfaces of libxml2 are based on the DOM tree-building
4884facility, so nearly everything up to the end of this document presupposes the
4885use of the standard DOM tree build. Note that the DOM tree itself is built by
4886a set of registered default callbacks, without internal specific
4887interface.</p>
4888
4889<h2><a name="Validation">Validation &amp; DTDs</a></h2>
4890
4891<p>Table of Content:</p>
4892<ol>
4893  <li><a href="#General5">General overview</a></li>
4894  <li><a href="#definition">The definition</a></li>
4895  <li><a href="#Simple">Simple rules</a>
4896    <ol>
4897      <li><a href="#reference">How to reference a DTD from a document</a></li>
4898      <li><a href="#Declaring">Declaring elements</a></li>
4899      <li><a href="#Declaring1">Declaring attributes</a></li>
4900    </ol>
4901  </li>
4902  <li><a href="#Some">Some examples</a></li>
4903  <li><a href="#validate">How to validate</a></li>
4904  <li><a href="#Other">Other resources</a></li>
4905</ol>
4906
4907<h3><a name="General5">General overview</a></h3>
4908
4909<p>Well what is validation and what is a DTD ?</p>
4910
4911<p>DTD is the acronym for Document Type Definition. This is a description of
4912the content for a family of XML files. This is part of the XML 1.0
4913specification, and allows one to describe and verify that a given document
4914instance conforms to the set of rules detailing its structure and content.</p>
4915
4916<p>Validation is the process of checking a document against a DTD (more
4917generally against a set of construction rules).</p>
4918
4919<p>The validation process and building DTDs are the two most difficult parts
4920of the XML life cycle. Briefly a DTD defines all the possible elements to be
4921found within your document, what is the formal shape of your document tree
4922(by defining the allowed content of an element; either text, a regular
4923expression for the allowed list of children, or mixed content i.e. both text
4924and children). The DTD also defines the valid attributes for all elements and
4925the types of those attributes.</p>
4926
4927<h3><a name="definition1">The definition</a></h3>
4928
4929<p>The <a href="http://www.w3.org/TR/REC-xml">W3C XML Recommendation</a> (<a
4930href="http://www.xml.com/axml/axml.html">Tim Bray's annotated version of
4931Rev1</a>):</p>
4932<ul>
4933  <li><a href="http://www.w3.org/TR/REC-xml#elemdecls">Declaring
4934  elements</a></li>
4935  <li><a href="http://www.w3.org/TR/REC-xml#attdecls">Declaring
4936  attributes</a></li>
4937</ul>
4938
4939<p>(unfortunately) all this is inherited from the SGML world, the syntax is
4940ancient...</p>
4941
4942<h3><a name="Simple1">Simple rules</a></h3>
4943
4944<p>Writing DTDs can be done in many ways. The rules to build them if you need
4945something permanent or something which can evolve over time can be radically
4946different. Really complex DTDs like DocBook ones are flexible but quite
4947harder to design. I will just focus on DTDs for a formats with a fixed simple
4948structure. It is just a set of basic rules, and definitely not exhaustive nor
4949usable for complex DTD design.</p>
4950
4951<h4><a name="reference1">How to reference a DTD from a document</a>:</h4>
4952
4953<p>Assuming the top element of the document is <code>spec</code> and the dtd
4954is placed in the file <code>mydtd</code> in the subdirectory
4955<code>dtds</code> of the directory from where the document were loaded:</p>
4956
4957<p><code>&lt;!DOCTYPE spec SYSTEM "dtds/mydtd"&gt;</code></p>
4958
4959<p>Notes:</p>
4960<ul>
4961  <li>The system string is actually an URI-Reference (as defined in <a
4962    href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>) so you can use a
4963    full URL string indicating the location of your DTD on the Web. This is a
4964    really good thing to do if you want others to validate your document.</li>
4965  <li>It is also possible to associate a <code>PUBLIC</code> identifier (a
4966    magic string) so that the DTD is looked up in catalogs on the client side
4967    without having to locate it on the web.</li>
4968  <li>A DTD contains a set of element and attribute declarations, but they
4969    don't define what the root of the document should be. This is explicitly
4970    told to the parser/validator as the first element of the
4971    <code>DOCTYPE</code> declaration.</li>
4972</ul>
4973
4974<h4><a name="Declaring2">Declaring elements</a>:</h4>
4975
4976<p>The following declares an element <code>spec</code>:</p>
4977
4978<p><code>&lt;!ELEMENT spec (front, body, back?)&gt;</code></p>
4979
4980<p>It also expresses that the spec element contains one <code>front</code>,
4981one <code>body</code> and one optional <code>back</code> children elements in
4982this order. The declaration of one element of the structure and its content
4983are done in a single declaration. Similarly the following declares
4984<code>div1</code> elements:</p>
4985
4986<p><code>&lt;!ELEMENT div1 (head, (p | list | note)*, div2?)&gt;</code></p>
4987
4988<p>which means div1 contains one <code>head</code> then a series of optional
4989<code>p</code>, <code>list</code>s and <code>note</code>s and then an
4990optional <code>div2</code>. And last but not least an element can contain
4991text:</p>
4992
4993<p><code>&lt;!ELEMENT b (#PCDATA)&gt;</code></p>
4994
4995<p><code>b</code> contains text or being of mixed content (text and elements
4996in no particular order):</p>
4997
4998<p><code>&lt;!ELEMENT p (#PCDATA|a|ul|b|i|em)*&gt;</code></p>
4999
5000<p><code>p </code>can contain text or <code>a</code>, <code>ul</code>,
5001<code>b</code>, <code>i </code>or <code>em</code> elements in no particular
5002order.</p>
5003
5004<h4><a name="Declaring1">Declaring attributes</a>:</h4>
5005
5006<p>Again the attributes declaration includes their content definition:</p>
5007
5008<p><code>&lt;!ATTLIST termdef name CDATA #IMPLIED&gt;</code></p>
5009
5010<p>means that the element <code>termdef</code> can have a <code>name</code>
5011attribute containing text (<code>CDATA</code>) and which is optional
5012(<code>#IMPLIED</code>). The attribute value can also be defined within a
5013set:</p>
5014
5015<p><code>&lt;!ATTLIST list type (bullets|ordered|glossary)
5016"ordered"&gt;</code></p>
5017
5018<p>means <code>list</code> element have a <code>type</code> attribute with 3
5019allowed values "bullets", "ordered" or "glossary" and which default to
5020"ordered" if the attribute is not explicitly specified.</p>
5021
5022<p>The content type of an attribute can be text (<code>CDATA</code>),
5023anchor/reference/references
5024(<code>ID</code>/<code>IDREF</code>/<code>IDREFS</code>), entity(ies)
5025(<code>ENTITY</code>/<code>ENTITIES</code>) or name(s)
5026(<code>NMTOKEN</code>/<code>NMTOKENS</code>). The following defines that a
5027<code>chapter</code> element can have an optional <code>id</code> attribute
5028of type <code>ID</code>, usable for reference from attribute of type
5029IDREF:</p>
5030
5031<p><code>&lt;!ATTLIST chapter id ID #IMPLIED&gt;</code></p>
5032
5033<p>The last value of an attribute definition can be <code>#REQUIRED
5034</code>meaning that the attribute has to be given, <code>#IMPLIED</code>
5035meaning that it is optional, or the default value (possibly prefixed by
5036<code>#FIXED</code> if it is the only allowed).</p>
5037
5038<p>Notes:</p>
5039<ul>
5040  <li>Usually the attributes pertaining to a given element are declared in a
5041    single expression, but it is just a convention adopted by a lot of DTD
5042    writers:
5043    <pre>&lt;!ATTLIST termdef
5044          id      ID      #REQUIRED
5045          name    CDATA   #IMPLIED&gt;</pre>
5046    <p>The previous construct defines both <code>id</code> and
5047    <code>name</code> attributes for the element <code>termdef</code>.</p>
5048  </li>
5049</ul>
5050
5051<h3><a name="Some1">Some examples</a></h3>
5052
5053<p>The directory <code>test/valid/dtds/</code> in the libxml2 distribution
5054contains some complex DTD examples. The example in the file
5055<code>test/valid/dia.xml</code> shows an XML file where the simple DTD is
5056directly included within the document.</p>
5057
5058<h3><a name="validate1">How to validate</a></h3>
5059
5060<p>The simplest way is to use the xmllint program included with libxml. The
5061<code>--valid</code> option turns-on validation of the files given as input.
5062For example the following validates a copy of the first revision of the XML
50631.0 specification:</p>
5064
5065<p><code>xmllint --valid --noout test/valid/REC-xml-19980210.xml</code></p>
5066
5067<p>the -- noout is used to disable output of the resulting tree.</p>
5068
5069<p>The <code>--dtdvalid dtd</code> allows validation of the document(s)
5070against a given DTD.</p>
5071
5072<p>Libxml2 exports an API to handle DTDs and validation, check the <a
5073href="http://xmlsoft.org/html/libxml-valid.html">associated
5074description</a>.</p>
5075
5076<h3><a name="Other1">Other resources</a></h3>
5077
5078<p>DTDs are as old as SGML. So there may be a number of examples on-line, I
5079will just list one for now, others pointers welcome:</p>
5080<ul>
5081  <li><a href="http://www.xml101.com:8081/dtd/">XML-101 DTD</a></li>
5082</ul>
5083
5084<p>I suggest looking at the examples found under test/valid/dtd and any of
5085the large number of books available on XML. The dia example in test/valid
5086should be both simple and complete enough to allow you to build your own.</p>
5087
5088<p></p>
5089
5090<h2><a name="Memory">Memory Management</a></h2>
5091
5092<p>Table of Content:</p>
5093<ol>
5094  <li><a href="#General3">General overview</a></li>
5095  <li><a href="#setting">Setting libxml2 set of memory routines</a></li>
5096  <li><a href="#cleanup">Cleaning up after using the library</a></li>
5097  <li><a href="#Debugging">Debugging routines</a></li>
5098  <li><a href="#General4">General memory requirements</a></li>
5099  <li><a href="#Compacting">Returning memory to the kernel</a></li>
5100</ol>
5101
5102<h3><a name="General3">General overview</a></h3>
5103
5104<p>The module <code><a
5105href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlmemory.h</a></code>
5106provides the interfaces to the libxml2 memory system:</p>
5107<ul>
5108  <li>libxml2 does not use the libc memory allocator directly but xmlFree(),
5109    xmlMalloc() and xmlRealloc()</li>
5110  <li>those routines can be reallocated to a specific set of routine, by
5111    default the libc ones i.e. free(), malloc() and realloc()</li>
5112  <li>the xmlmemory.c module includes a set of debugging routine</li>
5113</ul>
5114
5115<h3><a name="setting">Setting libxml2 set of memory routines</a></h3>
5116
5117<p>It is sometimes useful to not use the default memory allocator, either for
5118debugging, analysis or to implement a specific behaviour on memory management
5119(like on embedded systems). Two function calls are available to do so:</p>
5120<ul>
5121  <li><a href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemGet
5122    ()</a> which return the current set of functions in use by the parser</li>
5123  <li><a
5124    href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemSetup()</a>
5125    which allow to set up a new set of memory allocation functions</li>
5126</ul>
5127
5128<p>Of course a call to xmlMemSetup() should probably be done before calling
5129any other libxml2 routines (unless you are sure your allocations routines are
5130compatibles).</p>
5131
5132<h3><a name="cleanup">Cleaning up after using the library</a></h3>
5133
5134<p>Libxml2 is not stateless, there is a few set of memory structures needing
5135allocation before the parser is fully functional (some encoding structures
5136for example). This also mean that once parsing is finished there is a tiny
5137amount of memory (a few hundred bytes) which can be recollected if you don't
5138reuse the library or any document built with it:</p>
5139<ul>
5140  <li><a href="http://xmlsoft.org/html/libxml-parser.html">xmlCleanupParser
5141    ()</a> is a centralized routine to free the library state and data. Note
5142    that it won't deallocate any produced tree if any (use the xmlFreeDoc()
5143    and related routines for this). This should be called only when the library
5144    is not used anymore.</li>
5145  <li><a href="http://xmlsoft.org/html/libxml-parser.html">xmlInitParser
5146    ()</a> is the dual routine allowing to preallocate the parsing state
5147    which can be useful for example to avoid initialization reentrancy
5148    problems when using libxml2 in multithreaded applications</li>
5149</ul>
5150
5151<p>Generally xmlCleanupParser() is safe assuming no parsing is ongoing and
5152no document is still being used, if needed the state will be rebuild at the
5153next invocation of parser routines (or by xmlInitParser()), but be careful
5154of the consequences in multithreaded applications.</p>
5155
5156<h3><a name="Debugging">Debugging routines</a></h3>
5157
5158<p>When configured using --with-mem-debug flag (off by default), libxml2 uses
5159a set of memory allocation debugging routines keeping track of all allocated
5160blocks and the location in the code where the routine was called. A couple of
5161other debugging routines allow to dump the memory allocated infos to a file
5162or call a specific routine when a given block number is allocated:</p>
5163<ul>
5164  <li><a
5165    href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMallocLoc()</a>
5166    <a
5167    href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlReallocLoc()</a>
5168    and <a
5169    href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemStrdupLoc()</a>
5170    are the memory debugging replacement allocation routines</li>
5171  <li><a href="http://xmlsoft.org/html/libxml-xmlmemory.html">xmlMemoryDump
5172    ()</a> dumps all the information about the allocated memory block lefts
5173    in the <code>.memdump</code> file</li>
5174</ul>
5175
5176<p>When developing libxml2 memory debug is enabled, the tests programs call
5177xmlMemoryDump () and the "make test" regression tests will check for any
5178memory leak during the full regression test sequence, this helps a lot
5179ensuring that libxml2  does not leak memory and bullet proof memory
5180allocations use (some libc implementations are known to be far too permissive
5181resulting in major portability problems!).</p>
5182
5183<p>If the .memdump reports a leak, it displays the allocation function and
5184also tries to give some information about the content and structure of the
5185allocated blocks left. This is sufficient in most cases to find the culprit,
5186but not always. Assuming the allocation problem is reproducible, it is
5187possible to find more easily:</p>
5188<ol>
5189  <li>write down the block number xxxx not allocated</li>
5190  <li>export the environment variable XML_MEM_BREAKPOINT=xxxx , the easiest
5191    when using GDB is to simply give the command
5192    <p><code>set environment XML_MEM_BREAKPOINT xxxx</code></p>
5193    <p>before running the program.</p>
5194  </li>
5195  <li>run the program under a debugger and set a breakpoint on
5196    xmlMallocBreakpoint() a specific function called when this precise block
5197    is allocated</li>
5198  <li>when the breakpoint is reached you can then do a fine analysis of the
5199    allocation an step  to see the condition resulting in the missing
5200    deallocation.</li>
5201</ol>
5202
5203<p>I used to use a commercial tool to debug libxml2 memory problems but after
5204noticing that it was not detecting memory leaks that simple mechanism was
5205used and proved extremely efficient until now. Lately I have also used <a
5206href="http://developer.kde.org/~sewardj/">valgrind</a> with quite some
5207success, it is tied to the i386 architecture since it works by emulating the
5208processor and instruction set, it is slow but  extremely efficient, i.e. it
5209spot memory usage errors in a very precise way.</p>
5210
5211<h3><a name="General4">General memory requirements</a></h3>
5212
5213<p>How much libxml2 memory require ? It's hard to tell in average it depends
5214of a number of things:</p>
5215<ul>
5216  <li>the parser itself should work  in a fixed amount of memory, except for
5217    information maintained about the stacks of names and  entities locations.
5218    The I/O and encoding handlers will probably account for a few KBytes.
5219    This is true for both the XML and HTML parser (though the HTML parser
5220    need more state).</li>
5221  <li>If you are generating the DOM tree then memory requirements will grow
5222    nearly linear with the size of the data. In general for a balanced
5223    textual document the internal memory requirement is about 4 times the
5224    size of the UTF8 serialization of this document (example the XML-1.0
5225    recommendation is a bit more of 150KBytes and takes 650KBytes of main
5226    memory when parsed). Validation will add a amount of memory required for
5227    maintaining the external Dtd state which should be linear with the
5228    complexity of the content model defined by the Dtd</li>
5229  <li>If you need to work with fixed memory requirements or don't need the
5230    full DOM tree then using the <a href="xmlreader.html">xmlReader
5231    interface</a> is probably the best way to proceed, it still allows to
5232    validate or operate on subset of the tree if needed.</li>
5233  <li>If you don't care about the advanced features of libxml2 like
5234    validation, DOM, XPath or XPointer, don't use entities, need to work with
5235    fixed memory requirements, and try to get the fastest parsing possible
5236    then the SAX interface should be used, but it has known restrictions.</li>
5237</ul>
5238
5239<p></p>
5240<h3><a name="Compacting">Returning memory to the kernel</a></h3>
5241
5242<p>You may encounter that your process using libxml2 does not have a
5243reduced memory usage although you freed the trees. This is because
5244libxml2 allocates memory in a number of small chunks. When freeing one
5245of those chunks, the OS may decide that giving this little memory back
5246to the kernel will cause too much overhead and delay the operation. As
5247all chunks are this small, they get actually freed but not returned to
5248the kernel. On systems using glibc, there is a function call
5249"malloc_trim" from malloc.h which does this missing operation (note that
5250it is allowed to fail). Thus, after freeing your tree you may simply try
5251"malloc_trim(0);" to really get the memory back. If your OS does not
5252provide malloc_trim, try searching for a similar function.</p>
5253<p></p>
5254
5255<h2><a name="Encodings">Encodings support</a></h2>
5256
5257<p>If you are not really familiar with Internationalization (usual shortcut
5258is I18N) , Unicode, characters and glyphs, I suggest you read a <a
5259href="http://www.tbray.org/ongoing/When/200x/2003/04/06/Unicode">presentation</a>
5260by Tim Bray on Unicode and why you should care about it.</p>
5261
5262<p>If you don't understand why <b>it does not make sense to have a string
5263without knowing what encoding it uses</b>, then as Joel Spolsky said <a
5264href="http://www.joelonsoftware.com/articles/Unicode.html">please do not
5265write another line of code until you finish reading that article.</a>. It is
5266a prerequisite to understand this page, and avoid a lot of problems with
5267libxml2, XML or text processing in general.</p>
5268
5269<p>Table of Content:</p>
5270<ol>
5271  <li><a href="encoding.html#What">What does internationalization support
5272    mean ?</a></li>
5273  <li><a href="encoding.html#internal">The internal encoding, how and
5274  why</a></li>
5275  <li><a href="encoding.html#implemente">How is it implemented ?</a></li>
5276  <li><a href="encoding.html#Default">Default supported encodings</a></li>
5277  <li><a href="encoding.html#extend">How to extend the existing
5278  support</a></li>
5279</ol>
5280
5281<h3><a name="What">What does internationalization support mean ?</a></h3>
5282
5283<p>XML was designed from the start to allow the support of any character set
5284by using Unicode. Any conformant XML parser has to support the UTF-8 and
5285UTF-16 default encodings which can both express the full unicode ranges. UTF8
5286is a variable length encoding whose greatest points are to reuse the same
5287encoding for ASCII and to save space for Western encodings, but it is a bit
5288more complex to handle in practice. UTF-16 use 2 bytes per character (and
5289sometimes combines two pairs), it makes implementation easier, but looks a
5290bit overkill for Western languages encoding. Moreover the XML specification
5291allows the document to be encoded in other encodings at the condition that
5292they are clearly labeled as such. For example the following is a wellformed
5293XML document encoded in ISO-8859-1 and using accentuated letters that we
5294French like for both markup and content:</p>
5295<pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
5296&lt;tr&egrave;s&gt;l&agrave; &lt;/tr&egrave;s&gt;</pre>
5297
5298<p>Having internationalization support in libxml2 means the following:</p>
5299<ul>
5300  <li>the document is properly parsed</li>
5301  <li>information about it's encoding is saved</li>
5302  <li>it can be modified</li>
5303  <li>it can be saved in its original encoding</li>
5304  <li>it can also be saved in another encoding supported by libxml2 (for
5305    example straight UTF8 or even an ASCII form)</li>
5306</ul>
5307
5308<p>Another very important point is that the whole libxml2 API, with the
5309exception of a few routines to read with a specific encoding or save to a
5310specific encoding, is completely agnostic about the original encoding of the
5311document.</p>
5312
5313<p>It should be noted too that the HTML parser embedded in libxml2 now obey
5314the same rules too, the following document will be (as of 2.2.2) handled  in
5315an internationalized fashion by libxml2 too:</p>
5316<pre>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
5317                      "http://www.w3.org/TR/REC-html40/loose.dtd"&gt;
5318&lt;html lang="fr"&gt;
5319&lt;head&gt;
5320  &lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"&gt;
5321&lt;/head&gt;
5322&lt;body&gt;
5323&lt;p&gt;W3C cr&eacute;e des standards pour le Web.&lt;/body&gt;
5324&lt;/html&gt;</pre>
5325
5326<h3><a name="internal">The internal encoding, how and why</a></h3>
5327
5328<p>One of the core decisions was to force all documents to be converted to a
5329default internal encoding, and that encoding to be UTF-8, here are the
5330rationales for those choices:</p>
5331<ul>
5332  <li>keeping the native encoding in the internal form would force the libxml
5333    users (or the code associated) to be fully aware of the encoding of the
5334    original document, for examples when adding a text node to a document,
5335    the content would have to be provided in the document encoding, i.e. the
5336    client code would have to check it before hand, make sure it's conformant
5337    to the encoding, etc ... Very hard in practice, though in some specific
5338    cases this may make sense.</li>
5339  <li>the second decision was which encoding. From the XML spec only UTF8 and
5340    UTF16 really makes sense as being the two only encodings for which there
5341    is mandatory support. UCS-4 (32 bits fixed size encoding) could be
5342    considered an intelligent choice too since it's a direct Unicode mapping
5343    support. I selected UTF-8 on the basis of efficiency and compatibility
5344    with surrounding software:
5345    <ul>
5346      <li>UTF-8 while a bit more complex to convert from/to (i.e. slightly
5347        more costly to import and export CPU wise) is also far more compact
5348        than UTF-16 (and UCS-4) for a majority of the documents I see it used
5349        for right now (RPM RDF catalogs, advogato data, various configuration
5350        file formats, etc.) and the key point for today's computer
5351        architecture is efficient uses of caches. If one nearly double the
5352        memory requirement to store the same amount of data, this will trash
5353        caches (main memory/external caches/internal caches) and my take is
5354        that this harms the system far more than the CPU requirements needed
5355        for the conversion to UTF-8</li>
5356      <li>Most of libxml2 version 1 users were using it with straight ASCII
5357        most of the time, doing the conversion with an internal encoding
5358        requiring all their code to be rewritten was a serious show-stopper
5359        for using UTF-16 or UCS-4.</li>
5360      <li>UTF-8 is being used as the de-facto internal encoding standard for
5361        related code like the <a href="http://www.pango.org/">pango</a>
5362        upcoming Gnome text widget, and a lot of Unix code (yet another place
5363        where Unix programmer base takes a different approach from Microsoft
5364        - they are using UTF-16)</li>
5365    </ul>
5366  </li>
5367</ul>
5368
5369<p>What does this mean in practice for the libxml2 user:</p>
5370<ul>
5371  <li>xmlChar, the libxml2 data type is a byte, those bytes must be assembled
5372    as UTF-8 valid strings. The proper way to terminate an xmlChar * string
5373    is simply to append 0 byte, as usual.</li>
5374  <li>One just need to make sure that when using chars outside the ASCII set,
5375    the values has been properly converted to UTF-8</li>
5376</ul>
5377
5378<h3><a name="implemente">How is it implemented ?</a></h3>
5379
5380<p>Let's describe how all this works within libxml, basically the I18N
5381(internationalization) support get triggered only during I/O operation, i.e.
5382when reading a document or saving one. Let's look first at the reading
5383sequence:</p>
5384<ol>
5385  <li>when a document is processed, we usually don't know the encoding, a
5386    simple heuristic allows to detect UTF-16 and UCS-4 from encodings where
5387    the ASCII range (0-0x7F) maps with ASCII</li>
5388  <li>the xml declaration if available is parsed, including the encoding
5389    declaration. At that point, if the autodetected encoding is different
5390    from the one declared a call to xmlSwitchEncoding() is issued.</li>
5391  <li>If there is no encoding declaration, then the input has to be in either
5392    UTF-8 or UTF-16, if it is not then at some point when processing the
5393    input, the converter/checker of UTF-8 form will raise an encoding error.
5394    You may end-up with a garbled document, or no document at all ! Example:
5395    <pre>~/XML -&gt; ./xmllint err.xml
5396err.xml:1: error: Input is not proper UTF-8, indicate encoding !
5397&lt;tr&egrave;s&gt;l&agrave; &lt;/tr&egrave;s&gt;
5398   ^
5399err.xml:1: error: Bytes: 0xE8 0x73 0x3E 0x6C
5400&lt;tr&egrave;s&gt;l&agrave; &lt;/tr&egrave;s&gt;
5401   ^</pre>
5402  </li>
5403  <li>xmlSwitchEncoding() does an encoding name lookup, canonicalize it, and
5404    then search the default registered encoding converters for that encoding.
5405    If it's not within the default set and iconv() support has been compiled
5406    it, it will ask iconv for such an encoder. If this fails then the parser
5407    will report an error and stops processing:
5408    <pre>~/XML -&gt; ./xmllint err2.xml
5409err2.xml:1: error: Unsupported encoding UnsupportedEnc
5410&lt;?xml version="1.0" encoding="UnsupportedEnc"?&gt;
5411                                             ^</pre>
5412  </li>
5413  <li>From that point the encoder processes progressively the input (it is
5414    plugged as a front-end to the I/O module) for that entity. It captures
5415    and converts on-the-fly the document to be parsed to UTF-8. The parser
5416    itself just does UTF-8 checking of this input and process it
5417    transparently. The only difference is that the encoding information has
5418    been added to the parsing context (more precisely to the input
5419    corresponding to this entity).</li>
5420  <li>The result (when using DOM) is an internal form completely in UTF-8
5421    with just an encoding information on the document node.</li>
5422</ol>
5423
5424<p>Ok then what happens when saving the document (assuming you
5425collected/built an xmlDoc DOM like structure) ? It depends on the function
5426called, xmlSaveFile() will just try to save in the original encoding, while
5427xmlSaveFileTo() and xmlSaveFileEnc() can optionally save to a given
5428encoding:</p>
5429<ol>
5430  <li>if no encoding is given, libxml2 will look for an encoding value
5431    associated to the document and if it exists will try to save to that
5432    encoding,
5433    <p>otherwise everything is written in the internal form, i.e. UTF-8</p>
5434  </li>
5435  <li>so if an encoding was specified, either at the API level or on the
5436    document, libxml2 will again canonicalize the encoding name, lookup for a
5437    converter in the registered set or through iconv. If not found the
5438    function will return an error code</li>
5439  <li>the converter is placed before the I/O buffer layer, as another kind of
5440    buffer, then libxml2 will simply push the UTF-8 serialization to through
5441    that buffer, which will then progressively be converted and pushed onto
5442    the I/O layer.</li>
5443  <li>It is possible that the converter code fails on some input, for example
5444    trying to push an UTF-8 encoded Chinese character through the UTF-8 to
5445    ISO-8859-1 converter won't work. Since the encoders are progressive they
5446    will just report the error and the number of bytes converted, at that
5447    point libxml2 will decode the offending character, remove it from the
5448    buffer and replace it with the associated charRef encoding &amp;#123; and
5449    resume the conversion. This guarantees that any document will be saved
5450    without losses (except for markup names where this is not legal, this is
5451    a problem in the current version, in practice avoid using non-ascii
5452    characters for tag or attribute names). A special "ascii" encoding name
5453    is used to save documents to a pure ascii form can be used when
5454    portability is really crucial</li>
5455</ol>
5456
5457<p>Here are a few examples based on the same test document and assumin a
5458terminal using ISO-8859-1 as the text encoding:</p>
5459<pre>~/XML -&gt; ./xmllint isolat1
5460&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
5461&lt;tr&egrave;s&gt;là&lt;/tr&egrave;s&gt;
5462~/XML -&gt; ./xmllint --encode UTF-8 isolat1
5463&lt;?xml version="1.0" encoding="UTF-8"?&gt;
5464&lt;très&gt;là &nbsp;&lt;/très&gt;
5465~/XML -&gt; </pre>
5466
5467<p>The same processing is applied (and reuse most of the code) for HTML I18N
5468processing. Looking up and modifying the content encoding is a bit more
5469difficult since it is located in a &lt;meta&gt; tag under the &lt;head&gt;,
5470so a couple of functions htmlGetMetaEncoding() and htmlSetMetaEncoding() have
5471been provided. The parser also attempts to switch encoding on the fly when
5472detecting such a tag on input. Except for that the processing is the same
5473(and again reuses the same code).</p>
5474
5475<h3><a name="Default">Default supported encodings</a></h3>
5476
5477<p>libxml2 has a set of default converters for the following encodings
5478(located in encoding.c):</p>
5479<ol>
5480  <li>UTF-8 is supported by default (null handlers)</li>
5481  <li>UTF-16, both little and big endian</li>
5482  <li>ISO-Latin-1 (ISO-8859-1) covering most western languages</li>
5483  <li>ASCII, useful mostly for saving</li>
5484  <li>HTML, a specific handler for the conversion of UTF-8 to ASCII with HTML
5485    predefined entities like &amp;copy; for the Copyright sign.</li>
5486</ol>
5487
5488<p>More over when compiled on an Unix platform with iconv support the full
5489set of encodings supported by iconv can be instantly be used by libxml. On a
5490linux machine with glibc-2.1 the list of supported encodings and aliases fill
54913 full pages, and include UCS-4, the full set of ISO-Latin encodings, and the
5492various Japanese ones.</p>
5493
5494<p>To convert from the UTF-8 values returned from the API to another encoding
5495then it is possible to use the function provided from <a
5496href="html/libxml-encoding.html">the encoding module</a> like <a
5497href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a>, or use the
5498POSIX <a
5499href="http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html">iconv()</a>
5500API directly.</p>
5501
5502<h4>Encoding aliases</h4>
5503
5504<p>From 2.2.3, libxml2 has support to register encoding names aliases. The
5505goal is to be able to parse document whose encoding is supported but where
5506the name differs (for example from the default set of names accepted by
5507iconv). The following functions allow to register and handle new aliases for
5508existing encodings. Once registered libxml2 will automatically lookup the
5509aliases when handling a document:</p>
5510<ul>
5511  <li>int xmlAddEncodingAlias(const char *name, const char *alias);</li>
5512  <li>int xmlDelEncodingAlias(const char *alias);</li>
5513  <li>const char * xmlGetEncodingAlias(const char *alias);</li>
5514  <li>void xmlCleanupEncodingAliases(void);</li>
5515</ul>
5516
5517<h3><a name="extend">How to extend the existing support</a></h3>
5518
5519<p>Well adding support for new encoding, or overriding one of the encoders
5520(assuming it is buggy) should not be hard, just write input and output
5521conversion routines to/from UTF-8, and register them using
5522xmlNewCharEncodingHandler(name, xxxToUTF8, UTF8Toxxx),  and they will be
5523called automatically if the parser(s) encounter such an encoding name
5524(register it uppercase, this will help). The description of the encoders,
5525their arguments and expected return values are described in the encoding.h
5526header.</p>
5527
5528<h2><a name="IO">I/O Interfaces</a></h2>
5529
5530<p>Table of Content:</p>
5531<ol>
5532  <li><a href="#General1">General overview</a></li>
5533  <li><a href="#basic">The basic buffer type</a></li>
5534  <li><a href="#Input">Input I/O handlers</a></li>
5535  <li><a href="#Output">Output I/O handlers</a></li>
5536  <li><a href="#entities">The entities loader</a></li>
5537  <li><a href="#Example2">Example of customized I/O</a></li>
5538</ol>
5539
5540<h3><a name="General1">General overview</a></h3>
5541
5542<p>The module <code><a
5543href="http://xmlsoft.org/html/libxml-xmlio.html">xmlIO.h</a></code> provides
5544the interfaces to the libxml2 I/O system. This consists of 4 main parts:</p>
5545<ul>
5546  <li>Entities loader, this is a routine which tries to fetch the entities
5547    (files) based on their PUBLIC and SYSTEM identifiers. The default loader
5548    don't look at the public identifier since libxml2 do not maintain a
5549    catalog. You can redefine you own entity loader by using
5550    <code>xmlGetExternalEntityLoader()</code> and
5551    <code>xmlSetExternalEntityLoader()</code>. <a href="#entities">Check the
5552    example</a>.</li>
5553  <li>Input I/O buffers which are a commodity structure used by the parser(s)
5554    input layer to handle fetching the information to feed the parser. This
5555    provides buffering and is also a placeholder where the encoding
5556    converters to UTF8 are piggy-backed.</li>
5557  <li>Output I/O buffers are similar to the Input ones and fulfill similar
5558    task but when generating a serialization from a tree.</li>
5559  <li>A mechanism to register sets of I/O callbacks and associate them with
5560    specific naming schemes like the protocol part of the URIs.
5561    <p>This affect the default I/O operations and allows to use specific I/O
5562    handlers for certain names.</p>
5563  </li>
5564</ul>
5565
5566<p>The general mechanism used when loading http://rpmfind.net/xml.html for
5567example in the HTML parser is the following:</p>
5568<ol>
5569  <li>The default entity loader calls <code>xmlNewInputFromFile()</code> with
5570    the parsing context and the URI string.</li>
5571  <li>the URI string is checked against the existing registered handlers
5572    using their match() callback function, if the HTTP module was compiled
5573    in, it is registered and its match() function will succeeds</li>
5574  <li>the open() function of the handler is called and if successful will
5575    return an I/O Input buffer</li>
5576  <li>the parser will the start reading from this buffer and progressively
5577    fetch information from the resource, calling the read() function of the
5578    handler until the resource is exhausted</li>
5579  <li>if an encoding change is detected it will be installed on the input
5580    buffer, providing buffering and efficient use of the conversion
5581  routines</li>
5582  <li>once the parser has finished, the close() function of the handler is
5583    called once and the Input buffer and associated resources are
5584  deallocated.</li>
5585</ol>
5586
5587<p>The user defined callbacks are checked first to allow overriding of the
5588default libxml2 I/O routines.</p>
5589
5590<h3><a name="basic">The basic buffer type</a></h3>
5591
5592<p>All the buffer manipulation handling is done using the
5593<code>xmlBuffer</code> type define in <code><a
5594href="http://xmlsoft.org/html/libxml-tree.html">tree.h</a> </code>which is a
5595resizable memory buffer. The buffer allocation strategy can be selected to be
5596either best-fit or use an exponential doubling one (CPU vs. memory use
5597trade-off). The values are <code>XML_BUFFER_ALLOC_EXACT</code> and
5598<code>XML_BUFFER_ALLOC_DOUBLEIT</code>, and can be set individually or on a
5599system wide basis using <code>xmlBufferSetAllocationScheme()</code>. A number
5600of functions allows to manipulate buffers with names starting with the
5601<code>xmlBuffer...</code> prefix.</p>
5602
5603<h3><a name="Input">Input I/O handlers</a></h3>
5604
5605<p>An Input I/O handler is a simple structure
5606<code>xmlParserInputBuffer</code> containing a context associated to the
5607resource (file descriptor, or pointer to a protocol handler), the read() and
5608close() callbacks to use and an xmlBuffer. And extra xmlBuffer and a charset
5609encoding handler are also present to support charset conversion when
5610needed.</p>
5611
5612<h3><a name="Output">Output I/O handlers</a></h3>
5613
5614<p>An Output handler <code>xmlOutputBuffer</code> is completely similar to an
5615Input one except the callbacks are write() and close().</p>
5616
5617<h3><a name="entities">The entities loader</a></h3>
5618
5619<p>The entity loader resolves requests for new entities and create inputs for
5620the parser. Creating an input from a filename or an URI string is done
5621through the xmlNewInputFromFile() routine.  The default entity loader do not
5622handle the PUBLIC identifier associated with an entity (if any). So it just
5623calls xmlNewInputFromFile() with the SYSTEM identifier (which is mandatory in
5624XML).</p>
5625
5626<p>If you want to hook up a catalog mechanism then you simply need to
5627override the default entity loader, here is an example:</p>
5628<pre>#include &lt;libxml/xmlIO.h&gt;
5629
5630xmlExternalEntityLoader defaultLoader = NULL;
5631
5632xmlParserInputPtr
5633xmlMyExternalEntityLoader(const char *URL, const char *ID,
5634                               xmlParserCtxtPtr ctxt) {
5635    xmlParserInputPtr ret;
5636    const char *fileID = NULL;
5637    /* lookup for the fileID depending on ID */
5638
5639    ret = xmlNewInputFromFile(ctxt, fileID);
5640    if (ret != NULL)
5641        return(ret);
5642    if (defaultLoader != NULL)
5643        ret = defaultLoader(URL, ID, ctxt);
5644    return(ret);
5645}
5646
5647int main(..) {
5648    ...
5649
5650    /*
5651     * Install our own entity loader
5652     */
5653    defaultLoader = xmlGetExternalEntityLoader();
5654    xmlSetExternalEntityLoader(xmlMyExternalEntityLoader);
5655
5656    ...
5657}</pre>
5658
5659<h3><a name="Example2">Example of customized I/O</a></h3>
5660
5661<p>This example come from <a href="http://xmlsoft.org/messages/0708.html">a
5662real use case</a>,  xmlDocDump() closes the FILE * passed by the application
5663and this was a problem. The <a
5664href="http://xmlsoft.org/messages/0711.html">solution</a> was to redefine a
5665new output handler with the closing call deactivated:</p>
5666<ol>
5667  <li>First define a new I/O output allocator where the output don't close
5668    the file:
5669    <pre>xmlOutputBufferPtr
5670xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
5671&nbsp;&nbsp;&nbsp;&nbsp;xmlOutputBufferPtr ret;
5672&nbsp;&nbsp;&nbsp;&nbsp;
5673&nbsp;&nbsp;&nbsp;&nbsp;if (xmlOutputCallbackInitialized == 0)
5674&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlRegisterDefaultOutputCallbacks();
5675
5676&nbsp;&nbsp;&nbsp;&nbsp;if (file == NULL) return(NULL);
5677&nbsp;&nbsp;&nbsp;&nbsp;ret = xmlAllocOutputBuffer(encoder);
5678&nbsp;&nbsp;&nbsp;&nbsp;if (ret != NULL) {
5679&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret-&gt;context = file;
5680&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret-&gt;writecallback = xmlFileWrite;
5681&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret-&gt;closecallback = NULL;  /* No close callback */
5682&nbsp;&nbsp;&nbsp;&nbsp;}
5683&nbsp;&nbsp;&nbsp;&nbsp;return(ret);
5684} </pre>
5685  </li>
5686  <li>And then use it to save the document:
5687    <pre>FILE *f;
5688xmlOutputBufferPtr output;
5689xmlDocPtr doc;
5690int res;
5691
5692f = ...
5693doc = ....
5694
5695output = xmlOutputBufferCreateOwn(f, NULL);
5696res = xmlSaveFileTo(output, doc, NULL);
5697    </pre>
5698  </li>
5699</ol>
5700
5701<h2><a name="Catalog">Catalog support</a></h2>
5702
5703<p>Table of Content:</p>
5704<ol>
5705  <li><a href="General2">General overview</a></li>
5706  <li><a href="#definition">The definition</a></li>
5707  <li><a href="#Simple">Using catalogs</a></li>
5708  <li><a href="#Some">Some examples</a></li>
5709  <li><a href="#reference">How to tune  catalog usage</a></li>
5710  <li><a href="#validate">How to debug catalog processing</a></li>
5711  <li><a href="#Declaring">How to create and maintain catalogs</a></li>
5712  <li><a href="#implemento">The implementor corner quick review of the
5713  API</a></li>
5714  <li><a href="#Other">Other resources</a></li>
5715</ol>
5716
5717<h3><a name="General2">General overview</a></h3>
5718
5719<p>What is a catalog? Basically it's a lookup mechanism used when an entity
5720(a file or a remote resource) references another entity. The catalog lookup
5721is inserted between the moment the reference is recognized by the software
5722(XML parser, stylesheet processing, or even images referenced for inclusion
5723in a rendering) and the time where loading that resource is actually
5724started.</p>
5725
5726<p>It is basically used for 3 things:</p>
5727<ul>
5728  <li>mapping from "logical" names, the public identifiers and a more
5729    concrete name usable for download (and URI). For example it can associate
5730    the logical name
5731    <p>"-//OASIS//DTD DocBook XML V4.1.2//EN"</p>
5732    <p>of the DocBook 4.1.2 XML DTD with the actual URL where it can be
5733    downloaded</p>
5734    <p>http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd</p>
5735  </li>
5736  <li>remapping from a given URL to another one, like an HTTP indirection
5737    saying that
5738    <p>"http://www.oasis-open.org/committes/tr.xsl"</p>
5739    <p>should really be looked at</p>
5740    <p>"http://www.oasis-open.org/committes/entity/stylesheets/base/tr.xsl"</p>
5741  </li>
5742  <li>providing a local cache mechanism allowing to load the entities
5743    associated to public identifiers or remote resources, this is a really
5744    important feature for any significant deployment of XML or SGML since it
5745    allows to avoid the aleas and delays associated to fetching remote
5746    resources.</li>
5747</ul>
5748
5749<h3><a name="definition">The definitions</a></h3>
5750
5751<p>Libxml, as of 2.4.3 implements 2 kind of catalogs:</p>
5752<ul>
5753  <li>the older SGML catalogs, the official spec is  SGML Open Technical
5754    Resolution TR9401:1997, but is better understood by reading <a
5755    href="http://www.jclark.com/sp/catalog.htm">the SP Catalog page</a> from
5756    James Clark. This is relatively old and not the preferred mode of
5757    operation of libxml.</li>
5758  <li><a href="http://www.oasis-open.org/committees/entity/spec.html">XML
5759    Catalogs</a> is far more flexible, more recent, uses an XML syntax and
5760    should scale quite better. This is the default option of libxml.</li>
5761</ul>
5762
5763<p></p>
5764
5765<h3><a name="Simple">Using catalog</a></h3>
5766
5767<p>In a normal environment libxml2 will by default check the presence of a
5768catalog in /etc/xml/catalog, and assuming it has been correctly populated,
5769the processing is completely transparent to the document user. To take a
5770concrete example, suppose you are authoring a DocBook document, this one
5771starts with the following DOCTYPE definition:</p>
5772<pre>&lt;?xml version='1.0'?&gt;
5773&lt;!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
5774          "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd"&gt;</pre>
5775
5776<p>When validating the document with libxml, the catalog will be
5777automatically consulted to lookup the public identifier "-//Norman Walsh//DTD
5778DocBk XML V3.1.4//EN" and the system identifier
5779"http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd", and if these entities have
5780been installed on your system and the catalogs actually point to them, libxml
5781will fetch them from the local disk.</p>
5782
5783<p style="font-size: 10pt"><strong>Note</strong>: Really don't use this
5784DOCTYPE example it's a really old version, but is fine as an example.</p>
5785
5786<p>Libxml2 will check the catalog each time that it is requested to load an
5787entity, this includes DTD, external parsed entities, stylesheets, etc ... If
5788your system is correctly configured all the authoring phase and processing
5789should use only local files, even if your document stays portable because it
5790uses the canonical public and system ID, referencing the remote document.</p>
5791
5792<h3><a name="Some">Some examples:</a></h3>
5793
5794<p>Here is a couple of fragments from XML Catalogs used in libxml2 early
5795regression tests in <code>test/catalogs</code> :</p>
5796<pre>&lt;?xml version="1.0"?&gt;
5797&lt;!DOCTYPE catalog PUBLIC
5798   "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
5799   "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
5800&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"&gt;
5801  &lt;public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
5802   uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/&gt;
5803...</pre>
5804
5805<p>This is the beginning of a catalog for DocBook 4.1.2, XML Catalogs are
5806written in XML,  there is a specific namespace for catalog elements
5807"urn:oasis:names:tc:entity:xmlns:xml:catalog". The first entry in this
5808catalog is a <code>public</code> mapping it allows to associate a Public
5809Identifier with an URI.</p>
5810<pre>...
5811    &lt;rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/"
5812                   rewritePrefix="file:///usr/share/xml/docbook/"/&gt;
5813...</pre>
5814
5815<p>A <code>rewriteSystem</code> is a very powerful instruction, it says that
5816any URI starting with a given prefix should be looked at another  URI
5817constructed by replacing the prefix with an new one. In effect this acts like
5818a cache system for a full area of the Web. In practice it is extremely useful
5819with a file prefix if you have installed a copy of those resources on your
5820local system.</p>
5821<pre>...
5822&lt;delegatePublic publicIdStartString="-//OASIS//DTD XML Catalog //"
5823                catalog="file:///usr/share/xml/docbook.xml"/&gt;
5824&lt;delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML"
5825                catalog="file:///usr/share/xml/docbook.xml"/&gt;
5826&lt;delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML"
5827                catalog="file:///usr/share/xml/docbook.xml"/&gt;
5828&lt;delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/"
5829                catalog="file:///usr/share/xml/docbook.xml"/&gt;
5830&lt;delegateURI uriStartString="http://www.oasis-open.org/docbook/"
5831                catalog="file:///usr/share/xml/docbook.xml"/&gt;
5832...</pre>
5833
5834<p>Delegation is the core features which allows to build a tree of catalogs,
5835easier to maintain than a single catalog, based on Public Identifier, System
5836Identifier or URI prefixes it instructs the catalog software to look up
5837entries in another resource. This feature allow to build hierarchies of
5838catalogs, the set of entries presented should be sufficient to redirect the
5839resolution of all DocBook references to the specific catalog in
5840<code>/usr/share/xml/docbook.xml</code> this one in turn could delegate all
5841references for DocBook 4.2.1 to a specific catalog installed at the same time
5842as the DocBook resources on the local machine.</p>
5843
5844<h3><a name="reference">How to tune catalog usage:</a></h3>
5845
5846<p>The user can change the default catalog behaviour by redirecting queries
5847to its own set of catalogs, this can be done by setting the
5848<code>XML_CATALOG_FILES</code> environment variable to a list of catalogs, an
5849empty one should deactivate loading the default <code>/etc/xml/catalog</code>
5850default catalog</p>
5851
5852<h3><a name="validate">How to debug catalog processing:</a></h3>
5853
5854<p>Setting up the <code>XML_DEBUG_CATALOG</code> environment variable will
5855make libxml2 output debugging information for each catalog operations, for
5856example:</p>
5857<pre>orchis:~/XML -&gt; xmllint --memory --noout test/ent2
5858warning: failed to load external entity "title.xml"
5859orchis:~/XML -&gt; export XML_DEBUG_CATALOG=
5860orchis:~/XML -&gt; xmllint --memory --noout test/ent2
5861Failed to parse catalog /etc/xml/catalog
5862Failed to parse catalog /etc/xml/catalog
5863warning: failed to load external entity "title.xml"
5864Catalogs cleanup
5865orchis:~/XML -&gt; </pre>
5866
5867<p>The test/ent2 references an entity, running the parser from memory makes
5868the base URI unavailable and the the "title.xml" entity cannot be loaded.
5869Setting up the debug environment variable allows to detect that an attempt is
5870made to load the <code>/etc/xml/catalog</code> but since it's not present the
5871resolution fails.</p>
5872
5873<p>But the most advanced way to debug XML catalog processing is to use the
5874<strong>xmlcatalog</strong> command shipped with libxml2, it allows to load
5875catalogs and make resolution queries to see what is going on. This is also
5876used for the regression tests:</p>
5877<pre>orchis:~/XML -&gt; ./xmlcatalog test/catalogs/docbook.xml \
5878                   "-//OASIS//DTD DocBook XML V4.1.2//EN"
5879http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
5880orchis:~/XML -&gt; </pre>
5881
5882<p>For debugging what is going on, adding one -v flags increase the verbosity
5883level to indicate the processing done (adding a second flag also indicate
5884what elements are recognized at parsing):</p>
5885<pre>orchis:~/XML -&gt; ./xmlcatalog -v test/catalogs/docbook.xml \
5886                   "-//OASIS//DTD DocBook XML V4.1.2//EN"
5887Parsing catalog test/catalogs/docbook.xml's content
5888Found public match -//OASIS//DTD DocBook XML V4.1.2//EN
5889http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
5890Catalogs cleanup
5891orchis:~/XML -&gt; </pre>
5892
5893<p>A shell interface is also available to debug and process multiple queries
5894(and for regression tests):</p>
5895<pre>orchis:~/XML -&gt; ./xmlcatalog -shell test/catalogs/docbook.xml \
5896                   "-//OASIS//DTD DocBook XML V4.1.2//EN"
5897&gt; help
5898Commands available:
5899public PublicID: make a PUBLIC identifier lookup
5900system SystemID: make a SYSTEM identifier lookup
5901resolve PublicID SystemID: do a full resolver lookup
5902add 'type' 'orig' 'replace' : add an entry
5903del 'values' : remove values
5904dump: print the current catalog state
5905debug: increase the verbosity level
5906quiet: decrease the verbosity level
5907exit:  quit the shell
5908&gt; public "-//OASIS//DTD DocBook XML V4.1.2//EN"
5909http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
5910&gt; quit
5911orchis:~/XML -&gt; </pre>
5912
5913<p>This should be sufficient for most debugging purpose, this was actually
5914used heavily to debug the XML Catalog implementation itself.</p>
5915
5916<h3><a name="Declaring">How to create and maintain</a> catalogs:</h3>
5917
5918<p>Basically XML Catalogs are XML files, you can either use XML tools to
5919manage them or use  <strong>xmlcatalog</strong> for this. The basic step is
5920to create a catalog the -create option provide this facility:</p>
5921<pre>orchis:~/XML -&gt; ./xmlcatalog --create tst.xml
5922&lt;?xml version="1.0"?&gt;
5923&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
5924         "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
5925&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/&gt;
5926orchis:~/XML -&gt; </pre>
5927
5928<p>By default xmlcatalog does not overwrite the original catalog and save the
5929result on the standard output, this can be overridden using the -noout
5930option. The <code>-add</code> command allows to add entries in the
5931catalog:</p>
5932<pre>orchis:~/XML -&gt; ./xmlcatalog --noout --create --add "public" \
5933  "-//OASIS//DTD DocBook XML V4.1.2//EN" \
5934  http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd tst.xml
5935orchis:~/XML -&gt; cat tst.xml
5936&lt;?xml version="1.0"?&gt;
5937&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" \
5938  "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
5939&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"&gt;
5940&lt;public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
5941        uri="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/&gt;
5942&lt;/catalog&gt;
5943orchis:~/XML -&gt; </pre>
5944
5945<p>The <code>-add</code> option will always take 3 parameters even if some of
5946the XML Catalog constructs (like nextCatalog) will have only a single
5947argument, just pass a third empty string, it will be ignored.</p>
5948
5949<p>Similarly the <code>-del</code> option remove matching entries from the
5950catalog:</p>
5951<pre>orchis:~/XML -&gt; ./xmlcatalog --del \
5952  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" tst.xml
5953&lt;?xml version="1.0"?&gt;
5954&lt;!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
5955    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"&gt;
5956&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/&gt;
5957orchis:~/XML -&gt; </pre>
5958
5959<p>The catalog is now empty. Note that the matching of <code>-del</code> is
5960exact and would have worked in a similar fashion with the Public ID
5961string.</p>
5962
5963<p>This is rudimentary but should be sufficient to manage a not too complex
5964catalog tree of resources.</p>
5965
5966<h3><a name="implemento">The implementor corner quick review of the
5967API:</a></h3>
5968
5969<p>First, and like for every other module of libxml, there is an
5970automatically generated <a href="html/libxml-catalog.html">API page for
5971catalog support</a>.</p>
5972
5973<p>The header for the catalog interfaces should be included as:</p>
5974<pre>#include &lt;libxml/catalog.h&gt;</pre>
5975
5976<p>The API is voluntarily kept very simple. First it is not obvious that
5977applications really need access to it since it is the default behaviour of
5978libxml2 (Note: it is possible to completely override libxml2 default catalog
5979by using <a href="html/libxml-parser.html">xmlSetExternalEntityLoader</a> to
5980plug an application specific resolver).</p>
5981
5982<p>Basically libxml2 support 2 catalog lists:</p>
5983<ul>
5984  <li>the default one, global shared by all the application</li>
5985  <li>a per-document catalog, this one is built if the document uses the
5986    <code>oasis-xml-catalog</code> PIs to specify its own catalog list, it is
5987    associated to the parser context and destroyed when the parsing context
5988    is destroyed.</li>
5989</ul>
5990
5991<p>the document one will be used first if it exists.</p>
5992
5993<h4>Initialization routines:</h4>
5994
5995<p>xmlInitializeCatalog(), xmlLoadCatalog() and xmlLoadCatalogs() should be
5996used at startup to initialize the catalog, if the catalog should be
5997initialized with specific values xmlLoadCatalog()  or xmlLoadCatalogs()
5998should be called before xmlInitializeCatalog() which would otherwise do a
5999default initialization first.</p>
6000
6001<p>The xmlCatalogAddLocal() call is used by the parser to grow the document
6002own catalog list if needed.</p>
6003
6004<h4>Preferences setup:</h4>
6005
6006<p>The XML Catalog spec requires the possibility to select default
6007preferences between  public and system delegation,
6008xmlCatalogSetDefaultPrefer() allows this, xmlCatalogSetDefaults() and
6009xmlCatalogGetDefaults() allow to control  if XML Catalogs resolution should
6010be forbidden, allowed for global catalog, for document catalog or both, the
6011default is to allow both.</p>
6012
6013<p>And of course xmlCatalogSetDebug() allows to generate debug messages
6014(through the xmlGenericError() mechanism).</p>
6015
6016<h4>Querying routines:</h4>
6017
6018<p>xmlCatalogResolve(), xmlCatalogResolveSystem(), xmlCatalogResolvePublic()
6019and xmlCatalogResolveURI() are relatively explicit if you read the XML
6020Catalog specification they correspond to section 7 algorithms, they should
6021also work if you have loaded an SGML catalog with a simplified semantic.</p>
6022
6023<p>xmlCatalogLocalResolve() and xmlCatalogLocalResolveURI() are the same but
6024operate on the document catalog list</p>
6025
6026<h4>Cleanup and Miscellaneous:</h4>
6027
6028<p>xmlCatalogCleanup() free-up the global catalog, xmlCatalogFreeLocal() is
6029the per-document equivalent.</p>
6030
6031<p>xmlCatalogAdd() and xmlCatalogRemove() are used to dynamically modify the
6032first catalog in the global list, and xmlCatalogDump() allows to dump a
6033catalog state, those routines are primarily designed for xmlcatalog, I'm not
6034sure that exposing more complex interfaces (like navigation ones) would be
6035really useful.</p>
6036
6037<p>The xmlParseCatalogFile() is a function used to load XML Catalog files,
6038it's similar as xmlParseFile() except it bypass all catalog lookups, it's
6039provided because this functionality may be useful for client tools.</p>
6040
6041<h4>threaded environments:</h4>
6042
6043<p>Since the catalog tree is built progressively, some care has been taken to
6044try to avoid troubles in multithreaded environments. The code is now thread
6045safe assuming that the libxml2 library has been compiled with threads
6046support.</p>
6047
6048<p></p>
6049
6050<h3><a name="Other">Other resources</a></h3>
6051
6052<p>The XML Catalog specification is relatively recent so there isn't much
6053literature to point at:</p>
6054<ul>
6055  <li>You can find a good rant from Norm Walsh about <a
6056    href="http://www.arbortext.com/Think_Tank/XML_Resources/Issue_Three/issue_three.html">the
6057    need for catalogs</a>, it provides a lot of context information even if
6058    I don't agree with everything presented. Norm also wrote a more recent
6059    article <a
6060    href="http://wwws.sun.com/software/xml/developers/resolver/article/">XML
6061    entities and URI resolvers</a> describing them.</li>
6062  <li>An <a href="http://home.ccil.org/~cowan/XML/XCatalog.html">old XML
6063    catalog proposal</a> from John Cowan</li>
6064  <li>The <a href="http://www.rddl.org/">Resource Directory Description
6065    Language</a> (RDDL) another catalog system but more oriented toward
6066    providing metadata for XML namespaces.</li>
6067  <li>the page from the OASIS Technical <a
6068    href="http://www.oasis-open.org/committees/entity/">Committee on Entity
6069    Resolution</a> who maintains XML Catalog, you will find pointers to the
6070    specification update, some background and pointers to others tools
6071    providing XML Catalog support</li>
6072  <li>There is a <a href="buildDocBookCatalog">shell script</a> to generate
6073    XML Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/
6074    directory, it will set-up /etc/xml/catalog and /etc/xml/docbook based on
6075    the resources found on the system. Otherwise it will just create
6076    ~/xmlcatalog and ~/dbkxmlcatalog and doing:
6077    <p><code>export XML_CATALOG_FILES=$HOME/xmlcatalog</code></p>
6078    <p>should allow to process DocBook documentations without requiring
6079    network accesses for the DTD or stylesheets</p>
6080  </li>
6081  <li>I have uploaded <a href="ftp://xmlsoft.org/libxml2/test/dbk412catalog.tar.gz">a
6082    small tarball</a> containing XML Catalogs for DocBook 4.1.2 which seems
6083    to work fine for me too</li>
6084  <li>The <a href="http://www.xmlsoft.org/xmlcatalog_man.html">xmlcatalog
6085    manual page</a></li>
6086</ul>
6087
6088<p>If you have suggestions for corrections or additions, simply contact
6089me:</p>
6090
6091<h2><a name="library">The parser interfaces</a></h2>
6092
6093<p>This section is directly intended to help programmers getting bootstrapped
6094using the XML tollkit from the C language. It is not intended to be
6095extensive. I hope the automatically generated documents will provide the
6096completeness required, but as a separate set of documents. The interfaces of
6097the XML parser are by principle low level, Those interested in a higher level
6098API should <a href="#DOM">look at DOM</a>.</p>
6099
6100<p>The <a href="html/libxml-parser.html">parser interfaces for XML</a> are
6101separated from the <a href="html/libxml-htmlparser.html">HTML parser
6102interfaces</a>.  Let's have a look at how the XML parser can be called:</p>
6103
6104<h3><a name="Invoking">Invoking the parser : the pull method</a></h3>
6105
6106<p>Usually, the first thing to do is to read an XML input. The parser accepts
6107documents either from in-memory strings or from files.  The functions are
6108defined in "parser.h":</p>
6109<dl>
6110  <dt><code>xmlDocPtr xmlParseMemory(char *buffer, int size);</code></dt>
6111    <dd><p>Parse a null-terminated string containing the document.</p>
6112    </dd>
6113</dl>
6114<dl>
6115  <dt><code>xmlDocPtr xmlParseFile(const char *filename);</code></dt>
6116    <dd><p>Parse an XML document contained in a (possibly compressed)
6117      file.</p>
6118    </dd>
6119</dl>
6120
6121<p>The parser returns a pointer to the document structure (or NULL in case of
6122failure).</p>
6123
6124<h3 id="Invoking1">Invoking the parser: the push method</h3>
6125
6126<p>In order for the application to keep the control when the document is
6127being fetched (which is common for GUI based programs) libxml2 provides a
6128push interface, too, as of version 1.8.3. Here are the interface
6129functions:</p>
6130<pre>xmlParserCtxtPtr xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
6131                                         void *user_data,
6132                                         const char *chunk,
6133                                         int size,
6134                                         const char *filename);
6135int              xmlParseChunk          (xmlParserCtxtPtr ctxt,
6136                                         const char *chunk,
6137                                         int size,
6138                                         int terminate);</pre>
6139
6140<p>and here is a simple example showing how to use the interface:</p>
6141<pre>            FILE *f;
6142
6143            f = fopen(filename, "r");
6144            if (f != NULL) {
6145                int res, size = 1024;
6146                char chars[1024];
6147                xmlParserCtxtPtr ctxt;
6148
6149                res = fread(chars, 1, 4, f);
6150                if (res &gt; 0) {
6151                    ctxt = xmlCreatePushParserCtxt(NULL, NULL,
6152                                chars, res, filename);
6153                    while ((res = fread(chars, 1, size, f)) &gt; 0) {
6154                        xmlParseChunk(ctxt, chars, res, 0);
6155                    }
6156                    xmlParseChunk(ctxt, chars, 0, 1);
6157                    doc = ctxt-&gt;myDoc;
6158                    xmlFreeParserCtxt(ctxt);
6159                }
6160            }</pre>
6161
6162<p>The HTML parser embedded into libxml2 also has a push interface; the
6163functions are just prefixed by "html" rather than "xml".</p>
6164
6165<h3 id="Invoking2">Invoking the parser: the SAX interface</h3>
6166
6167<p>The tree-building interface makes the parser memory-hungry, first loading
6168the document in memory and then building the tree itself. Reading a document
6169without building the tree is possible using the SAX interfaces (see SAX.h and
6170<a href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">James
6171Henstridge's documentation</a>). Note also that the push interface can be
6172limited to SAX: just use the two first arguments of
6173<code>xmlCreatePushParserCtxt()</code>.</p>
6174
6175<h3><a name="Building">Building a tree from scratch</a></h3>
6176
6177<p>The other way to get an XML tree in memory is by building it. Basically
6178there is a set of functions dedicated to building new elements. (These are
6179also described in &lt;libxml/tree.h&gt;.) For example, here is a piece of
6180code that produces the XML document used in the previous examples:</p>
6181<pre>    #include &lt;libxml/tree.h&gt;
6182    xmlDocPtr doc;
6183    xmlNodePtr tree, subtree;
6184
6185    doc = xmlNewDoc("1.0");
6186    doc-&gt;children = xmlNewDocNode(doc, NULL, "EXAMPLE", NULL);
6187    xmlSetProp(doc-&gt;children, "prop1", "gnome is great");
6188    xmlSetProp(doc-&gt;children, "prop2", "&amp; linux too");
6189    tree = xmlNewChild(doc-&gt;children, NULL, "head", NULL);
6190    subtree = xmlNewChild(tree, NULL, "title", "Welcome to Gnome");
6191    tree = xmlNewChild(doc-&gt;children, NULL, "chapter", NULL);
6192    subtree = xmlNewChild(tree, NULL, "title", "The Linux adventure");
6193    subtree = xmlNewChild(tree, NULL, "p", "bla bla bla ...");
6194    subtree = xmlNewChild(tree, NULL, "image", NULL);
6195    xmlSetProp(subtree, "href", "linus.gif");</pre>
6196
6197<p>Not really rocket science ...</p>
6198
6199<h3><a name="Traversing">Traversing the tree</a></h3>
6200
6201<p>Basically by <a href="html/libxml-tree.html">including "tree.h"</a> your
6202code has access to the internal structure of all the elements of the tree.
6203The names should be somewhat simple like <strong>parent</strong>,
6204<strong>children</strong>, <strong>next</strong>, <strong>prev</strong>,
6205<strong>properties</strong>, etc... For example, still with the previous
6206example:</p>
6207<pre><code>doc-&gt;children-&gt;children-&gt;children</code></pre>
6208
6209<p>points to the title element,</p>
6210<pre>doc-&gt;children-&gt;children-&gt;next-&gt;children-&gt;children</pre>
6211
6212<p>points to the text node containing the chapter title "The Linux
6213adventure".</p>
6214
6215<p><strong>NOTE</strong>: XML allows <em>PI</em>s and <em>comments</em> to be
6216present before the document root, so <code>doc-&gt;children</code> may point
6217to an element which is not the document Root Element; a function
6218<code>xmlDocGetRootElement()</code> was added for this purpose.</p>
6219
6220<h3><a name="Modifying">Modifying the tree</a></h3>
6221
6222<p>Functions are provided for reading and writing the document content. Here
6223is an excerpt from the <a href="html/libxml-tree.html">tree API</a>:</p>
6224<dl>
6225  <dt><code>xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar *name, const
6226  xmlChar *value);</code></dt>
6227    <dd><p>This sets (or changes) an attribute carried by an ELEMENT node.
6228      The value can be NULL.</p>
6229    </dd>
6230</dl>
6231<dl>
6232  <dt><code>const xmlChar *xmlGetProp(xmlNodePtr node, const xmlChar
6233  *name);</code></dt>
6234    <dd><p>This function returns a pointer to new copy of the property
6235      content. Note that the user must deallocate the result.</p>
6236    </dd>
6237</dl>
6238
6239<p>Two functions are provided for reading and writing the text associated
6240with elements:</p>
6241<dl>
6242  <dt><code>xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const xmlChar
6243  *value);</code></dt>
6244    <dd><p>This function takes an "external" string and converts it to one
6245      text node or possibly to a list of entity and text nodes. All
6246      non-predefined entity references like &amp;Gnome; will be stored
6247      internally as entity nodes, hence the result of the function may not be
6248      a single node.</p>
6249    </dd>
6250</dl>
6251<dl>
6252  <dt><code>xmlChar *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int
6253  inLine);</code></dt>
6254    <dd><p>This function is the inverse of
6255      <code>xmlStringGetNodeList()</code>. It generates a new string
6256      containing the content of the text and entity nodes. Note the extra
6257      argument inLine. If this argument is set to 1, the function will expand
6258      entity references.  For example, instead of returning the &amp;Gnome;
6259      XML encoding in the string, it will substitute it with its value (say,
6260      "GNU Network Object Model Environment").</p>
6261    </dd>
6262</dl>
6263
6264<h3><a name="Saving">Saving a tree</a></h3>
6265
6266<p>Basically 3 options are possible:</p>
6267<dl>
6268  <dt><code>void xmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int
6269  *size);</code></dt>
6270    <dd><p>Returns a buffer into which the document has been saved.</p>
6271    </dd>
6272</dl>
6273<dl>
6274  <dt><code>extern void xmlDocDump(FILE *f, xmlDocPtr doc);</code></dt>
6275    <dd><p>Dumps a document to an open file descriptor.</p>
6276    </dd>
6277</dl>
6278<dl>
6279  <dt><code>int xmlSaveFile(const char *filename, xmlDocPtr cur);</code></dt>
6280    <dd><p>Saves the document to a file. In this case, the compression
6281      interface is triggered if it has been turned on.</p>
6282    </dd>
6283</dl>
6284
6285<h3><a name="Compressio">Compression</a></h3>
6286
6287<p>The library transparently handles compression when doing file-based
6288accesses. The level of compression on saves can be turned on either globally
6289or individually for one file:</p>
6290<dl>
6291  <dt><code>int  xmlGetDocCompressMode (xmlDocPtr doc);</code></dt>
6292    <dd><p>Gets the document compression ratio (0-9).</p>
6293    </dd>
6294</dl>
6295<dl>
6296  <dt><code>void xmlSetDocCompressMode (xmlDocPtr doc, int mode);</code></dt>
6297    <dd><p>Sets the document compression ratio.</p>
6298    </dd>
6299</dl>
6300<dl>
6301  <dt><code>int  xmlGetCompressMode(void);</code></dt>
6302    <dd><p>Gets the default compression ratio.</p>
6303    </dd>
6304</dl>
6305<dl>
6306  <dt><code>void xmlSetCompressMode(int mode);</code></dt>
6307    <dd><p>Sets the default compression ratio.</p>
6308    </dd>
6309</dl>
6310
6311<h2><a name="Entities">Entities or no entities</a></h2>
6312
6313<p>Entities in principle are similar to simple C macros. An entity defines an
6314abbreviation for a given string that you can reuse many times throughout the
6315content of your document. Entities are especially useful when a given string
6316may occur frequently within a document, or to confine the change needed to a
6317document to a restricted area in the internal subset of the document (at the
6318beginning). Example:</p>
6319<pre>1 &lt;?xml version="1.0"?&gt;
63202 &lt;!DOCTYPE EXAMPLE SYSTEM "example.dtd" [
63213 &lt;!ENTITY xml "Extensible Markup Language"&gt;
63224 ]&gt;
63235 &lt;EXAMPLE&gt;
63246    &amp;xml;
63257 &lt;/EXAMPLE&gt;</pre>
6326
6327<p>Line 3 declares the xml entity. Line 6 uses the xml entity, by prefixing
6328its name with '&amp;' and following it by ';' without any spaces added. There
6329are 5 predefined entities in libxml2 allowing you to escape characters with
6330predefined meaning in some parts of the xml document content:
6331<strong>&amp;lt;</strong> for the character '&lt;', <strong>&amp;gt;</strong>
6332for the character '&gt;',  <strong>&amp;apos;</strong> for the character ''',
6333<strong>&amp;quot;</strong> for the character '"', and
6334<strong>&amp;amp;</strong> for the character '&amp;'.</p>
6335
6336<p>One of the problems related to entities is that you may want the parser to
6337substitute an entity's content so that you can see the replacement text in
6338your application. Or you may prefer to keep entity references as such in the
6339content to be able to save the document back without losing this usually
6340precious information (if the user went through the pain of explicitly
6341defining entities, he may have a a rather negative attitude if you blindly
6342substitute them as saving time). The <a
6343href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault()</a>
6344function allows you to check and change the behaviour, which is to not
6345substitute entities by default.</p>
6346
6347<p>Here is the DOM tree built by libxml2 for the previous document in the
6348default case:</p>
6349<pre>/gnome/src/gnome-xml -&gt; ./xmllint --debug test/ent1
6350DOCUMENT
6351version=1.0
6352   ELEMENT EXAMPLE
6353     TEXT
6354     content=
6355     ENTITY_REF
6356       INTERNAL_GENERAL_ENTITY xml
6357       content=Extensible Markup Language
6358     TEXT
6359     content=</pre>
6360
6361<p>And here is the result when substituting entities:</p>
6362<pre>/gnome/src/gnome-xml -&gt; ./tester --debug --noent test/ent1
6363DOCUMENT
6364version=1.0
6365   ELEMENT EXAMPLE
6366     TEXT
6367     content=     Extensible Markup Language</pre>
6368
6369<p>So, entities or no entities? Basically, it depends on your use case. I
6370suggest that you keep the non-substituting default behaviour and avoid using
6371entities in your XML document or data if you are not willing to handle the
6372entity references elements in the DOM tree.</p>
6373
6374<p>Note that at save time libxml2 enforces the conversion of the predefined
6375entities where necessary to prevent well-formedness problems, and will also
6376transparently replace those with chars (i.e. it will not generate entity
6377reference elements in the DOM tree or call the reference() SAX callback when
6378finding them in the input).</p>
6379
6380<p><span style="background-color: #FF0000">WARNING</span>: handling entities
6381on top of the libxml2 SAX interface is difficult!!! If you plan to use
6382non-predefined entities in your documents, then the learning curve to handle
6383then using the SAX API may be long. If you plan to use complex documents, I
6384strongly suggest you consider using the DOM interface instead and let libxml
6385deal with the complexity rather than trying to do it yourself.</p>
6386
6387<h2><a name="Namespaces">Namespaces</a></h2>
6388
6389<p>The libxml2 library implements <a
6390href="http://www.w3.org/TR/REC-xml-names/">XML namespaces</a> support by
6391recognizing namespace constructs in the input, and does namespace lookup
6392automatically when building the DOM tree. A namespace declaration is
6393associated with an in-memory structure and all elements or attributes within
6394that namespace point to it. Hence testing the namespace is a simple and fast
6395equality operation at the user level.</p>
6396
6397<p>I suggest that people using libxml2 use a namespace, and declare it in the
6398root element of their document as the default namespace. Then they don't need
6399to use the prefix in the content but we will have a basis for future semantic
6400refinement and  merging of data from different sources. This doesn't increase
6401the size of the XML output significantly, but significantly increases its
6402value in the long-term. Example:</p>
6403<pre>&lt;mydoc xmlns="http://mydoc.example.org/schemas/"&gt;
6404   &lt;elem1&gt;...&lt;/elem1&gt;
6405   &lt;elem2&gt;...&lt;/elem2&gt;
6406&lt;/mydoc&gt;</pre>
6407
6408<p>The namespace value has to be an absolute URL, but the URL doesn't have to
6409point to any existing resource on the Web. It will bind all the element and
6410attributes with that URL. I suggest to use an URL within a domain you
6411control, and that the URL should contain some kind of version information if
6412possible. For example, <code>"http://www.gnome.org/gnumeric/1.0/"</code> is a
6413good namespace scheme.</p>
6414
6415<p>Then when you load a file, make sure that a namespace carrying the
6416version-independent prefix is installed on the root element of your document,
6417and if the version information don't match something you know, warn the user
6418and be liberal in what you accept as the input. Also do *not* try to base
6419namespace checking on the prefix value. &lt;foo:text&gt; may be exactly the
6420same as &lt;bar:text&gt; in another document. What really matters is the URI
6421associated with the element or the attribute, not the prefix string (which is
6422just a shortcut for the full URI). In libxml, element and attributes have an
6423<code>ns</code> field pointing to an xmlNs structure detailing the namespace
6424prefix and its URI.</p>
6425
6426<p>@@Interfaces@@</p>
6427<pre>xmlNodePtr node;
6428if(!strncmp(node-&gt;name,"mytag",5)
6429  &amp;&amp; node-&gt;ns
6430  &amp;&amp; !strcmp(node-&gt;ns-&gt;href,"http://www.mysite.com/myns/1.0")) {
6431  ...
6432}</pre>
6433
6434<p>Usually people object to using namespaces together with validity checking.
6435I will try to make sure that using namespaces won't break validity checking,
6436so even if you plan to use or currently are using validation I strongly
6437suggest adding namespaces to your document. A default namespace scheme
6438<code>xmlns="http://...."</code> should not break validity even on less
6439flexible parsers. Using namespaces to mix and differentiate content coming
6440from multiple DTDs will certainly break current validation schemes. To check
6441such documents one needs to use schema-validation, which is supported in
6442libxml2 as well. See <a href="http://www.relaxng.org/">relagx-ng</a> and <a
6443href="http://www.w3c.org/XML/Schema">w3c-schema</a>.</p>
6444
6445<h2><a name="Upgrading">Upgrading 1.x code</a></h2>
6446
6447<p>Incompatible changes:</p>
6448
6449<p>Version 2 of libxml2 is the first version introducing serious backward
6450incompatible changes. The main goals were:</p>
6451<ul>
6452  <li>a general cleanup. A number of mistakes inherited from the very early
6453    versions couldn't be changed due to compatibility constraints. Example
6454    the "childs" element in the nodes.</li>
6455  <li>Uniformization of the various nodes, at least for their header and link
6456    parts (doc, parent, children, prev, next), the goal is a simpler
6457    programming model and simplifying the task of the DOM implementors.</li>
6458  <li>better conformances to the XML specification, for example version 1.x
6459    had an heuristic to try to detect ignorable white spaces. As a result the
6460    SAX event generated were ignorableWhitespace() while the spec requires
6461    character() in that case. This also mean that a number of DOM node
6462    containing blank text may populate the DOM tree which were not present
6463    before.</li>
6464</ul>
6465
6466<h3>How to fix libxml-1.x code:</h3>
6467
6468<p>So client code of libxml designed to run with version 1.x may have to be
6469changed to compile against version 2.x of libxml. Here is a list of changes
6470that I have collected, they may not be sufficient, so in case you find other
6471change which are required, <a href="mailto:Daniel.Veillard@w3.org">drop me a
6472mail</a>:</p>
6473<ol>
6474  <li>The package name have changed from libxml to libxml2, the library name
6475    is now -lxml2 . There is a new xml2-config script which should be used to
6476    select the right parameters libxml2</li>
6477  <li>Node <strong>childs</strong> field has been renamed
6478    <strong>children</strong> so s/childs/children/g should be  applied
6479    (probability of having "childs" anywhere else is close to 0+</li>
6480  <li>The document don't have anymore a <strong>root</strong> element it has
6481    been replaced by <strong>children</strong> and usually you will get a
6482    list of element here. For example a Dtd element for the internal subset
6483    and it's declaration may be found in that list, as well as processing
6484    instructions or comments found before or after the document root element.
6485    Use <strong>xmlDocGetRootElement(doc)</strong> to get the root element of
6486    a document. Alternatively if you are sure to not reference DTDs nor have
6487    PIs or comments before or after the root element
6488    s/-&gt;root/-&gt;children/g will probably do it.</li>
6489  <li>The white space issue, this one is more complex, unless special case of
6490    validating parsing, the line breaks and spaces usually used for indenting
6491    and formatting the document content becomes significant. So they are
6492    reported by SAX and if your using the DOM tree, corresponding nodes are
6493    generated. Too approach can be taken:
6494    <ol>
6495      <li>lazy one, use the compatibility call
6496        <strong>xmlKeepBlanksDefault(0)</strong> but be aware that you are
6497        relying on a special (and possibly broken) set of heuristics of
6498        libxml to detect ignorable blanks. Don't complain if it breaks or
6499        make your application not 100% clean w.r.t. to it's input.</li>
6500      <li>the Right Way: change you code to accept possibly insignificant
6501        blanks characters, or have your tree populated with weird blank text
6502        nodes. You can spot them using the commodity function
6503        <strong>xmlIsBlankNode(node)</strong> returning 1 for such blank
6504        nodes.</li>
6505    </ol>
6506    <p>Note also that with the new default the output functions don't add any
6507    extra indentation when saving a tree in order to be able to round trip
6508    (read and save) without inflating the document with extra formatting
6509    chars.</p>
6510  </li>
6511  <li>The include path has changed to $prefix/libxml/ and the includes
6512    themselves uses this new prefix in includes instructions... If you are
6513    using (as expected) the
6514    <pre>xml2-config --cflags</pre>
6515    <p>output to generate you compile commands this will probably work out of
6516    the box</p>
6517  </li>
6518  <li>xmlDetectCharEncoding takes an extra argument indicating the length in
6519    byte of the head of the document available for character detection.</li>
6520</ol>
6521
6522<h3>Ensuring both libxml-1.x and libxml-2.x compatibility</h3>
6523
6524<p>Two new version of libxml (1.8.11) and libxml2 (2.3.4) have been released
6525to allow smooth upgrade of existing libxml v1code while retaining
6526compatibility. They offers the following:</p>
6527<ol>
6528  <li>similar include naming, one should use
6529    <strong>#include&lt;libxml/...&gt;</strong> in both cases.</li>
6530  <li>similar identifiers defined via macros for the child and root fields:
6531    respectively <strong>xmlChildrenNode</strong> and
6532    <strong>xmlRootNode</strong></li>
6533  <li>a new macro <strong>LIBXML_TEST_VERSION</strong> which should be
6534    inserted once in the client code</li>
6535</ol>
6536
6537<p>So the roadmap to upgrade your existing libxml applications is the
6538following:</p>
6539<ol>
6540  <li>install the  libxml-1.8.8 (and libxml-devel-1.8.8) packages</li>
6541  <li>find all occurrences where the xmlDoc <strong>root</strong> field is
6542    used and change it to <strong>xmlRootNode</strong></li>
6543  <li>similarly find all occurrences where the xmlNode
6544    <strong>childs</strong> field is used and change it to
6545    <strong>xmlChildrenNode</strong></li>
6546  <li>add a <strong>LIBXML_TEST_VERSION</strong> macro somewhere in your
6547    <strong>main()</strong> or in the library init entry point</li>
6548  <li>Recompile, check compatibility, it should still work</li>
6549  <li>Change your configure script to look first for xml2-config and fall
6550    back using xml-config . Use the --cflags and --libs output of the command
6551    as the Include and Linking parameters needed to use libxml.</li>
6552  <li>install libxml2-2.3.x and  libxml2-devel-2.3.x (libxml-1.8.y and
6553    libxml-devel-1.8.y can be kept simultaneously)</li>
6554  <li>remove your config.cache, relaunch your configuration mechanism, and
6555    recompile, if steps 2 and 3 were done right it should compile as-is</li>
6556  <li>Test that your application is still running correctly, if not this may
6557    be due to extra empty nodes due to formatting spaces being kept in libxml2
6558    contrary to libxml1, in that case insert xmlKeepBlanksDefault(1) in your
6559    code before calling the parser (next to
6560    <strong>LIBXML_TEST_VERSION</strong> is a fine place).</li>
6561</ol>
6562
6563<p>Following those steps should work. It worked for some of my own code.</p>
6564
6565<p>Let me put some emphasis on the fact that there is far more changes from
6566libxml 1.x to 2.x than the ones you may have to patch for. The overall code
6567has been considerably cleaned up and the conformance to the XML specification
6568has been drastically improved too. Don't take those changes as an excuse to
6569not upgrade, it may cost a lot on the long term ...</p>
6570
6571<h2><a name="Thread">Thread safety</a></h2>
6572
6573<p>Starting with 2.4.7, libxml2 makes provisions to ensure that concurrent
6574threads can safely work in parallel parsing different documents. There is
6575however a couple of things to do to ensure it:</p>
6576<ul>
6577  <li>configure the library accordingly using the --with-threads options</li>
6578  <li>call xmlInitParser() in the "main" thread before using any of the
6579    libxml2 API (except possibly selecting a different memory allocator)</li>
6580</ul>
6581
6582<p>Note that the thread safety cannot be ensured for multiple threads sharing
6583the same document, the locking must be done at the application level, libxml
6584exports a basic mutex and reentrant mutexes API in &lt;libxml/threads.h&gt;.
6585The parts of the library checked for thread safety are:</p>
6586<ul>
6587  <li>concurrent loading</li>
6588  <li>file access resolution</li>
6589  <li>catalog access</li>
6590  <li>catalog building</li>
6591  <li>entities lookup/accesses</li>
6592  <li>validation</li>
6593  <li>global variables per-thread override</li>
6594  <li>memory handling</li>
6595</ul>
6596
6597<p>XPath has been tested for threaded usage on non-modified document
6598   for example when using libxslt, but make 100% sure the documents
6599   are accessed read-only !</p>
6600
6601<h2><a name="DOM"></a><a name="Principles">DOM Principles</a></h2>
6602
6603<p><a href="http://www.w3.org/DOM/">DOM</a> stands for the <em>Document
6604Object Model</em>; this is an API for accessing XML or HTML structured
6605documents. Native support for DOM in Gnome is on the way (module gnome-dom),
6606and will be based on gnome-xml. This will be a far cleaner interface to
6607manipulate XML files within Gnome since it won't expose the internal
6608structure.</p>
6609
6610<p>The current DOM implementation on top of libxml2 is the <a
6611href="http://svn.gnome.org/viewvc/gdome2/trunk/">gdome2 Gnome module</a>, this
6612is a full DOM interface, thanks to Paolo Casarini, check the <a
6613href="http://gdome2.cs.unibo.it/">Gdome2 homepage</a> for more
6614information.</p>
6615
6616<h2><a name="Example"></a><a name="real">A real example</a></h2>
6617
6618<p>Here is a real size example, where the actual content of the application
6619data is not kept in the DOM tree but uses internal structures. It is based on
6620a proposal to keep a database of jobs related to Gnome, with an XML based
6621storage structure. Here is an <a href="gjobs.xml">XML encoded jobs
6622base</a>:</p>
6623<pre>&lt;?xml version="1.0"?&gt;
6624&lt;gjob:Helping xmlns:gjob="http://www.gnome.org/some-location"&gt;
6625  &lt;gjob:Jobs&gt;
6626
6627    &lt;gjob:Job&gt;
6628      &lt;gjob:Project ID="3"/&gt;
6629      &lt;gjob:Application&gt;GBackup&lt;/gjob:Application&gt;
6630      &lt;gjob:Category&gt;Development&lt;/gjob:Category&gt;
6631
6632      &lt;gjob:Update&gt;
6633        &lt;gjob:Status&gt;Open&lt;/gjob:Status&gt;
6634        &lt;gjob:Modified&gt;Mon, 07 Jun 1999 20:27:45 -0400 MET DST&lt;/gjob:Modified&gt;
6635        &lt;gjob:Salary&gt;USD 0.00&lt;/gjob:Salary&gt;
6636      &lt;/gjob:Update&gt;
6637
6638      &lt;gjob:Developers&gt;
6639        &lt;gjob:Developer&gt;
6640        &lt;/gjob:Developer&gt;
6641      &lt;/gjob:Developers&gt;
6642
6643      &lt;gjob:Contact&gt;
6644        &lt;gjob:Person&gt;Nathan Clemons&lt;/gjob:Person&gt;
6645        &lt;gjob:Email&gt;nathan@windsofstorm.net&lt;/gjob:Email&gt;
6646        &lt;gjob:Company&gt;
6647        &lt;/gjob:Company&gt;
6648        &lt;gjob:Organisation&gt;
6649        &lt;/gjob:Organisation&gt;
6650        &lt;gjob:Webpage&gt;
6651        &lt;/gjob:Webpage&gt;
6652        &lt;gjob:Snailmail&gt;
6653        &lt;/gjob:Snailmail&gt;
6654        &lt;gjob:Phone&gt;
6655        &lt;/gjob:Phone&gt;
6656      &lt;/gjob:Contact&gt;
6657
6658      &lt;gjob:Requirements&gt;
6659      The program should be released as free software, under the GPL.
6660      &lt;/gjob:Requirements&gt;
6661
6662      &lt;gjob:Skills&gt;
6663      &lt;/gjob:Skills&gt;
6664
6665      &lt;gjob:Details&gt;
6666      A GNOME based system that will allow a superuser to configure
6667      compressed and uncompressed files and/or file systems to be backed
6668      up with a supported media in the system.  This should be able to
6669      perform via find commands generating a list of files that are passed
6670      to tar, dd, cpio, cp, gzip, etc., to be directed to the tape machine
6671      or via operations performed on the filesystem itself. Email
6672      notification and GUI status display very important.
6673      &lt;/gjob:Details&gt;
6674
6675    &lt;/gjob:Job&gt;
6676
6677  &lt;/gjob:Jobs&gt;
6678&lt;/gjob:Helping&gt;</pre>
6679
6680<p>While loading the XML file into an internal DOM tree is a matter of
6681calling only a couple of functions, browsing the tree to gather the data and
6682generate the internal structures is harder, and more error prone.</p>
6683
6684<p>The suggested principle is to be tolerant with respect to the input
6685structure. For example, the ordering of the attributes is not significant,
6686the XML specification is clear about it. It's also usually a good idea not to
6687depend on the order of the children of a given node, unless it really makes
6688things harder. Here is some code to parse the information for a person:</p>
6689<pre>/*
6690 * A person record
6691 */
6692typedef struct person {
6693    char *name;
6694    char *email;
6695    char *company;
6696    char *organisation;
6697    char *smail;
6698    char *webPage;
6699    char *phone;
6700} person, *personPtr;
6701
6702/*
6703 * And the code needed to parse it
6704 */
6705personPtr parsePerson(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) {
6706    personPtr ret = NULL;
6707
6708DEBUG("parsePerson\n");
6709    /*
6710     * allocate the struct
6711     */
6712    ret = (personPtr) malloc(sizeof(person));
6713    if (ret == NULL) {
6714        fprintf(stderr,"out of memory\n");
6715        return(NULL);
6716    }
6717    memset(ret, 0, sizeof(person));
6718
6719    /* We don't care what the top level element name is */
6720    cur = cur-&gt;xmlChildrenNode;
6721    while (cur != NULL) {
6722        if ((!strcmp(cur-&gt;name, "Person")) &amp;&amp; (cur-&gt;ns == ns))
6723            ret-&gt;name = xmlNodeListGetString(doc, cur-&gt;xmlChildrenNode, 1);
6724        if ((!strcmp(cur-&gt;name, "Email")) &amp;&amp; (cur-&gt;ns == ns))
6725            ret-&gt;email = xmlNodeListGetString(doc, cur-&gt;xmlChildrenNode, 1);
6726        cur = cur-&gt;next;
6727    }
6728
6729    return(ret);
6730}</pre>
6731
6732<p>Here are a couple of things to notice:</p>
6733<ul>
6734  <li>Usually a recursive parsing style is the more convenient one: XML data
6735    is by nature subject to repetitive constructs and usually exhibits highly
6736    structured patterns.</li>
6737  <li>The two arguments of type <em>xmlDocPtr</em> and <em>xmlNsPtr</em>,
6738    i.e. the pointer to the global XML document and the namespace reserved to
6739    the application. Document wide information are needed for example to
6740    decode entities and it's a good coding practice to define a namespace for
6741    your application set of data and test that the element and attributes
6742    you're analyzing actually pertains to your application space. This is
6743    done by a simple equality test (cur-&gt;ns == ns).</li>
6744  <li>To retrieve text and attributes value, you can use the function
6745    <em>xmlNodeListGetString</em> to gather all the text and entity reference
6746    nodes generated by the DOM output and produce an single text string.</li>
6747</ul>
6748
6749<p>Here is another piece of code used to parse another level of the
6750structure:</p>
6751<pre>#include &lt;libxml/tree.h&gt;
6752/*
6753 * a Description for a Job
6754 */
6755typedef struct job {
6756    char *projectID;
6757    char *application;
6758    char *category;
6759    personPtr contact;
6760    int nbDevelopers;
6761    personPtr developers[100]; /* using dynamic alloc is left as an exercise */
6762} job, *jobPtr;
6763
6764/*
6765 * And the code needed to parse it
6766 */
6767jobPtr parseJob(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) {
6768    jobPtr ret = NULL;
6769
6770DEBUG("parseJob\n");
6771    /*
6772     * allocate the struct
6773     */
6774    ret = (jobPtr) malloc(sizeof(job));
6775    if (ret == NULL) {
6776        fprintf(stderr,"out of memory\n");
6777        return(NULL);
6778    }
6779    memset(ret, 0, sizeof(job));
6780
6781    /* We don't care what the top level element name is */
6782    cur = cur-&gt;xmlChildrenNode;
6783    while (cur != NULL) {
6784
6785        if ((!strcmp(cur-&gt;name, "Project")) &amp;&amp; (cur-&gt;ns == ns)) {
6786            ret-&gt;projectID = xmlGetProp(cur, "ID");
6787            if (ret-&gt;projectID == NULL) {
6788                fprintf(stderr, "Project has no ID\n");
6789            }
6790        }
6791        if ((!strcmp(cur-&gt;name, "Application")) &amp;&amp; (cur-&gt;ns == ns))
6792            ret-&gt;application = xmlNodeListGetString(doc, cur-&gt;xmlChildrenNode, 1);
6793        if ((!strcmp(cur-&gt;name, "Category")) &amp;&amp; (cur-&gt;ns == ns))
6794            ret-&gt;category = xmlNodeListGetString(doc, cur-&gt;xmlChildrenNode, 1);
6795        if ((!strcmp(cur-&gt;name, "Contact")) &amp;&amp; (cur-&gt;ns == ns))
6796            ret-&gt;contact = parsePerson(doc, ns, cur);
6797        cur = cur-&gt;next;
6798    }
6799
6800    return(ret);
6801}</pre>
6802
6803<p>Once you are used to it, writing this kind of code is quite simple, but
6804boring. Ultimately, it could be possible to write stubbers taking either C
6805data structure definitions, a set of XML examples or an XML DTD and produce
6806the code needed to import and export the content between C data and XML
6807storage. This is left as an exercise to the reader :-)</p>
6808
6809<p>Feel free to use <a href="example/gjobread.c">the code for the full C
6810parsing example</a> as a template, it is also available with Makefile in the
6811Gnome SVN base under libxml2/example</p>
6812
6813<h2><a name="Contributi">Contributions</a></h2>
6814<ul>
6815  <li>Bjorn Reese, William Brack and Thomas Broyer have provided a number of
6816    patches, Gary Pennington worked on the validation API, threading support
6817    and Solaris port.</li>
6818  <li>John Fleck helps maintaining the documentation and man pages.</li>
6819  <li><a href="mailto:igor@zlatkovic.com">Igor  Zlatkovic</a> is now the
6820    maintainer of the Windows port, <a
6821    href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
6822    binaries</a></li>
6823  <li><a href="mailto:Gary.Pennington@sun.com">Gary Pennington</a> provides
6824    <a href="http://garypennington.net/libxml2/">Solaris binaries</a></li>
6825  <li><a
6826    href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
6827    Sergeant</a> developed <a
6828    href="http://axkit.org/download/">XML::LibXSLT</a>, a Perl wrapper for
6829    libxml2/libxslt as part of the <a href="http://axkit.com/">AxKit XML
6830    application server</a></li>
6831  <li><a href="mailto:fnatter@gmx.net">Felix Natter</a> and <a
6832    href="mailto:geertk@ai.rug.nl">Geert Kloosterman</a> provide <a
6833    href="libxml-doc.el">an emacs module</a> to lookup libxml(2) functions
6834    documentation</li>
6835  <li><a href="mailto:sherwin@nlm.nih.gov">Ziying Sherwin</a> provided <a
6836    href="http://xmlsoft.org/messages/0488.html">man pages</a></li>
6837  <li>there is a module for <a
6838    href="http://acs-misc.sourceforge.net/nsxml.html">libxml/libxslt support
6839    in OpenNSD/AOLServer</a></li>
6840  <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provided the
6841    first version of libxml/libxslt <a
6842    href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li>
6843  <li>Petr Kozelka provides <a
6844    href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
6845    libxml2</a> with Kylix and Delphi and other Pascal compilers</li>
6846  <li><a href="mailto:aleksey@aleksey.com">Aleksey Sanin</a> implemented the
6847    <a href="http://www.w3.org/Signature/">XML Canonicalization and XML
6848    Digital Signature</a> <a
6849    href="http://www.aleksey.com/xmlsec/">implementations for libxml2</a></li>
6850  <li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a> and
6851    contributors maintain <a href="http://tclxml.sourceforge.net/">tcl
6852    bindings for libxml2 and libxslt</a>, as well as <a
6853    href="http://tclxml.sf.net/tkxmllint.html">tkxmllint</a> a GUI for
6854    xmllint and <a href="http://tclxml.sf.net/tkxsltproc.html">tkxsltproc</a>
6855    a GUI for xsltproc.</li>
6856</ul>
6857
6858<p></p>
6859</body>
6860</html>
6861