1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

possible mem leak patch from Jason Adams integrated xf:escape-uri() from

* xpath.c: possible mem leak patch from Jason Adams
* xpath.c: integrated xf:escape-uri() from Wesley Terpstra
  in the XQuery namespace
* configure.in: preparing 2.4.24
* doc/*.html: updated the web pages
* python/generator.py: closing bug #85258 by generating conditional
  compile check to avoid linking to routines not configured in.
Daniel
This commit is contained in:
Daniel Veillard
2002-08-22 20:52:17 +00:00
parent 84ec40a51c
commit 42766c0eea
20 changed files with 351 additions and 126 deletions

View File

@ -1,3 +1,19 @@
Thu Aug 22 22:03:19 CEST 2002 Daniel Veillard <daniel@veillard.com>
* xpath.c: possible mem leak patch from Jason Adams
Thu Aug 22 17:27:30 CEST 2002 Daniel Veillard <daniel@veillard.com>
* xpath.c: integrated xf:escape-uri() from Wesley Terpstra
in the XQuery namespace
* configure.in: preparing 2.4.24
* doc/*.html: updated the web pages
Thu Aug 22 16:19:42 CEST 2002 Daniel Veillard <daniel@veillard.com>
* python/generator.py: closing bug #85258 by generating conditional
compile check to avoid linking to routines not configured in.
2002-08-22 Havoc Pennington <hp@pobox.com> 2002-08-22 Havoc Pennington <hp@pobox.com>
* autogen.sh: update error message for missing automake * autogen.sh: update error message for missing automake

View File

@ -6,7 +6,7 @@ AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2 LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=4 LIBXML_MINOR_VERSION=4
LIBXML_MICRO_VERSION=23 LIBXML_MICRO_VERSION=24
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION

View File

@ -105,9 +105,9 @@ A:link, A:visited, A:active { text-decoration: underline }
</li> </li>
<li> <li>
<em>Can I embed libxml in a proprietary application ?</em> <em>Can I embed libxml in a proprietary application ?</em>
<p>Yes. The MIT License allows you to keep proprietary the changes <p>Yes. The MIT License allows you to keep proprietary the changes you
you made to libxml, but it would be graceful to send-back bug fixes made to libxml, but it would be graceful to send-back bug fixes and
and improvements as patches for possible incorporation in the main improvements as patches for possible incorporation in the main
development tree.</p> development tree.</p>
</li> </li>
</ol> </ol>
@ -128,8 +128,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<li> <li>
<em>I see libxml and libxml2 releases, which one should I install ?</em> <em>I see libxml and libxml2 releases, which one should I install ?</em>
<ul> <ul>
<li>If you are not constrained by backward compatibility issues <li>If you are not constrained by backward compatibility issues with
with existing applications, install libxml2 only</li> existing applications, install libxml2 only</li>
<li>If you are not doing development, you can safely install both. <li>If you are not doing development, you can safely install both.
Usually the packages <a href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a> are Usually the packages <a href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a> are
compatible (this is not the case for development packages).</li> compatible (this is not the case for development packages).</li>
@ -145,8 +145,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<li> <li>
<em>I can't install the libxml package, it conflicts with libxml0</em> <em>I can't install the libxml package, it conflicts with libxml0</em>
<p>You probably have an old libxml0 package used to provide the shared <p>You probably have an old libxml0 package used to provide the shared
library for libxml.so.0, you can probably safely remove it. The library for libxml.so.0, you can probably safely remove it. The libxml
libxml packages provided on <a href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> provide packages provided on <a href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> provide
libxml.so.0</p> libxml.so.0</p>
</li> </li>
<li> <li>
@ -156,9 +156,9 @@ A:link, A:visited, A:active { text-decoration: underline }
rebuild it locally with</p> rebuild it locally with</p>
<p> <p>
<code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p> <code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p>
<p>If everything goes well it will generate two binary rpm packages (one providing <p>If everything goes well it will generate two binary rpm packages (one
the shared libs and xmllint, and the other one, the -devel package, providing the shared libs and xmllint, and the other one, the -devel
providing includes, static libraries and scripts needed to build package, providing includes, static libraries and scripts needed to build
applications with libxml(2)) that you can install locally.</p> applications with libxml(2)) that you can install locally.</p>
</li> </li>
</ol> </ol>
@ -197,17 +197,18 @@ A:link, A:visited, A:active { text-decoration: underline }
</li> </li>
<li> <li>
<em>Make check fails on some platforms</em> <em>Make check fails on some platforms</em>
<p>Sometimes the regression tests' results don't completely match the value <p>Sometimes the regression tests' results don't completely match the
produced by the parser, and the makefile uses diff to print the delta. On value produced by the parser, and the makefile uses diff to print the
some platforms the diff return breaks the compilation process; if the delta. On some platforms the diff return breaks the compilation process;
diff is small this is probably not a serious problem.</p> if the diff is small this is probably not a serious problem.</p>
<p>Sometimes (especially on Solaris) make checks fail due to limitations <p>Sometimes (especially on Solaris) make checks fail due to limitations
in make. Try using GNU-make instead.</p> in make. Try using GNU-make instead.</p>
</li> </li>
<li> <li>
<em>I use the CVS version and there is no configure script</em> <em>I use the CVS version and there is no configure script</em>
<p>The configure script (and other Makefiles) are generated. Use the autogen.sh <p>The configure script (and other Makefiles) are generated. Use the
script to regenerate the configure script and Makefiles, like:</p> autogen.sh script to regenerate the configure script and Makefiles,
like:</p>
<p><code>./autogen.sh --prefix=/usr --disable-shared</code></p> <p><code>./autogen.sh --prefix=/usr --disable-shared</code></p>
</li> </li>
<li> <li>
@ -293,8 +294,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
patches.</p> patches.</p>
</li> </li>
<li> <li>
<em>Where can I get more examples and information than privoded on the web <em>Where can I get more examples and information than privoded on the
page?</em> web page?</em>
<p>Ideally a libxml book would be nice. I have no such plan ... But you <p>Ideally a libxml book would be nice. I have no such plan ... But you
can:</p> can:</p>
<ul> <ul>
@ -311,9 +312,9 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<li> <li>
<a href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&amp;dir=gnome-xml">Browse <a href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&amp;dir=gnome-xml">Browse
the libxml source</a> , I try to write code as clean and documented the libxml source</a> , I try to write code as clean and documented
as possible, so looking at it may be helpful. In particular the code of as possible, so looking at it may be helpful. In particular the code
xmllint.c and of the various testXXX.c test programs should provide of xmllint.c and of the various testXXX.c test programs should
good examples of how to do things with the library.</li> provide good examples of how to do things with the library.</li>
</ul> </ul>
</li> </li>
<li>What about C++ ? <li>What about C++ ?
@ -336,8 +337,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
</li> </li>
<li>How to validate a document a posteriori ? <li>How to validate a document a posteriori ?
<p>It is possible to validate documents which had not been validated at <p>It is possible to validate documents which had not been validated at
initial parsing time or documents which have been built from scratch using initial parsing time or documents which have been built from scratch
the API. Use the <a href="http://xmlsoft.org/html/libxml-valid.html#XMLVALIDATEDTD">xmlValidateDtd()</a> using the API. Use the <a href="http://xmlsoft.org/html/libxml-valid.html#XMLVALIDATEDTD">xmlValidateDtd()</a>
function. It is also possible to simply add a DTD to an existing function. It is also possible to simply add a DTD to an existing
document:</p> document:</p>
<pre>xmlDocPtr doc; /* your existing document */ <pre>xmlDocPtr doc; /* your existing document */

View File

@ -104,18 +104,19 @@ document</a>:</p>
&lt;/chapter&gt; &lt;/chapter&gt;
&lt;/EXAMPLE&gt;</pre> &lt;/EXAMPLE&gt;</pre>
<p>The first line specifies that it is an XML document and gives useful <p>The first line specifies that it is an XML document and gives useful
information about its encoding. Then the rest of the document is a text format whose information about its encoding. Then the rest of the document is a text
structure is specified by tags between brackets. <strong>Each tag opened has format whose structure is specified by tags between brackets. <strong>Each
to be closed</strong>. XML is pedantic about this. However, if a tag is empty tag opened has to be closed</strong>. XML is pedantic about this. However, if
(no content), a single tag can serve as both the opening and closing tag if a tag is empty (no content), a single tag can serve as both the opening and
it ends with <code>/&gt;</code> rather than with <code>&gt;</code>. Note closing tag if it ends with <code>/&gt;</code> rather than with
that, for example, the image tag has no content (just an attribute) and is <code>&gt;</code>. Note that, for example, the image tag has no content (just
closed by ending the tag with <code>/&gt;</code>.</p> an attribute) and is closed by ending the tag with <code>/&gt;</code>.</p>
<p>XML can be applied successfully to a wide range of tasks, ranging from long term <p>XML can be applied successfully to a wide range of tasks, ranging from
structured document maintenance (where it follows the steps of SGML) to long term structured document maintenance (where it follows the steps of
simple data encoding mechanisms like configuration file formatting (glade), SGML) to simple data encoding mechanisms like configuration file formatting
spreadsheets (gnumeric), or even shorter lived documents such as WebDAV where (glade), spreadsheets (gnumeric), or even shorter lived documents such as
it is used to encode remote calls between a client and a server.</p> WebDAV where it is used to encode remote calls between a client and a
server.</p>
<p><a href="bugs.html">Daniel Veillard</a></p> <p><a href="bugs.html">Daniel Veillard</a></p>
</td></tr></table></td></tr></table></td></tr></table></td> </td></tr></table></td></tr></table></td></tr></table></td>
</tr></table></td></tr></table> </tr></table></td></tr></table>

View File

@ -93,8 +93,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="http://www.w3.org/TR/xslt">XSL Transformations</a>, is a <a href="http://www.w3.org/TR/xslt">XSL Transformations</a>, is a
language for transforming XML documents into other XML documents (or language for transforming XML documents into other XML documents (or
HTML/textual output).</p> HTML/textual output).</p>
<p>A separate library called libxslt is being developed on top of libxml2. This <p>A separate library called libxslt is being developed on top of libxml2.
module &quot;libxslt&quot; too can be found in the Gnome CVS base.</p> This module &quot;libxslt&quot; too can be found in the Gnome CVS base.</p>
<p>You can check the <a href="http://cvs.gnome.org/lxr/source/libxslt/FEATURES">features</a> <p>You can check the <a href="http://cvs.gnome.org/lxr/source/libxslt/FEATURES">features</a>
supported and the progresses on the <a href="http://cvs.gnome.org/lxr/source/libxslt/ChangeLog" name="Changelog">Changelog</a>.</p> supported and the progresses on the <a href="http://cvs.gnome.org/lxr/source/libxslt/ChangeLog" name="Changelog">Changelog</a>.</p>
<p><a href="bugs.html">Daniel Veillard</a></p> <p><a href="bugs.html">Daniel Veillard</a></p>

View File

@ -90,9 +90,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<p>Well, bugs or missing features are always possible, and I will make a <p>Well, bugs or missing features are always possible, and I will make a
point of fixing them in a timely fashion. The best way to report a bug is to point of fixing them in a timely fashion. The best way to report a bug is to
use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml">Gnome use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml">Gnome
bug tracking database</a> (make sure to use the &quot;libxml2&quot; module name). I look bug tracking database</a> (make sure to use the &quot;libxml2&quot; module name). I
at reports there regularly and it's good to have a reminder when a bug is look at reports there regularly and it's good to have a reminder when a bug
still open. Be sure to specify that the bug is for the package libxml2.</p> is still open. Be sure to specify that the bug is for the package libxml2.</p>
<p>There is also a mailing-list <a href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an <a href="http://mail.gnome.org/archives/xml/">on-line archive</a> (<a href="http://xmlsoft.org/messages">old</a>). To subscribe to this list, <p>There is also a mailing-list <a href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an <a href="http://mail.gnome.org/archives/xml/">on-line archive</a> (<a href="http://xmlsoft.org/messages">old</a>). To subscribe to this list,
please visit the <a href="http://mail.gnome.org/mailman/listinfo/xml">associated Web</a> page and please visit the <a href="http://mail.gnome.org/mailman/listinfo/xml">associated Web</a> page and
follow the instructions. <strong>Do not send code, I won't debug it</strong> follow the instructions. <strong>Do not send code, I won't debug it</strong>

View File

@ -106,9 +106,9 @@ A:link, A:visited, A:active { text-decoration: underline }
for IBM developerWorks</a> about using libxml.</li> for IBM developerWorks</a> about using libxml.</li>
<li>Check <a href="http://cvs.gnome.org/lxr/source/gnome-xml/TODO">the TODO <li>Check <a href="http://cvs.gnome.org/lxr/source/gnome-xml/TODO">the TODO
file</a>.</li> file</a>.</li>
<li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a> description. If you are <li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a>
starting a new project using libxml you should really use the 2.x description. If you are starting a new project using libxml you should
version.</li> really use the 2.x version.</li>
<li>And don't forget to look at the <a href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li> <li>And don't forget to look at the <a href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li>
</ol> </ol>
<p><a href="bugs.html">Daniel Veillard</a></p> <p><a href="bugs.html">Daniel Veillard</a></p>

View File

@ -96,7 +96,9 @@ packages installed to compile applications using libxml.) <a href="mailto:igor@s
maintainer of the Windows port, <a href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he maintainer of the Windows port, <a href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he
provides binaries</a>. <a href="mailto:Gary.Pennington@sun.com">Gary provides binaries</a>. <a href="mailto:Gary.Pennington@sun.com">Gary
Pennington</a> provides <a href="http://garypennington.net/libxml2/">Solaris Pennington</a> provides <a href="http://garypennington.net/libxml2/">Solaris
binaries</a>. <a href="mailto:Steve.Ball@zveno.com">Steve Ball</a> provides <a href="http://www.zveno.com/open_source/libxml2xslt.html">Mac Os X binaries</a>.</p> binaries</a>. <a href="mailto:Steve.Ball@zveno.com">Steve Ball</a> provides
<a href="http://www.zveno.com/open_source/libxml2xslt.html">Mac Os X
binaries</a>.</p>
<p><a name="Snapshot">Snapshot:</a></p> <p><a name="Snapshot">Snapshot:</a></p>
<ul> <ul>
<li>Code from the W3C cvs base libxml <a href="ftp://xmlsoft.org/cvs-snapshot.tar.gz">cvs-snapshot.tar.gz</a>.</li> <li>Code from the W3C cvs base libxml <a href="ftp://xmlsoft.org/cvs-snapshot.tar.gz">cvs-snapshot.tar.gz</a>.</li>

View File

@ -97,7 +97,8 @@ database</a>:</p>
and</li> and</li>
<li>Provide documentation fixes (either as patches to the code comments or <li>Provide documentation fixes (either as patches to the code comments or
as HTML diffs).</li> as HTML diffs).</li>
<li>Provide new documentations pieces (translations, examples, etc ...).</li> <li>Provide new documentations pieces (translations, examples, etc
...).</li>
<li>Check the TODO file and try to close one of the items.</li> <li>Check the TODO file and try to close one of the items.</li>
<li>Take one of the points raised in the archive or the bug database and <li>Take one of the points raised in the archive or the bug database and
provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me

View File

@ -126,7 +126,8 @@ languages:</p>
</li> </li>
</ul> </ul>
<p>In most cases libxml tries to implement the specifications in a relatively <p>In most cases libxml tries to implement the specifications in a relatively
strictly compliant way. As of release 2.4.16, libxml2 passes all 1800+ tests from the <a href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML Tests strictly compliant way. As of release 2.4.16, libxml2 passes all 1800+ tests
from the <a href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML Tests
Suite</a>.</p> Suite</a>.</p>
<p>To some extent libxml2 provides support for the following additional <p>To some extent libxml2 provides support for the following additional
specifications but doesn't claim to implement them completely:</p> specifications but doesn't claim to implement them completely:</p>

View File

@ -96,6 +96,17 @@ to test those</p>
Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a> Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a>
</li> </li>
</ul> </ul>
<p><strong>2.4.24: Aug 22 2002</strong></p>
<ul>
<li>XPath fixes (William), xf:escape-uri() (Wesley Terpstra)</li>
<li>Python binding fixes: makefiles (William), generator, rpm build, x86-64
(fcrozat)</li>
<li>HTML &lt;style&gt; and boolean attributes serializer fixes</li>
<li>C14N improvements by Aleksey</li>
<li>doc cleanups: Rick Jones </li>
<li>Windows compiler makefile updates: Igor and Elizabeth Barham</li>
<li>XInclude: implementation of fallback and xml:base fixup added</li>
</ul>
<h3>2.4.23: July 6 2002</h3> <h3>2.4.23: July 6 2002</h3>
<ul> <ul>
<li>performances patches: Peter Jacobi</li> <li>performances patches: Peter Jacobi</li>

View File

@ -87,8 +87,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</table> </table>
</td></tr></table></td> </td></tr></table></td>
<td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"> <td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd">
<p>There are a number of language bindings and wrappers available for libxml2, <p>There are a number of language bindings and wrappers available for
the list below is not exhaustive. Please contact the <a href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a> libxml2, the list below is not exhaustive. Please contact the <a href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>
(<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in (<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in
order to get updates to this list or to discuss the specific topic of libxml2 order to get updates to this list or to discuss the specific topic of libxml2
or libxslt wrappers or bindings:</p> or libxslt wrappers or bindings:</p>

View File

@ -58,7 +58,8 @@ languages:</p>
</ul> </ul>
<p>In most cases libxml tries to implement the specifications in a relatively <p>In most cases libxml tries to implement the specifications in a relatively
strictly compliant way. As of release 2.4.16, libxml2 passes all 1800+ tests from the <a strictly compliant way. As of release 2.4.16, libxml2 passes all 1800+ tests
from the <a
href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML Tests href="http://www.oasis-open.org/committees/xml-conformance/">OASIS XML Tests
Suite</a>.</p> Suite</a>.</p>
@ -159,9 +160,9 @@ libxml2</p>
wording</p> wording</p>
</li> </li>
<li><em>Can I embed libxml in a proprietary application ?</em> <li><em>Can I embed libxml in a proprietary application ?</em>
<p>Yes. The MIT License allows you to keep proprietary the changes <p>Yes. The MIT License allows you to keep proprietary the changes you
you made to libxml, but it would be graceful to send-back bug fixes made to libxml, but it would be graceful to send-back bug fixes and
and improvements as patches for possible incorporation in the main improvements as patches for possible incorporation in the main
development tree.</p> development tree.</p>
</li> </li>
</ol> </ol>
@ -182,8 +183,8 @@ libxml2</p>
</li> </li>
<li><em>I see libxml and libxml2 releases, which one should I install ?</em> <li><em>I see libxml and libxml2 releases, which one should I install ?</em>
<ul> <ul>
<li>If you are not constrained by backward compatibility issues <li>If you are not constrained by backward compatibility issues with
with existing applications, install libxml2 only</li> existing applications, install libxml2 only</li>
<li>If you are not doing development, you can safely install both. <li>If you are not doing development, you can safely install both.
Usually the packages <a Usually the packages <a
href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a
@ -202,8 +203,8 @@ libxml2</p>
</li> </li>
<li><em>I can't install the libxml package, it conflicts with libxml0</em> <li><em>I can't install the libxml package, it conflicts with libxml0</em>
<p>You probably have an old libxml0 package used to provide the shared <p>You probably have an old libxml0 package used to provide the shared
library for libxml.so.0, you can probably safely remove it. The library for libxml.so.0, you can probably safely remove it. The libxml
libxml packages provided on <a packages provided on <a
href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> provide href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> provide
libxml.so.0</p> libxml.so.0</p>
</li> </li>
@ -212,9 +213,9 @@ libxml2</p>
<p>The most generic solution is to re-fetch the latest src.rpm , and <p>The most generic solution is to re-fetch the latest src.rpm , and
rebuild it locally with</p> rebuild it locally with</p>
<p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p> <p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p>
<p>If everything goes well it will generate two binary rpm packages (one providing <p>If everything goes well it will generate two binary rpm packages (one
the shared libs and xmllint, and the other one, the -devel package, providing the shared libs and xmllint, and the other one, the -devel
providing includes, static libraries and scripts needed to build package, providing includes, static libraries and scripts needed to build
applications with libxml(2)) that you can install locally.</p> applications with libxml(2)) that you can install locally.</p>
</li> </li>
</ol> </ol>
@ -253,16 +254,17 @@ libxml2</p>
</ul> </ul>
</li> </li>
<li><em>Make check fails on some platforms</em> <li><em>Make check fails on some platforms</em>
<p>Sometimes the regression tests' results don't completely match the value <p>Sometimes the regression tests' results don't completely match the
produced by the parser, and the makefile uses diff to print the delta. On value produced by the parser, and the makefile uses diff to print the
some platforms the diff return breaks the compilation process; if the delta. On some platforms the diff return breaks the compilation process;
diff is small this is probably not a serious problem.</p> if the diff is small this is probably not a serious problem.</p>
<p>Sometimes (especially on Solaris) make checks fail due to limitations <p>Sometimes (especially on Solaris) make checks fail due to limitations
in make. Try using GNU-make instead.</p> in make. Try using GNU-make instead.</p>
</li> </li>
<li><em>I use the CVS version and there is no configure script</em> <li><em>I use the CVS version and there is no configure script</em>
<p>The configure script (and other Makefiles) are generated. Use the autogen.sh <p>The configure script (and other Makefiles) are generated. Use the
script to regenerate the configure script and Makefiles, like:</p> autogen.sh script to regenerate the configure script and Makefiles,
like:</p>
<p><code>./autogen.sh --prefix=/usr --disable-shared</code></p> <p><code>./autogen.sh --prefix=/usr --disable-shared</code></p>
</li> </li>
<li><em>I have troubles when running make tests with gcc-3.0</em> <li><em>I have troubles when running make tests with gcc-3.0</em>
@ -345,8 +347,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<p>Check the previous points 1/ and 2/ raised before, and please send <p>Check the previous points 1/ and 2/ raised before, and please send
patches.</p> patches.</p>
</li> </li>
<li><em>Where can I get more examples and information than privoded on the web <li><em>Where can I get more examples and information than privoded on the
page?</em> web page?</em>
<p>Ideally a libxml book would be nice. I have no such plan ... But you <p>Ideally a libxml book would be nice. I have no such plan ... But you
can:</p> can:</p>
<ul> <ul>
@ -363,9 +365,9 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<li><a <li><a
href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&amp;dir=gnome-xml">Browse href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&amp;dir=gnome-xml">Browse
the libxml source</a> , I try to write code as clean and documented the libxml source</a> , I try to write code as clean and documented
as possible, so looking at it may be helpful. In particular the code of as possible, so looking at it may be helpful. In particular the code
xmllint.c and of the various testXXX.c test programs should provide of xmllint.c and of the various testXXX.c test programs should
good examples of how to do things with the library.</li> provide good examples of how to do things with the library.</li>
</ul> </ul>
</li> </li>
<li>What about C++ ? <li>What about C++ ?
@ -388,8 +390,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
</li> </li>
<li>How to validate a document a posteriori ? <li>How to validate a document a posteriori ?
<p>It is possible to validate documents which had not been validated at <p>It is possible to validate documents which had not been validated at
initial parsing time or documents which have been built from scratch using initial parsing time or documents which have been built from scratch
the API. Use the <a using the API. Use the <a
href="http://xmlsoft.org/html/libxml-valid.html#XMLVALIDATEDTD">xmlValidateDtd()</a> href="http://xmlsoft.org/html/libxml-valid.html#XMLVALIDATEDTD">xmlValidateDtd()</a>
function. It is also possible to simply add a DTD to an existing function. It is also possible to simply add a DTD to an existing
document:</p> document:</p>
@ -430,9 +432,9 @@ xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
for IBM developerWorks</a> about using libxml.</li> for IBM developerWorks</a> about using libxml.</li>
<li>Check <a href="http://cvs.gnome.org/lxr/source/gnome-xml/TODO">the TODO <li>Check <a href="http://cvs.gnome.org/lxr/source/gnome-xml/TODO">the TODO
file</a>.</li> file</a>.</li>
<li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a> description. If you are <li>Read the <a href="upgrade.html">1.x to 2.x upgrade path</a>
starting a new project using libxml you should really use the 2.x description. If you are starting a new project using libxml you should
version.</li> really use the 2.x version.</li>
<li>And don't forget to look at the <a <li>And don't forget to look at the <a
href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li> href="http://mail.gnome.org/archives/xml/">mailing-list archive</a>.</li>
</ol> </ol>
@ -442,9 +444,9 @@ xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
<p>Well, bugs or missing features are always possible, and I will make a <p>Well, bugs or missing features are always possible, and I will make a
point of fixing them in a timely fashion. The best way to report a bug is to point of fixing them in a timely fashion. The best way to report a bug is to
use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml">Gnome use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml">Gnome
bug tracking database</a> (make sure to use the "libxml2" module name). I look bug tracking database</a> (make sure to use the "libxml2" module name). I
at reports there regularly and it's good to have a reminder when a bug is look at reports there regularly and it's good to have a reminder when a bug
still open. Be sure to specify that the bug is for the package libxml2.</p> is still open. Be sure to specify that the bug is for the package libxml2.</p>
<p>There is also a mailing-list <a <p>There is also a mailing-list <a
href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an <a href="mailto:xml@gnome.org">xml@gnome.org</a> for libxml, with an <a
@ -502,7 +504,8 @@ database</a>:</p>
and</li> and</li>
<li>Provide documentation fixes (either as patches to the code comments or <li>Provide documentation fixes (either as patches to the code comments or
as HTML diffs).</li> as HTML diffs).</li>
<li>Provide new documentations pieces (translations, examples, etc ...).</li> <li>Provide new documentations pieces (translations, examples, etc
...).</li>
<li>Check the TODO file and try to close one of the items.</li> <li>Check the TODO file and try to close one of the items.</li>
<li>Take one of the points raised in the archive or the bug database and <li>Take one of the points raised in the archive or the bug database and
provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me
@ -531,7 +534,9 @@ maintainer of the Windows port, <a
href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he
provides binaries</a>. <a href="mailto:Gary.Pennington@sun.com">Gary provides binaries</a>. <a href="mailto:Gary.Pennington@sun.com">Gary
Pennington</a> provides <a href="http://garypennington.net/libxml2/">Solaris Pennington</a> provides <a href="http://garypennington.net/libxml2/">Solaris
binaries</a>. <a href="mailto:Steve.Ball@zveno.com">Steve Ball</a> provides <a href="http://www.zveno.com/open_source/libxml2xslt.html">Mac Os X binaries</a>.</p> binaries</a>. <a href="mailto:Steve.Ball@zveno.com">Steve Ball</a> provides
<a href="http://www.zveno.com/open_source/libxml2xslt.html">Mac Os X
binaries</a>.</p>
<p><a name="Snapshot">Snapshot:</a></p> <p><a name="Snapshot">Snapshot:</a></p>
<ul> <ul>
@ -572,6 +577,18 @@ to test those</p>
Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a></li> Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a></li>
</ul> </ul>
<p><strong>2.4.24: Aug 22 2002</strong></p>
<ul>
<li>XPath fixes (William), xf:escape-uri() (Wesley Terpstra)</li>
<li>Python binding fixes: makefiles (William), generator, rpm build, x86-64
(fcrozat)</li>
<li>HTML &lt;style&gt; and boolean attributes serializer fixes</li>
<li>C14N improvements by Aleksey</li>
<li>doc cleanups: Rick Jones </li>
<li>Windows compiler makefile updates: Igor and Elizabeth Barham</li>
<li>XInclude: implementation of fallback and xml:base fixup added</li>
</ul>
<h3>2.4.23: July 6 2002</h3> <h3>2.4.23: July 6 2002</h3>
<ul> <ul>
<li>performances patches: Peter Jacobi</li> <li>performances patches: Peter Jacobi</li>
@ -1370,19 +1387,20 @@ document</a>:</p>
&lt;/EXAMPLE&gt;</pre> &lt;/EXAMPLE&gt;</pre>
<p>The first line specifies that it is an XML document and gives useful <p>The first line specifies that it is an XML document and gives useful
information about its encoding. Then the rest of the document is a text format whose information about its encoding. Then the rest of the document is a text
structure is specified by tags between brackets. <strong>Each tag opened has format whose structure is specified by tags between brackets. <strong>Each
to be closed</strong>. XML is pedantic about this. However, if a tag is empty tag opened has to be closed</strong>. XML is pedantic about this. However, if
(no content), a single tag can serve as both the opening and closing tag if a tag is empty (no content), a single tag can serve as both the opening and
it ends with <code>/&gt;</code> rather than with <code>&gt;</code>. Note closing tag if it ends with <code>/&gt;</code> rather than with
that, for example, the image tag has no content (just an attribute) and is <code>&gt;</code>. Note that, for example, the image tag has no content (just
closed by ending the tag with <code>/&gt;</code>.</p> an attribute) and is closed by ending the tag with <code>/&gt;</code>.</p>
<p>XML can be applied successfully to a wide range of tasks, ranging from long term <p>XML can be applied successfully to a wide range of tasks, ranging from
structured document maintenance (where it follows the steps of SGML) to long term structured document maintenance (where it follows the steps of
simple data encoding mechanisms like configuration file formatting (glade), SGML) to simple data encoding mechanisms like configuration file formatting
spreadsheets (gnumeric), or even shorter lived documents such as WebDAV where (glade), spreadsheets (gnumeric), or even shorter lived documents such as
it is used to encode remote calls between a client and a server.</p> WebDAV where it is used to encode remote calls between a client and a
server.</p>
<h2><a name="XSLT">XSLT</a></h2> <h2><a name="XSLT">XSLT</a></h2>
@ -1392,8 +1410,8 @@ it is used to encode remote calls between a client and a server.</p>
language for transforming XML documents into other XML documents (or language for transforming XML documents into other XML documents (or
HTML/textual output).</p> HTML/textual output).</p>
<p>A separate library called libxslt is being developed on top of libxml2. This <p>A separate library called libxslt is being developed on top of libxml2.
module "libxslt" too can be found in the Gnome CVS base.</p> This module "libxslt" too can be found in the Gnome CVS base.</p>
<p>You can check the <a <p>You can check the <a
href="http://cvs.gnome.org/lxr/source/libxslt/FEATURES">features</a> href="http://cvs.gnome.org/lxr/source/libxslt/FEATURES">features</a>
@ -1403,8 +1421,8 @@ name="Changelog">Changelog</a>.</p>
<h2><a name="Python">Python and bindings</a></h2> <h2><a name="Python">Python and bindings</a></h2>
<p>There are a number of language bindings and wrappers available for libxml2, <p>There are a number of language bindings and wrappers available for
the list below is not exhaustive. Please contact the <a libxml2, the list below is not exhaustive. Please contact the <a
href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a> href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>
(<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in (<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in
order to get updates to this list or to discuss the specific topic of libxml2 order to get updates to this list or to discuss the specific topic of libxml2
@ -1897,8 +1915,8 @@ of the XML life cycle. Briefly a DTD defines all the possible elements to be
found within your document, what is the formal shape of your document tree found within your document, what is the formal shape of your document tree
(by defining the allowed content of an element; either text, a regular (by defining the allowed content of an element; either text, a regular
expression for the allowed list of children, or mixed content i.e. both text expression for the allowed list of children, or mixed content i.e. both text
and children). The DTD also defines the valid attributes for all elements and children). The DTD also defines the valid attributes for all elements and
and the types of those attributes.</p> the types of those attributes.</p>
<h3><a name="definition1">The definition</a></h3> <h3><a name="definition1">The definition</a></h3>
@ -1917,10 +1935,10 @@ ancient...</p>
<h3><a name="Simple1">Simple rules</a></h3> <h3><a name="Simple1">Simple rules</a></h3>
<p>Writing DTDs can be done in many ways. The rules to build them if you <p>Writing DTDs can be done in many ways. The rules to build them if you need
need something permanent or something which can evolve over time can be radically something permanent or something which can evolve over time can be radically
different. Really complex DTDs like DocBook ones are flexible but quite harder different. Really complex DTDs like DocBook ones are flexible but quite
to design. I will just focus on DTDs for a formats with a fixed simple harder to design. I will just focus on DTDs for a formats with a fixed simple
structure. It is just a set of basic rules, and definitely not exhaustive nor structure. It is just a set of basic rules, and definitely not exhaustive nor
usable for complex DTD design.</p> usable for complex DTD design.</p>
@ -2027,9 +2045,9 @@ meaning that it is optional, or the default value (possibly prefixed by
<h3><a name="Some1">Some examples</a></h3> <h3><a name="Some1">Some examples</a></h3>
<p>The directory <code>test/valid/dtds/</code> in the libxml distribution <p>The directory <code>test/valid/dtds/</code> in the libxml distribution
contains some complex DTD examples. The example in the file <code>test/valid/dia.xml</code> contains some complex DTD examples. The example in the file
shows an XML file where the simple DTD is directly included within <code>test/valid/dia.xml</code> shows an XML file where the simple DTD is
the document.</p> directly included within the document.</p>
<h3><a name="validate1">How to validate</a></h3> <h3><a name="validate1">How to validate</a></h3>
@ -2042,8 +2060,8 @@ For example the following validates a copy of the first revision of the XML
<p>the -- noout is used to disable output of the resulting tree.</p> <p>the -- noout is used to disable output of the resulting tree.</p>
<p>The <code>--dtdvalid dtd</code> allows validation of the document(s) against <p>The <code>--dtdvalid dtd</code> allows validation of the document(s)
a given DTD.</p> against a given DTD.</p>
<p>Libxml exports an API to handle DTDs and validation, check the <a <p>Libxml exports an API to handle DTDs and validation, check the <a
href="http://xmlsoft.org/html/libxml-valid.html">associated href="http://xmlsoft.org/html/libxml-valid.html">associated
@ -2644,6 +2662,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
} </pre> } </pre>
</li> </li>
<li>And then use it to save the document: <li>And then use it to save the document:

View File

@ -116,8 +116,8 @@ of the XML life cycle. Briefly a DTD defines all the possible elements to be
found within your document, what is the formal shape of your document tree found within your document, what is the formal shape of your document tree
(by defining the allowed content of an element; either text, a regular (by defining the allowed content of an element; either text, a regular
expression for the allowed list of children, or mixed content i.e. both text expression for the allowed list of children, or mixed content i.e. both text
and children). The DTD also defines the valid attributes for all elements and children). The DTD also defines the valid attributes for all elements and
and the types of those attributes.</p> the types of those attributes.</p>
<h3><a name="definition1">The definition</a></h3> <h3><a name="definition1">The definition</a></h3>
<p>The <a href="http://www.w3.org/TR/REC-xml">W3C XML Recommendation</a> (<a href="http://www.xml.com/axml/axml.html">Tim Bray's annotated version of <p>The <a href="http://www.w3.org/TR/REC-xml">W3C XML Recommendation</a> (<a href="http://www.xml.com/axml/axml.html">Tim Bray's annotated version of
Rev1</a>):</p> Rev1</a>):</p>
@ -130,10 +130,10 @@ Rev1</a>):</p>
<p>(unfortunately) all this is inherited from the SGML world, the syntax is <p>(unfortunately) all this is inherited from the SGML world, the syntax is
ancient...</p> ancient...</p>
<h3><a name="Simple1">Simple rules</a></h3> <h3><a name="Simple1">Simple rules</a></h3>
<p>Writing DTDs can be done in many ways. The rules to build them if you <p>Writing DTDs can be done in many ways. The rules to build them if you need
need something permanent or something which can evolve over time can be radically something permanent or something which can evolve over time can be radically
different. Really complex DTDs like DocBook ones are flexible but quite harder different. Really complex DTDs like DocBook ones are flexible but quite
to design. I will just focus on DTDs for a formats with a fixed simple harder to design. I will just focus on DTDs for a formats with a fixed simple
structure. It is just a set of basic rules, and definitely not exhaustive nor structure. It is just a set of basic rules, and definitely not exhaustive nor
usable for complex DTD design.</p> usable for complex DTD design.</p>
<h4> <h4>
@ -218,9 +218,9 @@ meaning that it is optional, or the default value (possibly prefixed by
</ul> </ul>
<h3><a name="Some1">Some examples</a></h3> <h3><a name="Some1">Some examples</a></h3>
<p>The directory <code>test/valid/dtds/</code> in the libxml distribution <p>The directory <code>test/valid/dtds/</code> in the libxml distribution
contains some complex DTD examples. The example in the file <code>test/valid/dia.xml</code> contains some complex DTD examples. The example in the file
shows an XML file where the simple DTD is directly included within <code>test/valid/dia.xml</code> shows an XML file where the simple DTD is
the document.</p> directly included within the document.</p>
<h3><a name="validate1">How to validate</a></h3> <h3><a name="validate1">How to validate</a></h3>
<p>The simplest way is to use the xmllint program included with libxml. The <p>The simplest way is to use the xmllint program included with libxml. The
<code>--valid</code> option turns-on validation of the files given as input. <code>--valid</code> option turns-on validation of the files given as input.
@ -228,8 +228,8 @@ For example the following validates a copy of the first revision of the XML
1.0 specification:</p> 1.0 specification:</p>
<p><code>xmllint --valid --noout test/valid/REC-xml-19980210.xml</code></p> <p><code>xmllint --valid --noout test/valid/REC-xml-19980210.xml</code></p>
<p>the -- noout is used to disable output of the resulting tree.</p> <p>the -- noout is used to disable output of the resulting tree.</p>
<p>The <code>--dtdvalid dtd</code> allows validation of the document(s) against <p>The <code>--dtdvalid dtd</code> allows validation of the document(s)
a given DTD.</p> against a given DTD.</p>
<p>Libxml exports an API to handle DTDs and validation, check the <a href="http://xmlsoft.org/html/libxml-valid.html">associated <p>Libxml exports an API to handle DTDs and validation, check the <a href="http://xmlsoft.org/html/libxml-valid.html">associated
description</a>.</p> description</a>.</p>
<h3><a name="Other1">Other resources</a></h3> <h3><a name="Other1">Other resources</a></h3>

View File

@ -238,6 +238,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
} </pre> } </pre>
</li> </li>
<li>And then use it to save the document: <li>And then use it to save the document:

View File

@ -27,21 +27,21 @@ extern void xmlCheckVersion(int version);
* *
* the version string like "1.2.3" * the version string like "1.2.3"
*/ */
#define LIBXML_DOTTED_VERSION "2.4.23" #define LIBXML_DOTTED_VERSION "2.4.24"
/** /**
* LIBXML_VERSION: * LIBXML_VERSION:
* *
* the version number: 1.2.3 value is 1002003 * the version number: 1.2.3 value is 1002003
*/ */
#define LIBXML_VERSION 20423 #define LIBXML_VERSION 20424
/** /**
* LIBXML_VERSION_STRING: * LIBXML_VERSION_STRING:
* *
* the version number string, 1.2.3 value is "1002003" * the version number string, 1.2.3 value is "1002003"
*/ */
#define LIBXML_VERSION_STRING "20423" #define LIBXML_VERSION_STRING "20424"
/** /**
* LIBXML_TEST_VERSION: * LIBXML_TEST_VERSION:
@ -49,7 +49,7 @@ extern void xmlCheckVersion(int version);
* Macro to check that the libxml version in use is compatible with * Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against * the version the software has been compiled against
*/ */
#define LIBXML_TEST_VERSION xmlCheckVersion(20423); #define LIBXML_TEST_VERSION xmlCheckVersion(20424);
#if 0 #if 0
/** /**

View File

@ -9794,7 +9794,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
if (doc == NULL) { if (doc == NULL) {
ctxt->myDoc = newDoc; ctxt->myDoc = newDoc;
} else { } else {
ctxt->myDoc = doc; ctxt->myDoc = newDoc;
newDoc->children->doc = doc; newDoc->children->doc = doc;
} }
ctxt->instate = XML_PARSER_CONTENT; ctxt->instate = XML_PARSER_CONTENT;

View File

@ -383,6 +383,31 @@ def print_function_wrapper(name, output, export, include):
unknown_types[ret[0]] = [name] unknown_types[ret[0]] = [name]
return -1 return -1
if file == "debugXML":
include.write("#ifdef LIBXML_DEBUG_ENABLED\n");
export.write("#ifdef LIBXML_DEBUG_ENABLED\n");
output.write("#ifdef LIBXML_DEBUG_ENABLED\n");
elif file == "HTMLtree" or file == "HTMLparser":
include.write("#ifdef LIBXML_HTML_ENABLED\n");
export.write("#ifdef LIBXML_HTML_ENABLED\n");
output.write("#ifdef LIBXML_HTML_ENABLED\n");
elif file == "c14n":
include.write("#ifdef LIBXML_C14N_ENABLED\n");
export.write("#ifdef LIBXML_C14N_ENABLED\n");
output.write("#ifdef LIBXML_C14N_ENABLED\n");
elif file == "xpathInternals" or file == "xpath":
include.write("#ifdef LIBXML_XPATH_ENABLED\n");
export.write("#ifdef LIBXML_XPATH_ENABLED\n");
output.write("#ifdef LIBXML_XPATH_ENABLED\n");
elif file == "xpointer":
include.write("#ifdef LIBXML_XPTR_ENABLED\n");
export.write("#ifdef LIBXML_XPTR_ENABLED\n");
output.write("#ifdef LIBXML_XPTR_ENABLED\n");
elif file == "xinclude":
include.write("#ifdef LIBXML_XINCLUDE_ENABLED\n");
export.write("#ifdef LIBXML_XINCLUDE_ENABLED\n");
output.write("#ifdef LIBXML_XINCLUDE_ENABLED\n");
include.write("PyObject * ") include.write("PyObject * ")
include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name)); include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name));
@ -417,6 +442,30 @@ def print_function_wrapper(name, output, export, include):
output.write(c_call) output.write(c_call)
output.write(ret_convert) output.write(ret_convert)
output.write("}\n\n") output.write("}\n\n")
if file == "debugXML":
include.write("#endif /* LIBXML_DEBUG_ENABLED */\n");
export.write("#endif /* LIBXML_DEBUG_ENABLED */\n");
output.write("#endif /* LIBXML_DEBUG_ENABLED */\n");
elif file == "HTMLtree" or file == "HTMLparser":
include.write("#endif /* LIBXML_HTML_ENABLED */\n");
export.write("#endif /* LIBXML_HTML_ENABLED */\n");
output.write("#endif /* LIBXML_HTML_ENABLED */\n");
elif file == "c14n":
include.write("#endif /* LIBXML_C14N_ENABLED */\n");
export.write("#endif /* LIBXML_C14N_ENABLED */\n");
output.write("#endif /* LIBXML_C14N_ENABLED */\n");
elif file == "xpathInternals" or file == "xpath":
include.write("#endif /* LIBXML_XPATH_ENABLED */\n");
export.write("#endif /* LIBXML_XPATH_ENABLED */\n");
output.write("#endif /* LIBXML_XPATH_ENABLED */\n");
elif file == "xpointer":
include.write("#endif /* LIBXML_XPTR_ENABLED */\n");
export.write("#endif /* LIBXML_XPTR_ENABLED */\n");
output.write("#endif /* LIBXML_XPTR_ENABLED */\n");
elif file == "xinclude":
include.write("#endif /* LIBXML_XINCLUDE_ENABLED */\n");
export.write("#endif /* LIBXML_XINCLUDE_ENABLED */\n");
output.write("#endif /* LIBXML_XINCLUDE_ENABLED */\n");
return 1 return 1
def buildStubs(): def buildStubs():

View File

@ -49,9 +49,11 @@ int main(int argc, char **argv) {
xmlSchemaPtr schema = NULL; xmlSchemaPtr schema = NULL;
for (i = 1; i < argc ; i++) { for (i = 1; i < argc ; i++) {
#ifdef LIBXML_DEBUG_ENABLED
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++; debug++;
else else
#endif
if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) { if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) {
noout++; noout++;
} }
@ -69,8 +71,10 @@ int main(int argc, char **argv) {
stderr); stderr);
schema = xmlSchemaParse(ctxt); schema = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt); xmlSchemaFreeParserCtxt(ctxt);
#ifdef LIBXML_DEBUG_ENABLED
if (debug) if (debug)
xmlSchemaDump(stdout, schema); xmlSchemaDump(stdout, schema);
#endif
} else { } else {
xmlDocPtr doc; xmlDocPtr doc;
@ -109,7 +113,9 @@ int main(int argc, char **argv) {
printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n", printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n",
argv[0]); argv[0]);
printf("\tParse the HTML files and output the result of the parsing\n"); printf("\tParse the HTML files and output the result of the parsing\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n"); printf("\t--debug : dump a debug tree of the in-memory document\n");
#endif
printf("\t--noout : do not print the result\n"); printf("\t--noout : do not print the result\n");
} }
xmlSchemaCleanupTypes(); xmlSchemaCleanupTypes();

121
xpath.c
View File

@ -2825,7 +2825,7 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix,
ctxt->nsHash = xmlHashCreate(10); ctxt->nsHash = xmlHashCreate(10);
if (ctxt->nsHash == NULL) if (ctxt->nsHash == NULL)
return(-1); return(-1);
return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) ns_uri, return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) xmlStrdup(ns_uri),
(xmlHashDeallocator)xmlFree)); (xmlHashDeallocator)xmlFree));
} }
@ -2875,7 +2875,7 @@ xmlXPathRegisteredNsCleanup(xmlXPathContextPtr ctxt) {
if (ctxt == NULL) if (ctxt == NULL)
return; return;
xmlHashFree(ctxt->nsHash, NULL); xmlHashFree(ctxt->nsHash, (xmlHashDeallocator)xmlFree);
ctxt->nsHash = NULL; ctxt->nsHash = NULL;
} }
@ -10773,6 +10773,119 @@ xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt) {
return(res); return(res);
} }
/************************************************************************
* *
* Extra functions not pertaining to the XPath spec *
* *
************************************************************************/
/**
* xmlXPathEscapeUriFunction:
* @ctxt: the XPath Parser context
* @nargs: the number of arguments
*
* Implement the escape-uri() XPath function
* string escape-uri(string $str, bool $escape-reserved)
*
* This function applies the URI escaping rules defined in section 2 of [RFC
* 2396] to the string supplied as $uri-part, which typically represents all
* or part of a URI. The effect of the function is to replace any special
* character in the string by an escape sequence of the form %xx%yy...,
* where xxyy... is the hexadecimal representation of the octets used to
* represent the character in UTF-8.
*
* The set of characters that are escaped depends on the setting of the
* boolean argument $escape-reserved.
*
* If $escape-reserved is true, all characters are escaped other than lower
* case letters a-z, upper case letters A-Z, digits 0-9, and the characters
* referred to in [RFC 2396] as "marks": specifically, "-" | "_" | "." | "!"
* | "~" | "*" | "'" | "(" | ")". The "%" character itself is escaped only
* if it is not followed by two hexadecimal digits (that is, 0-9, a-f, and
* A-F).
*
* If $escape-reserved is false, the behavior differs in that characters
* referred to in [RFC 2396] as reserved characters are not escaped. These
* characters are ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ",".
*
* [RFC 2396] does not define whether escaped URIs should use lower case or
* upper case for hexadecimal digits. To ensure that escaped URIs can be
* compared using string comparison functions, this function must always use
* the upper-case letters A-F.
*
* Generally, $escape-reserved should be set to true when escaping a string
* that is to form a single part of a URI, and to false when escaping an
* entire URI or URI reference.
*
* In the case of non-ascii characters, the string is encoded according to
* utf-8 and then converted according to RFC 2396.
*
* Examples
* xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true())
* returns "gopher%3A%2F%2Fspinaltap.micro.umn.edu%2F00%2FWeather%2FCalifornia%2FLos%20Angeles%23ocean"
* xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), false())
* returns "gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles%23ocean"
*
*/
void
xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr str;
int escape_reserved;
xmlBufferPtr target;
xmlChar *cptr;
xmlChar escape[4];
CHECK_ARITY(2);
escape_reserved = xmlXPathPopBoolean(ctxt);
CAST_TO_STRING;
str = valuePop(ctxt);
target = xmlBufferCreate();
escape[0] = '%';
escape[3] = 0;
if (target) {
for (cptr = str->stringval; *cptr; cptr++) {
if ((*cptr >= 'A' && *cptr <= 'Z') ||
(*cptr >= 'a' && *cptr <= 'z') ||
(*cptr >= '0' && *cptr <= '9') ||
*cptr == '-' || *cptr == '_' || *cptr == '.' ||
*cptr == '!' || *cptr == '~' || *cptr == '*' ||
*cptr == '\''|| *cptr == '(' || *cptr == ')' ||
(*cptr == '%' &&
((cptr[1] >= 'A' && cptr[1] <= 'F') ||
(cptr[1] >= 'a' && cptr[1] <= 'f') ||
(cptr[1] >= '0' && cptr[1] <= '9')) &&
((cptr[2] >= 'A' && cptr[2] <= 'F') ||
(cptr[2] >= 'a' && cptr[2] <= 'f') ||
(cptr[2] >= '0' && cptr[2] <= '9'))) ||
(!escape_reserved &&
(*cptr == ';' || *cptr == '/' || *cptr == '?' ||
*cptr == ':' || *cptr == '@' || *cptr == '&' ||
*cptr == '=' || *cptr == '+' || *cptr == '$' ||
*cptr == ','))) {
xmlBufferAdd(target, cptr, 1);
} else {
if ((*cptr >> 4) < 10)
escape[1] = '0' + (*cptr >> 4);
else
escape[1] = 'A' - 10 + (*cptr >> 4);
if ((*cptr & 0xF) < 10)
escape[2] = '0' + (*cptr & 0xF);
else
escape[2] = 'A' - 10 + (*cptr & 0xF);
xmlBufferAdd(target, &escape[0], 3);
}
}
}
valuePush(ctxt, xmlXPathNewString(xmlBufferContent(target)));
xmlBufferFree(target);
xmlXPathFreeObject(str);
}
/** /**
* xmlXPathRegisterAllFunctions: * xmlXPathRegisterAllFunctions:
* @ctxt: the XPath context * @ctxt: the XPath context
@ -10836,6 +10949,10 @@ xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt)
xmlXPathTrueFunction); xmlXPathTrueFunction);
xmlXPathRegisterFunc(ctxt, (const xmlChar *)"translate", xmlXPathRegisterFunc(ctxt, (const xmlChar *)"translate",
xmlXPathTranslateFunction); xmlXPathTranslateFunction);
xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri",
(const xmlChar *)"http://www.w3.org/2002/08/xquery-functions",
xmlXPathEscapeUriFunction);
} }
#endif /* LIBXML_XPATH_ENABLED */ #endif /* LIBXML_XPATH_ENABLED */