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 XSLT C library for GNOME</title>
6  <meta name="GENERATOR" content="amaya 8.5, see http://www.w3.org/Amaya/">
7  <meta http-equiv="Content-Type" content="text/html">
8</head>
9
10<body bgcolor="#ffffff">
11<h1 align="center">The XSLT C library for GNOME</h1>
12
13<h1 style="text-align: center">libxslt</h1>
14
15<p>Libxslt is the <a href="http://www.w3.org/TR/xslt">XSLT</a> C library
16developed for the GNOME project. XSLT itself is a an XML language to define
17transformation for XML. Libxslt is based on <a
18href="http://xmlsoft.org/">libxml2</a> the XML C library developed for the
19GNOME project. It also implements most of the <a
20href="http://www.exslt.org/">EXSLT</a> set of processor-portable extensions
21functions and some of Saxon's evaluate and expressions extensions.</p>
22
23<p>People can either embed the library in their application or use xsltproc
24the command line processing tool. This library is free software and can be
25reused in commercial applications (see the <a href="intro.html">intro</a>)</p>
26
27<p>External documents:</p>
28<ul>
29  <li>John Fleck wrote <a href="tutorial/libxslttutorial.html">a tutorial for
30    libxslt</a></li>
31  <li><a href="xsltproc.html">xsltproc user manual</a></li>
32  <li><a href="http://xmlsoft.org/">the libxml documentation</a></li>
33</ul>
34
35<p></p>
36
37<p>Logo designed by <a href="mailto:liyanage@access.ch">Marc Liyanage</a>.</p>
38
39<h2><a name="Introducti">Introduction</a></h2>
40
41<p>This document describes <a href="http://xmlsoft.org/XSLT/">libxslt</a>,
42the <a href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the
43<a href="http://www.gnome.org/">GNOME</a> project.</p>
44
45<p>Here are some key points about libxslt:</p>
46<ul>
47  <li>Libxslt is a C implementation</li>
48  <li>Libxslt is based on libxml for XML parsing, tree manipulation and XPath
49    support</li>
50  <li>It is written in plain C, making as few assumptions as possible, and
51    sticking closely to ANSI C/POSIX for easy embedding. Should works on
52    Linux/Unix/Windows.</li>
53  <li>This library is released under the <a
54    href="http://www.opensource.org/licenses/mit-license.html">MIT
55  Licence</a></li>
56  <li>Though not designed primarily with performances in mind, libxslt seems
57    to be a relatively fast processor.</li>
58</ul>
59
60<h2><a name="Documentat">Documentation</a></h2>
61
62<p>There are some on-line resources about using libxslt:</p>
63<ol>
64  <li>Check the <a href="html/libxslt-lib.html#LIBXSLT-LIB">API
65    documentation</a> automatically extracted from code comments (using the
66    program apibuild.py, developed for libxml, together with the xsl script
67    'newapi.xsl' and the libxslt xsltproc program).</li>
68  <li>Look at the <a href="http://mail.gnome.org/archives/xslt/">mailing-list
69    archive</a>.</li>
70  <li>Of course since libxslt is based on libxml, it's a good idea to at
71    least read <a href="http://xmlsoft.org/">libxml description</a></li>
72</ol>
73
74<h2><a name="Reporting">Reporting bugs and getting help</a></h2>
75
76<p>If you need help with the XSLT language itself, here are a number of
77useful resources:</p>
78<ul>
79  <li>I strongly suggest to subscribe to <a
80    href="http://www.mulberrytech.com/xsl/xsl-list">XSL-list</a>, check <a
81    href="http://www.biglist.com/lists/xsl-list/archives/">the XSL-list
82    archives</a></li>
83  <li>The <a href="http://www.dpawson.co.uk/xsl/xslfaq.html">XSL FAQ</a>.</li>
84  <li>The <a
85    href="http://www.nwalsh.com/docs/tutorials/xsl/xsl/slides.html">tutorial</a>
86    written by Paul Grosso and Norman Walsh is a very good on-line
87    introdution to the language.</li>
88  <li>The <a
89    href="http://www.zvon.org/xxl/XSLTutorial/Books/Book1/index.html">only
90    Zvon XSLT tutorial</a> details a lot of constructs with examples.</li>
91  <li><a href="http://www.jenitennison.com/xslt/index.html">Jeni Tennison's
92    XSLT</a> pages provide links to a lot of answers</li>
93  <li>the <a href="http://incrementaldevelopment.com/xsltrick/">Gallery of
94    XSLT Tricks</a> provides non-standard use case of XSLT</li>
95  <li>And I suggest to buy Michael Kay "XSLT Programmer's Reference" book
96    published by <a href="http://www.wrox.com/">Wrox</a> if you plan to work
97    seriously with XSLT in the future.</li>
98</ul>
99
100<p>Well, bugs or missing features are always possible, and I will make a
101point of fixing them in a timely fashion. The best way to report a bug is to
102use the <a
103href="http://bugzilla.gnome.org/enter_bug.cgi?product=libxslt">GNOME bug
104tracking database</a> (make sure to use the "libxslt" module name). Before
105filing a bug, check the <a
106href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">list of existing
107libxslt bugs</a> to make sure it hasn't already been filed. I look at reports
108there regularly and it's good to have a reminder when a bug is still open. Be
109sure to specify that the bug is for the package libxslt.</p>
110
111<p>For small problems you can try to get help on IRC, the #xml channel on
112irc.gnome.org (port 6667) usually have a few person subscribed which may help
113(but there is no guarantee and if a real issue is raised it should go on the
114mailing-list for archival).</p>
115
116<p>There is also a mailing-list <a
117href="mailto:xslt@gnome.org">xslt@gnome.org</a> for libxslt, with an <a
118href="http://mail.gnome.org/archives/xslt/">on-line archive</a>. To subscribe
119to this list, please visit the <a
120href="http://mail.gnome.org/mailman/listinfo/xslt">associated Web</a> page
121and follow the instructions.</p>
122
123<p>Alternatively, you can just send the bug to the <a
124href="mailto:xslt@gnome.org">xslt@gnome.org</a> list, if it's really libxslt
125related I will approve it.. Please do not send me mail directly especially
126for portability problem, it makes things really harder to track and in some
127cases I'm not the best person to answer a given question, ask the list
128instead. <strong>Do not send code, I won't debug it</strong> (but patches are
129really appreciated!).</p>
130
131<p>Please note that with the current amount of virus and SPAM, sending mail
132to the list without being subscribed won't work. There is *far too many
133bounces* (in the order of a thousand a day !) I cannot approve them manually
134anymore. If your mail to the list bounced waiting for administrator approval,
135it is LOST ! Repost it and fix the problem triggering the error. Also please
136note that <span style="color: #FF0000; background-color: #FFFFFF">emails with
137a legal warning asking to not copy or redistribute freely the information
138they contain</span> are <strong>NOT</strong> acceptable for the mailing-list,
139such mail will as much as possible be discarded automatically, and are less
140likely to be answered if they made it to the list, <strong>DO NOT</strong>
141post to the list from an email address where such legal requirements are
142automatically added, get private paying support if you can't share
143information.</p>
144
145<p>Check the following too <span style="color: #E50000">before
146posting</span>:</p>
147<ul>
148  <li><a href="search.php">use the search engine</a> to get information
149    related to your problem.</li>
150  <li>make sure you are <a href="ftp://xmlsoft.org/libxslt/">using a recent
151    version</a>, and that the problem still shows up in those</li>
152  <li>check the <a href="http://mail.gnome.org/archives/xslt/">list
153    archives</a> to see if the problem was reported already, in this case
154    there is probably a fix available, similarly check the <a
155    href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">registered
156    open bugs</a></li>
157  <li>make sure you can reproduce the bug with xsltproc, a very useful thing
158    to do is run the transformation with -v argument and redirect the
159    standard error to a file, then search in this file for the transformation
160    logs just preceding the possible problem</li>
161  <li>Please send the command showing the error as well as the input and
162    stylesheet (as an attachment)</li>
163</ul>
164
165<p>Then send the bug with associated information to reproduce it to the <a
166href="mailto:xslt@gnome.org">xslt@gnome.org</a> list; if it's really libxslt
167related I will approve it. Please do not send mail to me directly, it makes
168things really hard to track and in some cases I am not the best person to
169answer a given question, ask on the list.</p>
170
171<p>To <span style="color: #E50000">be really clear about support</span>:</p>
172<ul>
173  <li>Support or help <span style="color: #E50000">request MUST be sent to
174    the list or on bugzilla</span> in case of problems, so that the Question
175    and Answers can be shared publicly. Failing to do so carries the implicit
176    message "I want free support but I don't want to share the benefits with
177    others" and is not welcome. I will automatically Carbon-Copy the
178    xslt@gnome.org mailing list for any technical reply made about libxml2 or
179    libxslt.</li>
180  <li>There is <span style="color: #E50000">no guarantee for support</span>,
181    if your question remains unanswered after a week, repost it, making sure
182    you gave all the detail needed and the information requested.</li>
183  <li>Failing to provide information as requested or double checking first
184    for prior feedback also carries the implicit message "the time of the
185    library maintainers is less valuable than my time" and might not be
186    welcome.</li>
187</ul>
188
189<p>Of course, bugs reports with a suggested patch for fixing them will
190probably be processed faster.</p>
191
192<p>If you're looking for help, a quick look at <a
193href="http://mail.gnome.org/archives/xslt/">the list archive</a> may actually
194provide the answer, I usually send source samples when answering libxslt
195usage questions. The <a
196href="html/libxslt-lib.html#LIBXSLT-LIB">auto-generated documentation</a> is
197not as polished as I would like (I need to learn more about Docbook), but
198it's a good starting point.</p>
199
200<h2><a name="help">How to help</a></h2>
201
202<p>You can help the project in various ways, the best thing to do first is to
203subscribe to the mailing-list as explained before, check the <a
204href="http://mail.gnome.org/archives/xslt/">archives </a>and the <a
205href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">GNOME bug
206database:</a>:</p>
207<ol>
208  <li>provide patches when you find problems</li>
209  <li>provide the diffs when you port libxslt to a new platform. They may not
210    be integrated in all cases but help pinpointing portability problems
211  and</li>
212  <li>provide documentation fixes (either as patches to the code comments or
213    as HTML diffs).</li>
214  <li>provide new documentations pieces (translations, examples, etc ...)</li>
215  <li>Check the TODO file and try to close one of the items</li>
216  <li>take one of the points raised in the archive or the bug database and
217    provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me
218    </a>before to avoid synchronization problems and check that the suggested
219    fix will fit in nicely :-)</li>
220</ol>
221
222<h2><a name="Downloads">Downloads</a></h2>
223
224<p>The latest versions of libxslt can be found on the <a
225href="ftp://xmlsoft.org/libxslt/">xmlsoft.org</a> server. (NOTE that
226you need the <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a>,
227<a href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>,
228<a href="http://rpmfind.net/linux/RPM/libxslt.html">libxslt</a> and <a
229href="http://rpmfind.net/linux/RPM/libxslt-devel.html">libxslt-devel</a>
230packages installed to compile applications using libxslt.) <a
231href="mailto:igor@zlatkovic.com">Igor Zlatkovic</a> is now the maintainer of
232the Windows port, <a
233href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
234binaries</a>. <a href="http://opencsw.org/">CSW</a> provides
235<a href="http://opencsw.org/packages/libxslt">Solaris binaries</a>, and
236<a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a> provides <a
237href="http://www.explain.com.au/oss/libxml2xslt.html">Mac Os X
238binaries</a>.</p>
239
240<p><a name="Snapshot">Snapshot:</a></p>
241<ul>
242  <li>Code from the GNOME GIT base libxslt module, updated hourly <a
243    href="ftp://xmlsoft.org/libxml2/libxslt-git-snapshot.tar.gz">libxslt-git-snapshot.tar.gz</a>.</li>
244</ul>
245
246<p><a name="Contribs">Contribs:</a></p>
247
248<p>I do accept external contributions, especially if compiling on another
249platform, get in touch with me to upload the package. I will keep them in the
250<a href="ftp://xmlsoft.org/libxml2/contribs/">contrib directory</a></p>
251
252<p>Libxslt is also available from GIT:</p>
253<ul>
254  <li><p>See <a href="http://git.gnome.org/browse/libxslt/">libxslt Git web</a>.
255         To checkout a local tree use:</p>
256       <pre>git clone git://git.gnome.org/libxslt</pre>
257  </li>
258  <li>The <strong>libxml2</strong> module is also present
259      <a href="http://git.gnome.org/browse/libxml2/">there</a></li>
260</ul>
261
262
263<h2><a name="FAQ">FAQ</a></h2>
264<ol>
265  <li><em>Troubles compiling or linking programs using libxslt</em>
266    <p>Usually the problem comes from the fact that the compiler doesn't get
267    the right compilation or linking flags. There is a small shell script
268    <code>xslt-config</code> which is installed as part of libxslt usual
269    install process which provides those flags. Use</p>
270    <p><code>xslt-config --cflags</code></p>
271    <p>to get the compilation flags and</p>
272    <p><code>xslt-config --libs</code></p>
273    <p>to get the linker flags. Usually this is done directly from the
274    Makefile as:</p>
275    <p><code>CFLAGS=`xslt-config --cflags`</code></p>
276    <p><code>LIBS=`xslt-config --libs`</code></p>
277    <p>Note also that if you use the EXSLT extensions from the program then
278    you should prepend <code>-lexslt</code> to the LIBS options</p>
279  </li>
280  <li><em>passing parameters on the xsltproc command line doesn't work</em>
281    <p><em>xsltproc --param test alpha foo.xsl foo.xml</em></p>
282    <p><em>the param does not get passed and ends up as ""</em></p>
283    <p>In a nutshell do a double escaping at the shell prompt:</p>
284    <p>xsltproc --param test "'alpha'" foo.xsl foo.xml</p>
285    <p>i.e. the string value is surrounded by " and ' then terminated by '
286    and ". Libxslt interpret the parameter values as XPath expressions, so
287    the string -&gt;<code>alpha</code>&lt;- is intepreted as the node set
288    matching this string. You really want -&gt;<code>'alpha'</code>&lt;- to
289    be passed to the processor. And to allow this you need to escape the
290    quotes at the shell level using -&gt;<code>"'alpha'"</code>&lt;- .</p>
291    <p>or use</p>
292    <p>xsltproc --stringparam test alpha foo.xsl foo.xml</p>
293  </li>
294  <li><em>Is there C++ bindings ?</em>
295    <p>Yes for example <a
296    href="http://pmade.org/pjones/software/xmlwrapp/">xmlwrapp</a> , see <a
297    href="python.html">the related pages about bindings</a></p>
298  </li>
299</ol>
300
301<h2><a name="News">News</a></h2>
302
303<p>See the <a href="http://git.gnome.org/browse/libxslt/">git page</a>
304to get a description of the recent commits.</p>
305
306<p>Those are the public releases made:</p>
307
308<h3>1.1.27: Sep 12 2012</h3>
309<ul>
310  <li> Portability:<br/>
311    xincludestyle wasn't protected with LIBXML_XINCLUDE_ENABLED (Michael Bonfils),<br/>
312    Portability fix for testThreads.c (IlyaS),<br/>
313    FreeBSD portability fixes (Pedro F. Giffuni),<br/>
314    check for gmtime - on mingw* hosts will enable date-time function (Roumen Petrov),<br/>
315    use only native crypto-API for mingw* hosts (Roumen Petrov),<br/>
316    autogen: Only check for libtoolize (Colin Walters),<br/>
317    minimal mingw support (Roumen Petrov),<br/>
318    configure: acconfig.h is deprecated since autoconf-2.50 (Stefan Kost),<br/>
319    Fix a small out of tree compilation issue (Hao Hu),<br/>
320    Fix python generator to not use deprecated xmllib (Daniel Veillard),<br/>
321    link python module with python library (Frederic Crozat)<br/>
322  </li>
323
324  <li> Documentation:<br/>
325    Tiny doc improvement (Daniel Veillard),<br/>
326    Various documentation fixes for docs on internals (C. M. Sperberg-McQueen)<br/>
327  </li>
328
329  <li> Bug fixes:<br/>
330    Report errors on variable use in key (Daniel Veillard),<br/>
331    The XSLT namespace string is a constant one (Daniel Veillard),<br/>
332    Fix handling of names in xsl:attribute (Nick Wellnhofer),<br/>
333    Reserved namespaces in xsl:element and xsl:attribute (Nick Wellnhofer),<br/>
334    Null-terminate result string of cry:rc4_decrypt (Nick Wellnhofer),<br/>
335    EXSLT date normalization fix (James Muscat),<br/>
336    Exit after compilation of invalid func:result (Nick Wellnhofer),<br/>
337    Fix for EXSLT func:function (Nick Wellnhofer),<br/>
338    Rewrite EXSLT string:replace to be conformant (Nick Wellnhofer),<br/>
339    Avoid a heap use after free error (Chris Evans),<br/>
340    Fix a dictionary string usage (Chris Evans),<br/>
341    Output should not include extraneous newlines when indent is off (Laurence Rowe),<br/>
342    document('') fails to return stylesheets parsed from memory (Jason Viers),<br/>
343    xsltproc should return an error code if xinclude fails (Malcolm Purvis),<br/>
344    Forwards-compatible processing of unknown top level elements (Nick Wellnhofer),<br/>
345    Fix system-property with unknown namespace (Nick Wellnhofer),<br/>
346    Hardening of code checking node types in EXSLT (Daniel Veillard),<br/>
347    Hardening of code checking node types in various entry point (Daniel Veillard),<br/>
348    Cleanup of the pattern compilation code (Daniel Veillard),<br/>
349    Fix default template processing on namespace nodes (Daniel Veillard),<br/>
350    Fix a bug in selecting XSLT elements (Daniel Veillard),<br/>
351    Fixed bug #616839 (Daniel Mustieles),<br/>
352    Fix some case of pattern parsing errors (Abhishek Arya),<br/>
353    preproc: fix the build (Stefan Kost),<br/>
354    Fix a memory leak with xsl:number (Daniel Veillard),<br/>
355    Fix a problem with ESXLT date:add() with January (money_seshu Dronamraju),<br/>
356    Fix a memory leak if compiled with Windows locale support (Daniel Veillard),<br/>
357    Fix generate-id() to not expose object addresses (Daniel Veillard),<br/>
358    Fix curlies support in literals for non-compiled AVTs (Nick Wellnhofer),<br/>
359    Allow whitespace in xsl:variable with select (Nick Wellnhofer),<br/>
360    Small fixes to locale code (Nick Wellnhofer),<br/>
361    Fix bug 602515 (Nick Wellnhofer),<br/>
362    Fix popping of vars in xsltCompilerNodePop (Nick Wellnhofer),<br/>
363    Fix direct pattern matching bug (Nick Wellnhofer)<br/>
364  </li>
365
366  <li> Improvements:<br/>
367    Add the saxon:systemId extension (Mike Hommey),<br/>
368    Add an append mode to document output (Daniel Veillard),<br/>
369    Add new tests to EXTRA_DIST (Nick Wellnhofer),<br/>
370    Test for bug #680920 (Nick Wellnhofer),<br/>
371    fix regresson in Various "make distcheck" and other fixes (Roumen Petrov),<br/>
372    Various "make distcheck" and other fixes (Daniel Richard G),<br/>
373    Fix portability to upcoming libxml2-2.9.0 (Daniel Veillard),<br/>
374    Adding --system flag support to autogen.sh (Daniel Veillard),<br/>
375    Allow per-context override of xsltMaxDepth, introduce xsltMaxVars (J�r�me Carretero),<br/>
376    autogen.sh: Honor NOCONFIGURE environment variable (Colin Walters),<br/>
377    configure: support silent automake rules if possible (Stefan Kost),<br/>
378    Precompile patterns in xsl:number (Nick Wellnhofer),<br/>
379    Fix some warnings in the refactored code (Nick Wellnhofer),<br/>
380    Adding new generated files (Daniel Veillard),<br/>
381    profiling: add callgraph report (Stefan Kost)<br/>
382  </li>
383
384  <li> Cleanups:<br/>
385    Big space and tabs cleanup (Daniel Veillard),<br/>
386    Fix authors list (Daniel Veillard),<br/>
387    Cleanups some of the test makefiles (Daniel Richard),<br/>
388    Remove .cvsignore files which are not needed anymore (Daniel Veillard),<br/>
389    Cleanup some misplaced spaces and tabs (Daniel Veillard),<br/>
390    Augment list of ignored files (Daniel Veillard),<br/>
391    configure: remove checks for isinf and isnan as those are not used anyway (Stefan Kost),<br/>
392    Point to GIT for source code and a bit of cleanup (Daniel Veillard),<br/>
393    Get rid of specific build setup and STATIC_BINARIES (Daniel Veillard)<br/>
394  </li>
395</ul>
396<h3>1.1.26: Sep 24 2009</h3>
397<ul>
398  <li> Improvement:
399    Add xsltProcessOneNode to exported symbols for lxml (Daniel Veillard)
400  </li>
401  <li> Bug fixes:
402    Fix an idness generation problem (Daniel Veillard),
403    595612 Try to fix some locking problems (Daniel Veillard),
404    Fix a crash on misformed imported stylesheets (Daniel Veillard)
405  </li>
406</ul>
407<h3>1.1.25: Sep 17 2009</h3>
408<ul>
409  <li> Features:
410      Add API versioning and various cleanups (Daniel Veillard),
411      xsl:sort lang support using the locale (Nick Wellnhofer and Roumen Petrov)
412  </li>
413  <li> Documentation:
414      Fix the download links for Solaris (Daniel Veillard),
415      Fix makefile and spec file to include doc in rpm (Daniel Veillard)
416  </li>
417  <li> Portability:
418      Make sure testThreads is linked with pthreads (Daniel Veillard),
419      Fix potential crash on debug of extensions Solaris (Ben Walton),
420      applied patch from Roumen Petrov for mingw cross compilation problems (Roumen Petrov),
421      patch from Richard Jones to build shared libs with MinGW cross-compiler (Richard Jones),
422      fix include path when compiling with MinGW (Roumen Petrov),
423      portability fixes ( Nick Wellnhofer and Roumen Petrov)
424  </li>
425  <li> Bug fixes:
426      Big fixes of pattern compilations (Nick Wellnhofer),
427      Fix uses of xmlAddChild for error handling (Daniel Veillard),
428      Detect deep recusion on function calls (Daniel Veillard),
429      Avoid an error in namespace generation (Martin),
430      Fix importing of encoding from included stylesheets (Nick Wellnhofer),
431      Fix problems with embedded stylesheets and namespaces (Martin),
432      QName parsing fix for patterns (Martin),
433      Crash compiling stylesheet with DTD (Martin),
434      Fix xsl:strip-space with namespace and wildcard (Nick Wellnhofer),
435      Fix a mutex deadlock on unregistered extensions (Nix),
436      567192 xsltproc --output option ignore --xinclude (Joachim Breitner),
437      Fix redundant headers in list (Daniel Veillard),
438      134754 Configure's --with-html-dir related fixes (Julio M. Merino Vidal),
439      305913 a serious problem in extensions reentrancy (Daniel Veillard),
440      Fix an idness issue when building the tree (Daniel Veillard),
441      Fixed indexing error reported by Ron Burk on the mailing list. (William M. Brack),
442      prevent some unchecked pointer accesses (Jake Goulding),
443      fix for CVE-2008-2935 libexslt RC4 encryption/decryption functions Daniel (Daniel Veillard),
444      avoid a quadratic behaviour when hitting duplicates (Daniel Veillard),
445      544829 fixed option --with-debugger (Arun Ragnavan),
446      541965 fixed incorrect argument popping in exsltMathAtan2Function (William M. Brack),
447      fix problem with string check for element-available (Ron Burk),
448      539741 added code to handle literal within an AVT (William M. Brack)
449  </li>
450  <li> Improvements:
451      Allow use of EXSLT outside XSLT (Martin),
452      Support Esperanto locale (Nick Wellnhofer),
453      Change how attributes are copied for id and speed (Daniel Veillard),
454      Add API versioning and various cleanups (Daniel Veillard),
455      Adding a test program to check thread reentrancy (Daniel Veillard),
456      big patch from  finishing xsl:sort lang support (Roumen Petrov),
457      add xsl:sort lang support using the locale (Nick Wellnhofer)
458  </li>
459  <li> Cleanups:
460      Label xsltProcessOneNode as static (Daniel Veillard),
461      git setup (Daniel Veillard),
462      fixed typo detected by new libxml2 code (William M. Brack),
463      xsltExtFunctionLookup was defined but never implemented (Ralf Junker)
464  </li>
465</ul>
466<h3>1.1.24: May 13 2008</h3>
467<ul>
468  <li>Documentation: man page fix (Vincent Lefevre).</li>
469  <li>Bug fixes: pattern bug fix, key initialization problems, exclusion of
470      unknown namespaced element on top of stylesheets, python generator
471      syntactic cleanup (Martin)</li>
472</ul>
473<h3>1.1.23: Apr  8 2008</h3>
474<ul>
475  <li>Documentation: fix links for Cygwin DocBook setup (Philippe Bourcier),
476      xsltParseStylesheetDoc doc fix (Jason Viers), fix manpage default
477      maxdepth value </li>
478  <li>Bug fixes: python segfault (Daniel Gryniewicz), week-in-year bug fix
479      (Maurice van der Pot), fix python iterator problem (William Brack),
480      avoid garbage collection problems on str:tokenize and str:split
481      and function results (William Brack and Peter Pawlowski) 
482      superfluous re-generation of keys (William Brack), remove superfluous
483      code in xsltExtInitTest (Tony Graham), func:result segfault fix
484      (William Brack), timezone offset problem (Peter Pawlowski),</li>
485  <li>Portability fixes: old gcrypt support fix (Brent Cowgill), Python
486      portability patch (Stephane Bidoul), VS 2008 fix (Rob Richard) </li>
487</ul>
488<h3>1.1.22: Aug 23 2007</h3>
489<ul>
490  <li>Bug fixes: RVT cleanup problems (William Brack), exclude-result-prefix
491      bug (William Brack), stylesheet compilation error handling (Rob Richards).
492      </li>
493  <li>Portability fixes: improve build with VS2005 (Rob Richards), 
494      fixing build on AIX (Bjorn Wiberg), fix the security file checks on
495      Windows (Roland Schwarz and Rob Richards). </li>
496  <li>Improvement: add an --encoding option to xsltproc (Drazen Kacar). </li>
497</ul>
498<h3>1.1.21: Jun 12 2007</h3>
499<ul>
500  <li>Bug fixes: out of memory allocation errors (William Brack), 
501      namespace problem on compound predicates (William Brack),
502      python space/tab inconsistencies (Andreas Hanke), hook xsl:message
503      to per transformation error callbacks (Shaun McCance),
504      cached RVT problem (William Brack), XPath context maintainance
505      on choose (William Brack), memory leaks in the math module (William
506      Brack), exclude-result-prefix induced namespace problem (William
507      Brack)</li>
508  <li>Build: configure setup for TRIO_REPLACE_STDIO (William Brack)
509  <li>Documentation: updated after change from CVs to SVN (William Brack)</li>
510</ul>
511<h3>1.1.20: Jan 17 2007</h3>
512<ul>
513  <li>Portability fixes: strict aliasing fix (Marcus Meissner), BSD portability
514      patches (Roland Illig)</li>
515  <li>Bug fixes: Result Value Tree handling fix (William Brack), function
516      parameters fix (William), uninitialized variable (Kjartan Maraas),
517      empty text node handling (William), plugin support and test fixes (William),
518      fragment support fixes (William)</li>
519  <li>Improvements: python stylesheet compare and transform context
520      access (Nic Ferrier), EXSLT string replace support (Joel Reed),
521      xsltproc better low level error handling (Mike Hommey and William)</li>
522</ul>
523<h3>1.1.19: Nov 29 2006</h3>
524<ul>
525  <li>Bug fixes: entities within attributes (William Brack), Python detection
526      problem (Joseph Sacco), in-scope namespace bug (Mike Hommey), Result
527      value tree caching bug (William Brack)</li>
528</ul>
529<h3>1.1.18: Oct 26 2006</h3>
530<ul>
531  <li>portability and build fixes: DESTDIR problem, build paths in python
532      shared lib, compile when libxml2 doesn't support XInclude (Gary Coady).</li>
533  <li>bug fixes: a number of namespace related bugs (Kasimier Buchcik), 
534      parameters bugs (Kasimier Buchcik), proximity position in predicates
535      of match patterns (Kasimier), exslt-node-set troubles with strings
536      (Kasimier), CDATA serialization, Python floats and booleans XPath
537      conversions, XInclude support fixes, RVT cleanup problem (William Brack
538      and Kasimier), attribute checking in stylesheets (Kasimier), xsltForEach
539      context problem (Kasimier), security check should pass full URLs (Shane
540      Corgatelli), security cleanup patch (Mikhail Zabaluev), some python
541      accessor for stylesheet were broken, memory errors when compiling 
542      stylesheets (Mike Hommey), EXSLT current date end-of-month problem
543      (William Brack).</li>
544  <li>improvements: refactoring of namespace handling, value-of impleemntation
545      and template internal processing (Kasimier Buchcik), new xsltproc
546      flag to apply Xinclude to stylesheets.</li>
547  <li>documentation: xsltproc man pages (Daniel Leidert), tests updates
548      (William Brack), various typo fixes (Daniel Leidert), comments on
549      versions macros (Peter Breitenlohner).</li>
550</ul>
551<h3>1.1.17: Jun 6 2006</h3>
552<ul>
553  <li>portability fixes: python detection</li>
554  <li>bug fixes: some regression tests, attribute/namespaces output (Kasimier
555    Buchcik), problem in mixed xsl:value-of and xsl:text uses (Kasimier)</li>
556  <li>improvements: internal refactoring (Kasimier Buchcik), use of the XPath
557    object cache in libxml2-2.6.25 (Kasimier)</li>
558</ul>
559
560<h3>1.1.16: May 01 2006</h3>
561<ul>
562  <li>portability fixes: EXSLT date/time on Solaris and IRIX (Albert Chin),
563      HP-UX  build (Albert Chin), 
564  <li>build fixes: Python detection(Joseph Sacco), plugin configurei
565      (Joel Reed)</li>
566  <li>bug fixes: pattern compilation fix(William Brack), EXSLT date/time
567      fix (Thomas Broyer), EXSLT function bug, potential loop on variable
568      eval, startup race (Christopher Palmer), debug statement left in python
569      (Nic Ferrier), various cleanup based on Coverity reports), error on
570      Out of memory condition (Charles Hardin), various namespace prefixes
571      fixes (Kasimier Buchcik), </li>
572  <li>improvement: speed up sortingi, start of internals refactoring (Kasimier
573      Buchcik)</li>
574  <li>documentation: man page fixes and updates (Daniel Leidert)
575</ul>
576
577<h3>1.1.15: Sep 04 2005</h3>
578<ul>
579  <li>build fixes: Windows build cleanups and updates (Igor Zlatkovic),
580    remove jhbuild warnings</li>
581  <li>bug fixes: negative number formatting (William Brack), number
582    formatting per mille definition (William Brack), XInclude default values
583    (William), text copy bugs (William), bug related to xmlXPathContext size,
584    reuse libxml2 memory management for text nodes, dictionary text bug,
585    forbid variables in match (needs libxml2-2.6.21)</li>
586  <li>improvements: EXSLT dyn:map (Mark Vakoc),</li>
587  <li>documentation: EXSLT date and time functions namespace in man (Jonathan
588    Wakely)</li>
589</ul>
590
591<h3>1.1.14: Apr 02 2005</h3>
592<ul>
593  <li>bug fixes: text node on stylesheet document without a dictionary
594    (William Brack), more checking of XSLT syntax, calling xsltInit()
595    multiple times, mode values interning raised by Mark Vakoc, bug in
596    pattern matching with ancestors, bug in patterna matching with cascading
597    select, xinclude and document() problem, build outside of source tree
598    (Mike Castle)</li>
599  <li>improvement: added a --nodict mode to xsltproc to check problems for
600    docuemtns without dictionaries</li>
601</ul>
602
603<h3>1.1.13: Mar 13 2005</h3>
604<ul>
605  <li>build fixes: 64bits cleanup (William Brack), python 2.4 test (William),
606    LIBXSLT_VERSION_EXTRA on Windows (William), Windows makefiles fixes (Joel
607    Reed), libgcrypt-devel requires for RPM spec.</li>
608  <li>bug fixes: exslt day-of-week-in-month (Sal Paradise), xsl:call-template
609    should not change the current template rule (William Brack), evaluation
610    of global variables (William Brack), RVT's in XPath predicates (William),
611    namespace URI on template names (Mark Vakoc), stat() for Windows patch
612    (Aleksey Gurtovoy), pattern expression fixes (William Brack), out of
613    memory detection misses (William), parserOptions propagation (William),
614    exclude-result-prefixes fix (William), // patten fix (William).</li>
615  <li>extensions: module support (Joel Reed), dictionary based speedups
616    trying to get rid of xmlStrEqual as much as possible.</li>
617  <li>documentation: added Wiki (Joel Reed)</li>
618</ul>
619
620<h3>1.1.12: Oct 29 2004</h3>
621<ul>
622  <li>build fixes: warnings removal (William).</li>
623  <li>bug fixes: attribute document pointer fix (Mark Vakoc), exslt date
624    negative periods (William Brack), generated tree structure fixes,
625    namespace lookup fix, use reentrant gmtime_r (William Brack),
626    exslt:funtion namespace fix (William), potential NULL pointer reference
627    (Dennis Dams, William), force string interning on generated
628  documents.</li>
629  <li>documentation: update of the second tutorial (Panagiotis Louridas), add
630    exslt doc in rpm packages, fix the xsltproc man page.</li>
631</ul>
632
633<h3>1.1.11: Sep 29 2004</h3>
634<ul>
635  <li>bug fixes: xsl:include problems (William Brack), UTF8 number pattern
636    (William), date-time validation (William), namespace fix (William),
637    various Exslt date fixes (William), error callback fixes, leak with
638    namespaced global variable, attempt to fix a weird problem #153137</li>
639  <li>improvements: exslt:date-sum tests (Derek Poon)</li>
640  <li>documentation: second tutorial by Panagiotis Lourida</li>
641</ul>
642
643<h3>1.1.10: Aug 31 2004</h3>
644<ul>
645  <li>build fix: NUL in c file blocking compilation on Solaris, Windows build
646    (Igor Zlatkovic)</li>
647  <li>fix: key initialization problem (William Brack)</li>
648  <li>documentation: fixed missing man page description for --path</li>
649</ul>
650
651<h3>1.1.9: Aug 22 2004</h3>
652<ul>
653  <li>build fixes: missing tests (William Brack), Python dependancies, Python
654    on 64bits boxes, --with-crypto flag (Rob Richards),</li>
655  <li>fixes: RVT key handling (William), Python binding (William and Sitsofe
656    Wheeler), key and XPath troubles (William), template priority on imports
657    (William), str:tokenize with empty strings (William), #default namespace
658    alias behaviour (William), doc ordering missing for main document
659    (William), 64bit bug (Andreas Schwab)</li>
660  <li>improvements: EXSLT date:sum added (Joel Reed), hook for document
661    loading for David Hyatt, xsltproc --nodtdattr to avoid defaulting DTD
662    attributes, extend xsltproc --version with CVS stamp (William).</li>
663  <li>Documentation: web page problem reported by Oliver Stoeneberg</li>
664</ul>
665
666<h3>1.1.8: July 5 2004</h3>
667<ul>
668  <li>build fixes: Windows runtime options (Oliver Stoeneberg), Windows
669    binary package layout (Igor Zlatkovic), libgcrypt version test and link
670    (William)</li>
671  <li>documentation: fix libxslt namespace name in doc (William)</li>
672  <li>bug fixes: undefined namespace message (William Brack), search engine
673    (William), multiple namespace fixups (William), namespace fix for key
674    evaluation (William), Python memory debug bindings,</li>
675  <li>improvements: crypto extensions for exslt (Joel Reed, William)</li>
676</ul>
677
678<h3>1.1.7: May 17 2004</h3>
679<ul>
680  <li>build fix: warning about localtime_r on Solaris</li>
681  <li>bug fix: UTF8 string tokenize (William Brack), subtle memory
682    corruption, linefeed after comment at document level (William),
683    disable-output-escaping problem (William), pattern compilation in deep
684    imported stylesheets (William), namespace extension prefix bug,
685    libxslt.m4 bug (Edward Rudd), namespace lookup for attribute, namespaced
686    DOCTYPE name</li>
687</ul>
688
689<h3>1.1.6: Apr 18 2004</h3>
690<ul>
691  <li>2 bug fixes about keys fixed one by Mark Vakoc</li>
692</ul>
693
694<h3>1.1.5: Mar 23 2004</h3>
695<ul>
696  <li>performance: use dictionary lookup for variables</li>
697  <li>remove use of _private from source documents</li>
698  <li>cleanup of "make tests" output</li>
699  <li>bugfixes: AVT in local variables, use localtime_r to avoid thread
700    troubles (William), dictionary handling bug (William), limited number of
701    stubstitutions in AVT (William), tokenize fix for UTF-8 (William),
702    superfluous namespace (William), xsltproc error code on
703    &lt;xsl:message&gt; halt, OpenVMS fix, dictionary reference counting
704    change.</li>
705</ul>
706
707<h3>1.1.4: Feb 23 2004</h3>
708<ul>
709  <li>bugfixes: attributes without doc (Mariano Su�rez-Alvarez), problem with
710    Yelp, extension problem</li>
711  <li>display extension modules (Steve Little)</li>
712  <li>Windows compilation patch (Mark Vadoc), Mingw (Mikhail Grushinskiy)</li>
713</ul>
714
715<h3>1.1.3: Feb 16 2004</h3>
716<ul>
717  <li>Rewrote the Attribute Value Template code, new XPath compilation
718    interfaces, dictionary reuses for XSLT with potential for serious
719    performance improvements.</li>
720  <li>bug fixes: portability (William Brack), key() in node-set() results
721    (William), comment before doctype (William), math and node-set() problems
722    (William), cdata element and default namespace (William), behaviour on
723    unknown XSLT elements (Stefan Kost), priority of "//foo" patterns
724    (William), xsl:element and xsl:attribute QName check (William), comments
725    with -- (William), attribute namespace (William), check for ?&gt; in PI
726    (William)</li>
727  <li>Documentations: cleanup (John Fleck and William)</li>
728  <li>Python: patch for OS-X (Gianni Ceccarelli), enums export (Stephane
729    bidoul)</li>
730</ul>
731
732<h3>1.1.2: Dec 24 2003</h3>
733<ul>
734  <li>Documentation fixes (John Fleck, William Brack), EXSLT documentation
735    (William Brack)</li>
736  <li>Windows compilation fixes for MSVC and Mingw (Igor Zlatkovic)</li>
737  <li>Bug fixes: exslt:date returning NULL strings (William Brack),
738    namespaces output (William Brack),  key and namespace definition problem,
739    passing options down to the document() parser, xsl:number fixes (William
740    Brack)</li>
741</ul>
742
743<h3>1.1.1: Dec 10 2003</h3>
744<ul>
745  <li>code cleanup (William Brack)</li>
746  <li>Windows: Makefile improvements (Igor Zlatkovic)</li>
747  <li>documentation improvements: William Brack, libexslt man page (Jonathan
748    Wakely)</li>
749  <li>param in EXSLT functions (Shaun McCance)</li>
750  <li>XSLT debugging improvements (Mark Vakoc)</li>
751  <li>bug fixes: number formatting (Bjorn Reese), exslt:tokenize (William
752    Brack), key selector parsing with | reported by Oleg Paraschenko,
753    xsl:element with computed namespaces (William Brack), xslt:import/include
754    recursion detection (William Brack), exslt:function used in keys (William
755    Brack), bug when CDATA_SECTION are foun in the tree (William Brack),
756    entities handling when using XInclude.</li>
757</ul>
758
759<h3>1.1.0: Nov 4 2003</h3>
760<ul>
761  <li>Removed DocBook SGML broken support</li>
762  <li>fix xsl:key to work with PIs</li>
763  <li>Makefile and build improvement (Graham Wilson), build cleanup (William
764    Brack), macro fix (Justin Fletcher), build outside of source tree (Roumen
765    Petrov)</li>
766  <li>xsltproc option display fix (Alexey Efimov), --load-trace (Crutcher
767    Dunnavant)</li>
768  <li>Python: never use stdout for error</li>
769  <li>extension memory error fix (Karl Eichwalder)</li>
770  <li>header path fixes (Steve Ball)</li>
771  <li>added saxon:line-number() to libexslt (Brett Kail)</li>
772  <li>Fix some tortuous template problems when using predicates (William
773    Brack)</li>
774  <li>Debugger status patch (Kasimier Buchcik)</li>
775  <li>Use new libxml2-2.6.x APIs for faster processing</li>
776  <li>Make sure xsl:sort is empty</li>
777  <li>Fixed a bug in default processing of attributes</li>
778  <li>Removes the deprecated breakpoint library</li>
779  <li>detect invalid names on templates (William Brack)</li>
780  <li>fix exslt:document (and similar) base handling problem</li>
781</ul>
782
783<h3>1.0.33: Sep 12 2003</h3>
784
785<p>This is a bugfix only release</p>
786<ul>
787  <li>error message missing argument (William Brack)</li>
788  <li>mode not cascaded in template fallbacks (William Brack)</li>
789  <li>catch redefinition of parameter/variables  (William Brack)</li>
790  <li>multiple keys with same namespace name (William Brack)</li>
791  <li>patch for compilation using MingW on Windows (Mikhail Grushinskiy)</li>
792  <li>header export macros for Windows (Igor Zlatkovic)</li>
793  <li>cdata-section-elements handling of namespaced names</li>
794  <li>compilation without libxml2 XPointer support (Mark Vadoc)</li>
795  <li>apply-templates crash (William Brack)</li>
796  <li>bug with imported templates (William Brack)</li>
797  <li>imported attribute-sets merging bug (DocBook) (William Brack)</li>
798</ul>
799
800<h3>1.0.32: Aug 9 2003</h3>
801<ul>
802  <li>bugfixes: xsltSaveResultToFile() python binding (Chris Jaeger), EXSLT
803    function (William Brack), RVT for globals (William Brack), EXSLT date
804    (William Brack),
805    <p>speed of large text output, xsl:copy with attributes, strip-space and
806    namespaces prefix, fix for --path xsltproc option, EXST:tokenize (Shaun
807    McCance), EXSLT:seconds (William Brack), sort with multiple keys (William
808    Brack), checking of { and } for attribute value templates (William
809    Brack)</p>
810  </li>
811  <li>Python bindings for extension elements (Sean Treadway)</li>
812  <li>EXSLT:split added (Shaun McCance)</li>
813  <li>portability fixes for HP-UX/Solaris/IRIX (William Brack)</li>
814  <li>doc cleanup</li>
815</ul>
816
817<h3>1.0.31: Jul 6 2003</h3>
818<ul>
819  <li>bugfixes: xsl:copy on namespace nodes, AVT for xsl:sort order, fix for
820    the debugger (Keith Isdale), output filename limitation, trio.h and
821    triodef.h added (Albert Chin), EXSLT node-set (Peter Breitenlohner),
822    xsltChoose and whitespace (Igor Zlatkovic),
823    <p>stylesheet compilation (Igor Zlatkovic), NaN and sort (William Brack),
824    RVT bug introduced in 1.0.30</p>
825  </li>
826  <li>avoid generating &amp;quot; (fix in libxml2-2.5.8)</li>
827  <li>fix 64bit cleaness problem and compilation troubles introduced in
828  1.0.30</li>
829  <li>Windows makefile generation (Igor Zlatkovic)</li>
830  <li>HP-UX portability fix</li>
831</ul>
832
833<h3>1.0.30: May 4 2003</h3>
834<ul>
835  <li>Fixes and new APIs to handle Result Value Trees and avoid leaks</li>
836  <li>Fixes for: EXSLT math pow() function (Charles Bozeman), global
837    parameter and global variables mismatch, a segfault on pattern
838    compilation errors, namespace copy in xsl:copy-of, python generator
839    problem, OpenVMS trio update, premature call to xsltFreeStackElem (Igor),
840    current node when templates applies to attributes</li>
841</ul>
842
843<h3>1.0.29: Apr 1 2003</h3>
844<ul>
845  <li>performance improvements especially for large flat documents</li>
846  <li>bug fixes: Result Value Tree handling, XML IDs, keys(), extra namespace
847    declarations with xsl:elements.</li>
848  <li>portability: python and trio fixes (Albert Chin), python on Solaris
849    (Ben Phillips)</li>
850</ul>
851
852<h3>1.0.28: Mar 24 2003</h3>
853<ul>
854  <li>fixed node() in patterns semantic.</li>
855  <li>fixed a memory access problem in format-number()</li>
856  <li>fixed stack overflow in recursive global variable or params</li>
857  <li>cleaned up Result Value Tree handling, and fixed a couple of old bugs
858    in the process</li>
859</ul>
860
861<h3>1.0.27: Feb 24 2003</h3>
862<ul>
863  <li>bug fixes: spurious xmlns:nsX="" generation, serialization bug (in
864    libxml2), a namespace copy problem, errors in the RPM spec prereqs</li>
865  <li>Windows path canonicalization and document cache fix (Igor)</li>
866</ul>
867
868<h3>1.0.26: Feb 10 2003</h3>
869<ul>
870  <li>Fixed 3 serious bugs in document() and stylesheet compilation which
871    could lead to a crash</li>
872</ul>
873
874<h3>1.0.25: Feb 5 2003</h3>
875<ul>
876  <li>Bug fix: double-free for standalone stylesheets introduced in 1.0.24, C
877    syntax pbm, 3 bugs reported by Eric van der Vlist</li>
878  <li>Some XPath and XInclude related problems were actually fixed in
879    libxml2-2.5.2</li>
880  <li>Documentation: emphasize taht --docbook is not for XML docs.</li>
881</ul>
882
883<h3>1.0.24: Jan 14 2003</h3>
884<ul>
885  <li>bug fixes: imported global varables, python bindings (St�phane Bidoul),
886    EXSLT memory leak (Charles Bozeman), namespace generation on
887    xsl:attribute, space handling with imports (Daniel Stodden),
888    extension-element-prefixes (Josh Parsons), comments within xsl:text (Matt
889    Sergeant), superfluous xmlns generation, XInclude related bug for
890    numbering, EXSLT strings (Alexey Efimov), attribute-sets computation on
891    imports, extension module init and shutdown callbacks not called</li>
892  <li>HP-UX portability (Alexey Efimov), Windows makefiles (Igor and Stephane
893    Bidoul), VMS makefile updates (Craig A. Berry)</li>
894  <li>adds xsltGetProfileInformation() (Michael Rothwell)</li>
895  <li>fix the API generation scripts</li>
896  <li>API to provide the sorting routines (Richard Jinks)</li>
897  <li>added XML description of the EXSLT API</li>
898  <li>added ESXLT URI (un)escaping (J�rg Walter)</li>
899  <li>Some memory leaks have been found and fixed</li>
900  <li>document() now support fragment identifiers in URIs</li>
901</ul>
902
903<h3>1.0.23: Nov 17 2002</h3>
904<ul>
905  <li>Windows build cleanup (Igor)</li>
906  <li>Unix build and RPM packaging cleanup</li>
907  <li>Improvement of the python bindings: extension functions and activating
908    EXSLT</li>
909  <li>various bug fixes: number formatting, portability for bounded string
910    functions, CData nodes, key(), @*[...] patterns</li>
911  <li>Documentation improvements (John Fleck)</li>
912  <li>added libxslt.m4 (Thomas Schraitle)</li>
913</ul>
914
915<h3>1.0.22: Oct 18 2002</h3>
916<ul>
917  <li>Updates on the Windows Makefiles</li>
918  <li>Added a security module, and a related set of new options to
919  xsltproc</li>
920  <li>Allowed per transformation error handler.</li>
921  <li>Fixed a few bugs: node() semantic, URI escaping, media-type, attribute
922    lists</li>
923</ul>
924
925<h3>1.0.21: Sep 26 2002</h3>
926<ul>
927  <li>Bug fixes: match="node()", date:difference() (Igor and Charlie
928    Bozeman), disable-output-escaping</li>
929  <li>Python bindings: style.saveResultToString() from Ralf Mattes</li>
930  <li>Logos from Marc Liyanage</li>
931  <li>Mem leak fix from Nathan Myers</li>
932  <li>Makefile: DESTDIR fix from Christophe Merlet, AMD x86_64 (Mandrake),
933    Windows (Igor), Python detection</li>
934  <li>Documentation improvements: John Fleck</li>
935</ul>
936
937<h3>1.0.20: Aug 23 2002</h3>
938<ul>
939  <li>Windows makefile updates (Igor) and x86-64 (Frederic Crozat)</li>
940  <li>fixed HTML meta tag saving for Mac/IE users</li>
941  <li>possible leak patches from Nathan Myers</li>
942  <li>try to handle document('') as best as possible depending in the
943  cases</li>
944  <li>Fixed the DocBook stylesheets handling problem</li>
945  <li>Fixed a few XSLT reported errors</li>
946</ul>
947
948<h3>1.0.19:  July 6 2002</h3>
949<ul>
950  <li>EXSLT: dynamic functions and date support bug fixes (Mark Vakoc)</li>
951  <li>xsl:number fix: Richard Jinks</li>
952  <li>xsl:format-numbers fix: Ken Neighbors</li>
953  <li>document('') fix: bug pointed by Eric van der Vlist</li>
954  <li>xsl:message with terminate="yes" fixes: William Brack</li>
955  <li>xsl:sort order support added: Ken Neighbors</li>
956  <li>a few other bug fixes, some of them requiring the latest version of
957    libxml2</li>
958</ul>
959
960<h3>1.0.18: May 27 2002</h3>
961<ul>
962  <li>a number of bug fixes: attributes, extra namespace declarations
963    (DocBook), xsl:include crash (Igor), documentation (Christian Cornelssen,
964    Charles Bozeman and Geert Kloosterman),  element-available (Richard
965  Jinks)</li>
966  <li>xsltproc can now list teh registered extensions thanks to Mark
967  Vakoc</li>
968  <li>there is a new API to save directly to a string
969    xsltSaveResultToString() by Morus Walter</li>
970  <li>specific error registration function for the python API</li>
971</ul>
972
973<h3>1.0.17: April 29 2002</h3>
974<ul>
975  <li>cleanup in code, XSLT debugger support and Makefiles for Windows by
976  Igor</li>
977  <li>a C++ portability fix by Mark Vakoc</li>
978  <li>EXSLT date improvement and regression tests by Charles Bozeman</li>
979  <li>attempt to fix a bug in xsltProcessUserParamInternal</li>
980</ul>
981
982<h3>1.0.16: April 15 2002</h3>
983<ul>
984  <li>Bug fixes: strip-space, URL in HTML output, error when xsltproc can't
985    save</li>
986  <li>portability fixes: OSF/1, IEEE on alphas, Windows, Python bindings</li>
987</ul>
988
989<h3>1.0.15: Mar 25 2002</h3>
990<ul>
991  <li>Bugfixes: XPath, python Makefile, recursive attribute sets, @foo[..]
992    templates</li>
993  <li>Debug of memory alocation with valgind</li>
994  <li>serious profiling leading to significant improvement for DocBook
995    processing</li>
996  <li>revamp of the Windows build</li>
997</ul>
998
999<h3>1.0.14: Mar 18 2002</h3>
1000<ul>
1001  <li>Improvement in the XPath engine (libxml2-2.4.18)</li>
1002  <li>Nasty bug fix related to exslt:node-set</li>
1003  <li>Fixed the python Makefiles, cleanup of doc comments, Windows
1004    portability fixes</li>
1005</ul>
1006
1007<h3>1.0.13: Mar 8 2002</h3>
1008<ul>
1009  <li>a number of bug fixes including "namespace node have no parents"</li>
1010  <li>Improvement of the Python bindings</li>
1011  <li>Charles Bozeman provided fixes and regression tests for exslt date
1012    functions.</li>
1013</ul>
1014
1015<h3>1.0.12: Feb 11 2002</h3>
1016<ul>
1017  <li>Fixed the makefiles especially the python module ones</li>
1018  <li>half a dozen bugs fixes including 2 old ones</li>
1019</ul>
1020
1021<h3>1.0.11: Feb 8 2002</h3>
1022<ul>
1023  <li>Change of Licence to the <a
1024    href="http://www.opensource.org/licenses/mit-license.html">MIT
1025  Licence</a></li>
1026  <li>Added a beta version of the Python bindings, including support to
1027    extend the engine with functions written in Python</li>
1028  <li>A number of bug fixes</li>
1029  <li>Charlie Bozeman provided more EXSLT functions</li>
1030  <li>Portability fixes</li>
1031</ul>
1032
1033<h3>1.0.10: Jan 14 2002</h3>
1034<ul>
1035  <li>Windows fixes for Win32 from Igor</li>
1036  <li>Fixed the Solaris compilation trouble (Albert)</li>
1037  <li>Documentation changes and updates: John Fleck</li>
1038  <li>Added a stringparam option to avoid escaping hell at the shell
1039  level</li>
1040  <li>A few bug fixes</li>
1041</ul>
1042
1043<h3>1.0.9: Dec 7 2001</h3>
1044<ul>
1045  <li>Makefile patches from Peter Williams</li>
1046  <li>attempt to fix the compilation problem associated to prelinking</li>
1047  <li>obsoleted libxsltbreakpoint now deprecated and frozen to 1.0.8 API</li>
1048  <li>xsltproc return codes are now significant, John Fleck updated the
1049    documentation</li>
1050  <li>patch to allow as much as 40 steps in patterns (Marc Tardif), should be
1051    made dynamic really</li>
1052  <li>fixed a bug raised by Nik Clayton when using doctypes with HTML
1053  output</li>
1054  <li>patches from Keith Isdale to interface with xsltdebugger</li>
1055</ul>
1056
1057<h3>1.0.8: Nov 26 2001</h3>
1058<ul>
1059  <li>fixed an annoying header problem, removed a few bugs and some code
1060    cleanup</li>
1061  <li>patches for Windows and update of Windows Makefiles by Igor</li>
1062  <li>OpenVMS port instructions from John A Fotheringham</li>
1063  <li>fixed some Makefiles annoyance and libraries prelinking
1064  information</li>
1065</ul>
1066
1067<h3>1.0.7: Nov 10 2001</h3>
1068<ul>
1069  <li>remove a compilation problem with LIBXSLT_PUBLIC</li>
1070  <li>Finishing the integration steps for Keith Isdale debugger</li>
1071  <li>fixes the handling of indent="no" on HTML output</li>
1072  <li>fixes on the configure script and RPM spec file</li>
1073</ul>
1074
1075<h3>1.0.6: Oct 30 2001</h3>
1076<ul>
1077  <li>bug fixes on number formatting (Thomas), date/time functions (Bruce
1078    Miller)</li>
1079  <li>update of the Windows Makefiles (Igor)</li>
1080  <li>fixed DOCTYPE generation rules for HTML output (me)</li>
1081</ul>
1082
1083<h3>1.0.5: Oct 10 2001</h3>
1084<ul>
1085  <li>some portability fixes, including Windows makefile updates from
1086  Igor</li>
1087  <li>fixed a dozen bugs on XSLT and EXSLT (me and Thomas Broyer)</li>
1088  <li>support for Saxon's evaluate and expressions extensions added (initial
1089    contribution from Darren Graves)</li>
1090  <li>better handling of XPath evaluation errors</li>
1091</ul>
1092
1093<h3>1.0.4: Sep 12 2001</h3>
1094<ul>
1095  <li>Documentation updates from John fleck</li>
1096  <li>bug fixes (DocBook  FO generation should be fixed)  and portability
1097    improvements</li>
1098  <li>Thomas Broyer improved the existing EXSLT support and added String,
1099    Time and Date core functions support</li>
1100</ul>
1101
1102<h3>1.0.3:  Aug 23 2001</h3>
1103<ul>
1104  <li>XML Catalog support see the doc</li>
1105  <li>New NaN/Infinity floating point code</li>
1106  <li>A few bug fixes</li>
1107</ul>
1108
1109<h3>1.0.2:  Aug 15 2001</h3>
1110<ul>
1111  <li>lot of bug fixes, increased the testsuite</li>
1112  <li>a large chunk of EXSLT is implemented</li>
1113  <li>improvements on the extension framework</li>
1114  <li>documentation improvements</li>
1115  <li>Windows MSC projects files should be up-to-date</li>
1116  <li>handle attributes inherited from the DTD by default</li>
1117</ul>
1118
1119<h3>1.0.1:  July 24 2001</h3>
1120<ul>
1121  <li>initial EXSLT framework</li>
1122  <li>better error reporting</li>
1123  <li>fixed the profiler on Windows</li>
1124  <li>bug fixes</li>
1125</ul>
1126
1127<h3>1.0.0: July 10 2001</h3>
1128<ul>
1129  <li>a lot of cleanup, a lot of regression tests added or fixed</li>
1130  <li>added a documentation for <a href="extensions.html">writing
1131    extensions</a></li>
1132  <li>fixed some variable evaluation problems (with William)</li>
1133  <li>added profiling of stylesheet execution accessible as the xsltproc
1134    --profile option</li>
1135  <li>fixed element-available() and the implementation of the various
1136    chunking methods present, Norm Walsh provided a lot of feedback</li>
1137  <li>exclude-result-prefixes and namespaces output should now work as
1138    expected</li>
1139  <li>added support of embedded stylesheet as described in section 2.7 of the
1140    spec</li>
1141</ul>
1142
1143<h3>0.14.0: July 5 2001</h3>
1144<ul>
1145  <li>lot of bug fixes, and code cleanup</li>
1146  <li>completion of the little XSLT-1.0 features left unimplemented</li>
1147  <li>Added and implemented the extension API suggested by Thomas Broyer</li>
1148  <li>the Windows MSC environment should be complete</li>
1149  <li>tested and optimized with a really large document (DocBook Definitive
1150    Guide) libxml/libxslt should really be faster on serious workloads</li>
1151</ul>
1152
1153<h3>0.13.0: June 26 2001</h3>
1154<ul>
1155  <li>lots of cleanups</li>
1156  <li>fixed a C++ compilation problem</li>
1157  <li>couple of fixes to xsltSaveTo()</li>
1158  <li>try to fix Docbook-xslt-1.4 and chunking, updated the regression test
1159    with them</li>
1160  <li>fixed pattern compilation and priorities problems</li>
1161  <li>Patches for Windows and MSC project mostly contributed by Yon Derek</li>
1162  <li>update to the Tutorial by John Fleck</li>
1163  <li>William fixed bugs in templates and for-each functions</li>
1164  <li>added a new interface xsltRunStylesheet() for a more flexible output
1165    (incomplete), added -o option to xsltproc</li>
1166</ul>
1167
1168<h3>0.12.0: June 18 2001</h3>
1169<ul>
1170  <li>fixed a dozen of bugs reported</li>
1171  <li>HTML generation should be quite better (requires libxml-2.3.11 upgrade
1172    too)</li>
1173  <li>William fixed some problems with document()</li>
1174  <li>Fix namespace nodes selection and copy (requires libxml-2.3.11 upgrade
1175    too)</li>
1176  <li>John Fleck added a<a href="tutorial/libxslttutorial.html">
1177  tutorial</a></li>
1178  <li>Fixes for namespace handling when evaluating variables</li>
1179  <li>XInclude global flag added to process XInclude on document() if
1180    requested</li>
1181  <li>made xsltproc --version more detailed</li>
1182</ul>
1183
1184<h3>0.11.0: June 1 2001</h3>
1185
1186<p>Mostly a bug fix release.</p>
1187<ul>
1188  <li>integration of catalogs from xsltproc</li>
1189  <li>added --version to xsltproc for bug reporting</li>
1190  <li>fixed errors when handling ID in external parsed entities</li>
1191  <li>document() should hopefully work correctly but ...</li>
1192  <li>fixed bug with PI and comments processing</li>
1193  <li>William fixed the XPath string functions when using unicode</li>
1194</ul>
1195
1196<h3>0.10.0: May 19 2001</h3>
1197<ul>
1198  <li>cleanups to make stylesheet read-only (not 100% complete)</li>
1199  <li>fixed URI resolution in document()</li>
1200  <li>force all XPath expression to be compiled at stylesheet parsing time,
1201    even if unused ...</li>
1202  <li>Fixed HTML default output detection</li>
1203  <li>Fixed double attribute generation #54446</li>
1204  <li>Fixed {{ handling in attributes #54451</li>
1205  <li>More tests and speedups for DocBook document transformations</li>
1206  <li>Fixed a really bad race like bug in xsltCopyTreeList()</li>
1207  <li>added a documentation on the libxslt internals</li>
1208  <li>William Brack and Bjorn Reese improved format-number()</li>
1209  <li>Fixed multiple sort, it should really work now</li>
1210  <li>added a --docbook option for SGML DocBook input (hackish)</li>
1211  <li>a number of other bug fixes and regression test added as people were
1212    submitting them</li>
1213</ul>
1214
1215<h3>0.9.0: May 3 2001</h3>
1216<ul>
1217  <li>lot of various bugfixes, extended the regression suite</li>
1218  <li>xsltproc should work with multiple params</li>
1219  <li>added an option to use xsltproc with HTML input</li>
1220  <li>improved the stylesheet compilation, processing of complex stylesheets
1221    should be faster</li>
1222  <li>using the same stylesheet for concurrent processing on multithreaded
1223    programs should work now</li>
1224  <li>fixed another batch of namespace handling problems</li>
1225  <li>Implemented multiple level of sorting</li>
1226</ul>
1227
1228<h3>0.8.0: Apr 22 2001</h3>
1229<ul>
1230  <li>fixed ansidecl.h problem</li>
1231  <li>fixed unparsed-entity-uri() and generate-id()</li>
1232  <li>sort semantic fixes and priority prob from William M. Brack</li>
1233  <li>fixed namespace handling problems in XPath expression computations
1234    (requires libxml-2.3.7)</li>
1235  <li>fixes to current() and key()</li>
1236  <li>other, smaller fixes, lots of testing with N Walsh DocBook HTML
1237    stylesheets</li>
1238</ul>
1239
1240<h3>0.7.0: Apr 10 2001</h3>
1241<ul>
1242  <li>cleanup using stricter compiler flags</li>
1243  <li>command line parameter passing</li>
1244  <li>fix to xsltApplyTemplates from William M. Brack</li>
1245  <li>added the XSLTMark in the regression tests as well as document()</li>
1246</ul>
1247
1248<h3>0.6.0: Mar 22 2001</h3>
1249<ul>
1250  <li>another beta</li>
1251  <li>requires 2.3.5, which provide XPath expression compilation support</li>
1252  <li>document() extension should function properly</li>
1253  <li>fixed a number or reported bugs</li>
1254</ul>
1255
1256<h3>0.5.0: Mar 10 2001</h3>
1257<ul>
1258  <li>fifth beta</li>
1259  <li>some optimization work, for the moment 2 XSLT transform cannot use the
1260    same stylesheet at the same time (to be fixed)</li>
1261  <li>fixed problems with handling of tree results</li>
1262  <li>fixed a reported strip-spaces problem</li>
1263  <li>added more reported/fixed bugs to the test suite</li>
1264  <li>incorporated William M. Brack fix for imports and global variables as
1265    well as patch for with-param support in apply-templates</li>
1266  <li>a bug fix on for-each</li>
1267</ul>
1268
1269<h3>0.4.0: Mar 1 2001</h3>
1270<ul>
1271  <li>fourth beta test, released at the same time of libxml2-2.3.3</li>
1272  <li>bug fixes</li>
1273  <li>some optimization</li>
1274  <li>started implement extension support, not finished</li>
1275  <li>implemented but not tested multiple file output</li>
1276</ul>
1277
1278<h3>0.3.0: Feb 24 2001</h3>
1279<ul>
1280  <li>third beta test, released at the same time of libxml2-2.3.2</li>
1281  <li>lot of bug fixes</li>
1282  <li>some optimization</li>
1283  <li>added DocBook XSL based testsuite</li>
1284</ul>
1285
1286<h3>0.2.0: Feb 15 2001</h3>
1287<ul>
1288  <li>second beta version, released at the same time as libxml2-2.3.1</li>
1289  <li>getting close to feature completion, lot of bug fixes, some in the HTML
1290    and XPath support of libxml</li>
1291  <li>start becoming usable for real work. This version can now regenerate
1292    the XML 2e HTML from the original XML sources and the associated
1293    stylesheets (in <a
1294    href="http://www.w3.org/TR/REC-xml#b4d250b6c21">section I of the XML
1295    REC</a>)</li>
1296  <li>Still misses extension element/function/prefixes support. Support of
1297    key() and document() is not complete</li>
1298</ul>
1299
1300<h3>0.1.0: Feb 8 2001</h3>
1301<ul>
1302  <li>first beta version, released at the same time as libxml2-2.3.0</li>
1303  <li>lots of bug fixes, first "testing" version, but incomplete</li>
1304</ul>
1305
1306<h3>0.0.1: Jan 25 2001</h3>
1307<ul>
1308  <li>first alpha version released at the same time as libxml2-2.2.12</li>
1309  <li>Framework in place, should work on simple examples, but far from being
1310    feature complete</li>
1311</ul>
1312
1313<h2><a name="xsltproc">The xsltproc tool</a></h2>
1314
1315<p>This program is the simplest way to use libxslt: from the command line. It
1316is also used for doing the regression tests of the library.</p>
1317
1318<p>It takes as first argument the path or URL to an XSLT stylesheet, the next
1319arguments are filenames or URIs of the inputs to be processed. The output of
1320the processing is redirected on the standard output. There is actually a few
1321more options available:</p>
1322<pre>orchis:~ -&gt; xsltproc
1323Usage: xsltproc [options] stylesheet file [file ...]
1324   Options:
1325      --version or -V: show the version of libxml and libxslt used
1326      --verbose or -v: show logs of what's happening
1327      --output file or -o file: save to a given file
1328      --timing: display the time used
1329      --repeat: run the transformation 20 times
1330      --debug: dump the tree of the result instead
1331      --novalid: skip the DTD loading phase
1332      --noout: do not dump the result
1333      --maxdepth val : increase the maximum depth
1334      --html: the input document is(are) an HTML file(s)
1335      --docbook: the input document is SGML docbook
1336      --param name value : pass a (parameter,value) pair
1337      --nonet refuse to fetch DTDs or entities over network
1338      --warnnet warn against fetching over the network
1339      --catalogs : use the catalogs from $SGML_CATALOG_FILES
1340      --xinclude : do XInclude processing on document input
1341      --profile or --norman : dump profiling information 
1342orchis:~ -&gt;</pre>
1343
1344<h2><a name="DocBook">DocBook</a></h2>
1345
1346<p><img src="duck.png" align="right" alt="The duck picture"></p>
1347
1348<p><a href="http://www.oasis-open.org/committees/docbook/">DocBook</a> is an
1349XML/SGML vocabulary particularly well suited to books and papers about
1350computer hardware and software.</p>
1351
1352<p>xsltproc and libxslt are not specifically dependant on DocBook, but since
1353a lot of people use xsltproc and libxml2 for DocBook formatting, here are a
1354few pointers and information which may be helpful:</p>
1355<ul>
1356  <li>The <a href="http://www.oasis-open.org/committees/docbook/">DocBook
1357    homepage at Oasis</a> you should find pointers there on all the lastest
1358    versions of the DTDs and XSLT stylesheets</li>
1359  <li><a href="http://www.docbook.org/">DocBook: The Definitive Guide</a> is
1360    the official reference documentation for DocBook.</li>
1361  <li><a
1362    href="https://sourceforge.net/docman/index.php?group_id=21935">DocBook
1363    Open Repository</a> contains a lot of information about DocBook</li>
1364  <li>Bob Stayton provides a <a href="http://www.sagehill.net/">lot of
1365    resources</a> and consulting services around DocBook.</li>
1366  <li>Here is a <a href="/buildDocBookCatalog">shell script</a> to generate
1367    XML Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/
1368    directory, it will set-up /etc/xml/catalog and /etc/xml/docbook based on
1369    the resources found on the system. Otherwise it will just create
1370    ~/xmlcatalog and ~/dbkxmlcatalog and doing:
1371    <p><code>export XMLCATALOG=$HOME/xmlcatalog</code></p>
1372    <p>should allow to process DocBook documentations without requiring
1373    network accesses for the DTd or stylesheets</p>
1374  </li>
1375  <li>I have uploaded <a href="ftp://xmlsoft.org/libxml2/test/dbk412catalog.tar.gz">a
1376    small tarball</a> containing XML Catalogs for DocBook 4.1.2 which seems
1377    to work fine for me too</li>
1378  <li>Informations on installing a <a
1379    href="http://wiki.docbook.org/topic/CygwinPackages">Windows
1380    DocBook processing setup</a> based on Cygwin (using the binaries from the
1381    official Windows port should be possible too)</li>
1382  <li>Alexander Kirillov's page on <a
1383    href="http://www.math.sunysb.edu/~kirillov/dbxml/">Using DocBook XML
1384    4.1.2</a> (RPM packages)</li>
1385  <li>Tim Waugh's <a href="http://cyberelk.net/tim/xmlto/">xmlto front-end
1386    conversion script</a></li>
1387  <li>Linux Documentation Project <a
1388    href="http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/">
1389    DocBook-Install-mini-HOWTO</a></li>
1390  <li>ScrollKeeper the open documentation cataloging project has a <a
1391    href="http://scrollkeeper.sourceforge.net/docbook.shtml">DocBook
1392    section</a></li>
1393  <li>Dan York presentation on <a
1394    href="http://www.lodestar2.com/people/dyork/talks/2001/xugo/docbook/index.html">Publishing
1395    using DocBook XML</a></li>
1396</ul>
1397
1398<p>Do not use the --docbook option of xsltproc to process XML DocBook
1399documents, this option is only intended to provide some (limited) support of
1400the SGML version of DocBook.</p>
1401
1402<p>Points which are not DocBook specific but still worth mentionning
1403again:</p>
1404<ul>
1405  <li>if you think DocBook processing time is too slow, make sure you have
1406    XML Catalogs pointing to a local installation of the DTD of DocBook.
1407    Check the <a href="http://xmlsoft.org/catalog.html">XML Catalog page</a>
1408    to understand more on this subject.</li>
1409  <li>before processing a new document, use the command
1410    <p><code>xmllint --valid --noout path_to_document</code></p>
1411    <p>to make sure that your input is valid DocBook. And fixes the errors
1412    before processing further. Note that XSLT processing may work correctly
1413    with some forms of validity errors left, but in general it can give
1414    troubles on output.</p>
1415  </li>
1416</ul>
1417
1418<h2><a name="API">The programming API</a></h2>
1419
1420<p>Okay this section is clearly incomplete. But integrating libxslt into your
1421application should be relatively easy. First check the few steps described
1422below, then for more detailed information, look at the<a
1423href="html/libxslt-lib.html"> generated pages</a> for the API and the source
1424of libxslt/xsltproc.c  and the  <a
1425href="tutorial/libxslttutorial.html">tutorial</a>.</p>
1426
1427<p>Basically doing an XSLT transformation can be done in a few steps:</p>
1428<ol>
1429  <li>configure the parser for XSLT:
1430    <p>xmlSubstituteEntitiesDefault(1);</p>
1431    <p>xmlLoadExtDtdDefaultValue = 1;</p>
1432  </li>
1433  <li>parse the stylesheet with xsltParseStylesheetFile()</li>
1434  <li>parse the document with xmlParseFile()</li>
1435  <li>apply the stylesheet using xsltApplyStylesheet()</li>
1436  <li>save the result using xsltSaveResultToFile() if needed set
1437    xmlIndentTreeOutput to 1</li>
1438</ol>
1439
1440<p>Steps 2,3, and 5 will probably need to be changed depending on you
1441processing needs and environment for example if reading/saving from/to
1442memory, or if you want to apply XInclude processing to the stylesheet or
1443input documents.</p>
1444
1445<h2><a name="Python">Python and bindings</a></h2>
1446
1447<p>There is a number of language bindings and wrappers available for libxml2,
1448the list below is not exhaustive. Please contact the <a
1449href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>
1450(<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in
1451order to get updates to this list or to discuss the specific topic of libxml2
1452or libxslt wrappers or bindings:</p>
1453<ul>
1454  <li><a
1455    href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
1456    Sergeant</a> developped <a href="http://axkit.org/download/">XML::LibXML
1457    and XML::LibXSLT</a>, Perl wrappers for libxml2/libxslt as part of the <a
1458    href="http://axkit.com/">AxKit XML application server</a></li>
1459  <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provides and
1460    earlier version of the libxml/libxslt <a
1461    href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li>
1462  <li>Petr Kozelka provides <a
1463    href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
1464    libxml2</a> with Kylix, Delphi and other Pascal compilers</li>
1465  <li>Wai-Sun "Squidster" Chia provides <a
1466    href="http://www.rubycolor.org/arc/redist/">bindings for Ruby</a>  and
1467    libxml2 bindings are also available in Ruby through the <a
1468    href="http://libgdome-ruby.berlios.de/">libgdome-ruby</a> module
1469    maintained by Tobias Peters.</li>
1470  <li>Steve Ball and contributors maintains <a
1471    href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings for
1472    Tcl</a></li>
1473  <li><a href="mailto:xmlwrapp@pmade.org">Peter Jones</a> maintains C++
1474    bindings for libxslt within <a
1475    href="http://pmade.org/pjones/software/xmlwrapp/">xmlwrapp</a></li>
1476  <li><a href="phillim2@comcast.net">Mike Phillips</a> provides a module
1477    using <a href="http://siasl.dyndns.org/projects/projects.html">libxslt
1478    for PHP</a>.</li>
1479  <li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
1480    an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
1481    libxslt as part of GNU ClasspathX project.</li>
1482  <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for
1483    <a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
1484  <li><a
1485    href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
1486    provides <a
1487    href="http://www.satimage.fr/software/en/downloads_osaxen.html">XMLLib
1488    osax</a>. This is an osax for Mac OS X with a set of commands to
1489    implement in AppleScript the XML DOM, XPATH and XSLT.</li>
1490</ul>
1491
1492<p>The libxslt Python module depends on the <a
1493href="http://xmlsoft.org/python.html">libxml2 Python</a> module.</p>
1494
1495<p>The distribution includes a set of Python bindings, which are guaranteed to
1496be maintained as part of the library in the future, though the Python
1497interface have not yet reached the completeness of the C API.</p>
1498
1499<p><a href="mailto:stephane.bidoul@softwareag.com">St�phane Bidoul</a>
1500maintains <a href="http://users.skynet.be/sbi/libxml-python/">a Windows port
1501of the Python bindings</a>.</p>
1502
1503<p>Note to people interested in building bindings, the API is formalized as
1504<a href="libxslt-api.xml">an XML API description file</a> which allows to
1505automate a large part of the Python bindings, this includes function
1506descriptions, enums, structures, typedefs, etc... The Python script used to
1507build the bindings is python/generator.py in the source distribution.</p>
1508
1509<p>To install the Python bindings there are 2 options:</p>
1510<ul>
1511  <li>If you use an RPM based distribution, simply install the <a
1512    href="http://rpmfind.net/linux/rpm2html/search.php?query=libxml2-python">libxml2-python
1513    RPM</a> and the <a
1514    href="http://rpmfind.net/linux/rpm2html/search.php?query=libxslt-python">libxslt-python
1515    RPM</a>.</li>
1516  <li>Otherwise use the <a href="ftp://xmlsoft.org/libxml2/python/">libxml2-python
1517    module distribution</a> corresponding to your installed version of
1518    libxml2 and libxslt. Note that to install it you will need both libxml2
1519    and libxslt installed and run "python setup.py build install" in the
1520    module tree.</li>
1521</ul>
1522
1523<p>The distribution includes a set of examples and regression tests for the
1524python bindings in the <code>python/tests</code> directory. Here are some
1525excepts from those tests:</p>
1526
1527<h3>basic.py:</h3>
1528
1529<p>This is a basic test of XSLT interfaces: loading a stylesheet and a
1530document, transforming the document and saving the result.</p>
1531<pre>import libxml2
1532import libxslt
1533
1534styledoc = libxml2.parseFile("test.xsl")
1535style = libxslt.parseStylesheetDoc(styledoc)
1536doc = libxml2.parseFile("test.xml")
1537result = style.applyStylesheet(doc, None)
1538style.saveResultToFilename("foo", result, 0)
1539style.freeStylesheet()
1540doc.freeDoc()
1541result.freeDoc()</pre>
1542
1543<p>The Python module is called libxslt, you will also need the libxml2 module
1544for the operations on XML trees. Let's have a look at the objects manipulated
1545in that example and how is the processing done:</p>
1546<ul>
1547  <li><code>styledoc</code> : is a libxml2 document tree. It is obtained by
1548    parsing the XML file "test.xsl" containing the stylesheet.</li>
1549  <li><code>style</code> : this is a precompiled stylesheet ready to be used
1550    by the following transformations (note the plural form, multiple
1551    transformations can resuse the same stylesheet).</li>
1552  <li><code>doc</code> : this is the document to apply the transformation to.
1553    In this case it is simply generated by parsing it from a file but any
1554    other processing is possible as long as one get a libxml2 Doc. Note that
1555    HTML tree are suitable for XSLT processing in libxslt. This is actually
1556    how this page is generated !</li>
1557  <li><code>result</code> : this is a document generated by applying the
1558    stylesheet to the document. Note that some of the stylesheet information
1559    may be related to the serialization of that document and as in this
1560    example a specific saveResultToFilename() method of the stylesheet should
1561    be used to save it to a file (in that case to "foo").</li>
1562</ul>
1563
1564<p>Also note the need to explicitely deallocate documents with freeDoc()
1565except for the stylesheet document which is freed when its compiled form is
1566garbage collected.</p>
1567
1568<h3>extfunc.py:</h3>
1569
1570<p>This one is a far more complex test. It shows how to modify the behaviour
1571of an XSLT transformation by passing parameters and how to extend the XSLT
1572engine with functions defined in python:</p>
1573<pre>import libxml2
1574import libxslt
1575import string
1576
1577nodeName = None
1578def f(ctx, str):
1579    global nodeName
1580
1581    #
1582    # Small check to verify the context is correcly accessed
1583    #
1584    try:
1585        pctxt = libxslt.xpathParserContext(_obj=ctx)
1586        ctxt = pctxt.context()
1587        tctxt = ctxt.transformContext()
1588        nodeName = tctxt.insertNode().name
1589    except:
1590        pass
1591
1592    return string.upper(str)
1593
1594libxslt.registerExtModuleFunction("foo", "http://example.com/foo", f)</pre>
1595
1596<p>This code defines and register an extension function. Note that the
1597function can be bound to any name (foo) and how the binding is also
1598associated to a namespace name "http://example.com/foo". From an XSLT point
1599of view the function just returns an upper case version of the string passed
1600as a parameter. But the first part of the function also read some contextual
1601information from the current XSLT processing environement, in that case it
1602looks for the current insertion node in the resulting output (either the
1603resulting document or the Result Value Tree being generated), and saves it to
1604a global variable for checking that the access actually worked.</p>
1605
1606<p>For more information on the xpathParserContext and transformContext
1607objects check the <a href="internals.html">libray internals description</a>.
1608The pctxt is actually an object from a class derived from the
1609libxml2.xpathParserContext() with just a couple more properties including the
1610possibility to look up the XSLT transformation context from the XPath
1611context.</p>
1612<pre>styledoc = libxml2.parseDoc("""
1613&lt;xsl:stylesheet version='1.0'
1614  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
1615  xmlns:foo='http://example.com/foo'
1616  xsl:exclude-result-prefixes='foo'&gt;
1617
1618  &lt;xsl:param name='bar'&gt;failure&lt;/xsl:param&gt;
1619  &lt;xsl:template match='/'&gt;
1620    &lt;article&gt;&lt;xsl:value-of select='foo:foo($bar)'/&gt;&lt;/article&gt;
1621  &lt;/xsl:template&gt;
1622&lt;/xsl:stylesheet&gt;
1623""")</pre>
1624
1625<p>Here is a simple example of how to read an XML document from a python
1626string with libxml2. Note how this stylesheet:</p>
1627<ul>
1628  <li>Uses a global parameter <code>bar</code></li>
1629  <li>Reference the extension function f</li>
1630  <li>how the Namespace name "http://example.com/foo" has to be bound to a
1631    prefix</li>
1632  <li>how that prefix is excluded from the output</li>
1633  <li>how the function is called from the select</li>
1634</ul>
1635<pre>style = libxslt.parseStylesheetDoc(styledoc)
1636doc = libxml2.parseDoc("&lt;doc/&gt;")
1637result = style.applyStylesheet(doc, { "bar": "'success'" })
1638style.freeStylesheet()
1639doc.freeDoc()</pre>
1640
1641<p>that part is identical, to the basic example except that the
1642transformation is passed a dictionary of parameters. Note that the string
1643passed "success" had to be quoted, otherwise it is interpreted as an XPath
1644query for the childs of root named "success".</p>
1645<pre>root = result.children
1646if root.name != "article":
1647    print "Unexpected root node name"
1648    sys.exit(1)
1649if root.content != "SUCCESS":
1650    print "Unexpected root node content, extension function failed"
1651    sys.exit(1)
1652if nodeName != 'article':
1653    print "The function callback failed to access its context"
1654    sys.exit(1)
1655
1656result.freeDoc()</pre>
1657
1658<p>That part just verifies that the transformation worked, that the parameter
1659got properly passed to the engine, that the function f() got called and that
1660it properly accessed the context to find the name of the insertion node.</p>
1661
1662<h3>pyxsltproc.py:</h3>
1663
1664<p>this module is a bit too long to be described there but it is basically a
1665rewrite of the xsltproc command line interface of libxslt in Python. It
1666provides nearly all the functionalities of xsltproc and can be used as a base
1667module to write Python customized XSLT processors. One of the thing to notice
1668are:</p>
1669<pre>libxml2.lineNumbersDefault(1)
1670libxml2.substituteEntitiesDefault(1)</pre>
1671
1672<p>those two calls in the main() function are needed to force the libxml2
1673processor to generate DOM trees compliant with the XPath data model.</p>
1674
1675<h2><a name="Internals">Library internals</a></h2>
1676
1677<h3>Table  of contents</h3>
1678<ul>
1679  <li><a href="internals.html#Introducti">Introduction</a></li>
1680  <li><a href="internals.html#Basics">Basics</a></li>
1681  <li><a href="internals.html#Keep">Keep it simple stupid</a></li>
1682  <li><a href="internals.html#libxml">The libxml nodes</a></li>
1683  <li><a href="internals.html#XSLT">The XSLT processing steps</a></li>
1684  <li><a href="internals.html#XSLT1">The XSLT stylesheet compilation</a></li>
1685  <li><a href="internals.html#XSLT2">The XSLT template compilation</a></li>
1686  <li><a href="internals.html#processing">The processing itself</a></li>
1687  <li><a href="internals.html#XPath">XPath expressions compilation</a></li>
1688  <li><a href="internals.html#XPath1">XPath interpretation</a></li>
1689  <li><a href="internals.html#Descriptio">Description of XPath
1690  Objects</a></li>
1691  <li><a href="internals.html#XPath3">XPath functions</a></li>
1692  <li><a href="internals.html#stack">The variables stack frame</a></li>
1693  <li><a href="internals.html#Extension">Extension support</a></li>
1694  <li><a href="internals.html#Futher">Further reading</a></li>
1695  <li><a href="internals.html#TODOs">TODOs</a></li>
1696  <li><a href="internals.html#Thanks">Thanks</a></li>
1697</ul>
1698
1699<h3><a name="Introducti2">Introduction</a></h3>
1700
1701<p>This document describes the processing of <a
1702href="http://xmlsoft.org/XSLT/">libxslt</a>, the <a
1703href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the <a
1704href="http://www.gnome.org/">GNOME</a> project.</p>
1705
1706<p>Note: this documentation is by definition incomplete and I am not good at
1707spelling, grammar, so patches and suggestions are <a
1708href="mailto:veillard@redhat.com">really welcome</a>.</p>
1709
1710<h3><a name="Basics1">Basics</a></h3>
1711
1712<p>XSLT is a transformation language. It takes an input document and a
1713stylesheet document and generates an output document:</p>
1714
1715<p align="center"><img src="processing.gif"
1716alt="the XSLT processing model"></p>
1717
1718<p>Libxslt is written in C. It relies on <a
1719href="http://www.xmlsoft.org/">libxml</a>, the XML C library for GNOME, for
1720the following operations:</p>
1721<ul>
1722  <li>parsing files</li>
1723  <li>building the in-memory DOM structure associated with the documents
1724    handled</li>
1725  <li>the XPath implementation</li>
1726  <li>serializing back the result document to XML and HTML. (Text is handled
1727    directly.)</li>
1728</ul>
1729
1730<h3><a name="Keep1">Keep it simple stupid</a></h3>
1731
1732<p>Libxslt is not very specialized. It is built under the assumption that all
1733nodes from the source and output document can fit in the virtual memory of
1734the system. There is a big trade-off there. It is fine for reasonably sized
1735documents but may not be suitable for large sets of data. The gain is that it
1736can be used in a relatively versatile way. The input or output may never be
1737serialized, but the size of documents it can handle are limited by the size
1738of the memory available.</p>
1739
1740<p>More specialized memory handling approaches are possible, like building
1741the input tree from a serialization progressively as it is consumed,
1742factoring repetitive patterns, or even on-the-fly generation of the output as
1743the input is parsed but it is possible only for a limited subset of the
1744stylesheets. In general the implementation of libxslt follows the following
1745pattern:</p>
1746<ul>
1747  <li>KISS (keep it simple stupid)</li>
1748  <li>when there is a clear bottleneck optimize on top of this simple
1749    framework and refine only as much as is needed to reach the expected
1750    result</li>
1751</ul>
1752
1753<p>The result is not that bad, clearly one can do a better job but more
1754specialized too. Most optimization like building the tree on-demand would
1755need serious changes to the libxml XPath framework. An easy step would be to
1756serialize the output directly (or call a set of SAX-like output handler to
1757keep this a flexible interface) and hence avoid the memory consumption of the
1758result.</p>
1759
1760<h3><a name="libxml">The libxml nodes</a></h3>
1761
1762<p>DOM-like trees, as used and generated by libxml and libxslt, are
1763relatively complex. Most node types follow the given structure except a few
1764variations depending on the node type:</p>
1765
1766<p align="center"><img src="node.gif" alt="description of a libxml node"></p>
1767
1768<p>Nodes carry a <strong>name</strong> and the node <strong>type</strong>
1769indicates the kind of node it represents, the most common ones are:</p>
1770<ul>
1771  <li>document nodes</li>
1772  <li>element nodes</li>
1773  <li>text nodes</li>
1774</ul>
1775
1776<p>For the XSLT processing, entity nodes should not be generated (i.e. they
1777should be replaced by their content). Most nodes also contains the following
1778"navigation" information:</p>
1779<ul>
1780  <li>the containing <strong>doc</strong>ument</li>
1781  <li>the <strong>parent</strong> node</li>
1782  <li>the first <strong>children</strong> node</li>
1783  <li>the <strong>last</strong> children node</li>
1784  <li>the <strong>prev</strong>ious sibling</li>
1785  <li>the following sibling (<strong>next</strong>)</li>
1786</ul>
1787
1788<p>Elements nodes carries the list of attributes in the properties, an
1789attribute itself holds the navigation pointers and the children list (the
1790attribute value is not represented as a simple string to allow usage of
1791entities references).</p>
1792
1793<p>The <strong>ns</strong> points to the namespace declaration for the
1794namespace associated to the node, <strong>nsDef</strong> is the linked list
1795of namespace declaration present on element nodes.</p>
1796
1797<p>Most nodes also carry an <strong>_private</strong> pointer which can be
1798used by the application to hold specific data on this node.</p>
1799
1800<h3><a name="XSLT">The XSLT processing steps</a></h3>
1801
1802<p>There are a few steps which are clearly decoupled at the interface
1803level:</p>
1804<ol>
1805  <li>parse the stylesheet and generate a DOM tree</li>
1806  <li>take the stylesheet tree and build a compiled version of it (the
1807    compilation phase)</li>
1808  <li>take the input and generate a DOM tree</li>
1809  <li>process the stylesheet against the input tree and generate an output
1810    tree</li>
1811  <li>serialize the output tree</li>
1812</ol>
1813
1814<p>A few things should be noted here:</p>
1815<ul>
1816  <li>the steps 1/ 3/ and 5/ are optional:  the DOM representing the
1817    stylesheet and input can be created by other means, not just by parsing
1818    serialized XML documents, and similarly the result tree DOM can be
1819    made available to other processeswithout being serialized.
1820  <li>the stylesheet obtained at 2/ can be reused by multiple processing 4/
1821    (and this should also work in threaded programs)</li>
1822  <li>the tree provided in 2/ should never be freed using xmlFreeDoc, but by
1823    freeing the stylesheet.</li>
1824  <li>the input tree created in step 3/ is not modified except the
1825    _private field which may be used for labelling keys if used by the
1826    stylesheet. It's not modified at all in step 4/ to allow parallel
1827    processing using a shared precompiled stylesheet.</li>
1828</ul>
1829
1830<h3><a name="XSLT1">The XSLT stylesheet compilation</a></h3>
1831
1832<p>This is the second step described. It takes a stylesheet tree, and
1833"compiles" it. This associates to each node a structure stored in the
1834_private field and containing information computed in the stylesheet:</p>
1835
1836<p align="center"><img src="stylesheet.gif"
1837alt="a compiled XSLT stylesheet"></p>
1838
1839<p>One xsltStylesheet structure is generated per document parsed for the
1840stylesheet. XSLT documents allow includes and imports of other documents,
1841imports are stored in the <strong>imports</strong> list (hence keeping the
1842tree hierarchy of includes which is very important for a proper XSLT
1843processing model) and includes are stored in the <strong>doclist</strong>
1844list. An imported stylesheet has a parent link to allow browsing of the
1845tree.</p>
1846
1847<p>The DOM tree associated to the document is stored in <strong>doc</strong>.
1848It is preprocessed to remove ignorable empty nodes and all the nodes in the
1849XSLT namespace are subject to precomputing. This usually consist of
1850extracting all the context information from the context tree (attributes,
1851namespaces, XPath expressions), and storing them in an xsltStylePreComp
1852structure associated to the <strong>_private</strong> field of the node.</p>
1853
1854<p>A couple of notable exceptions to this are XSLT template nodes (more on
1855this later) and attribute value templates. If they are actually templates,
1856the value cannot be computed at compilation time. (Some preprocessing could
1857be done like isolation and preparsing of the XPath subexpressions but it's
1858not done, yet.)</p>
1859
1860<p>The xsltStylePreComp structure also allows storing of the precompiled form
1861of an XPath expression that can be associated to an XSLT element (more on
1862this later).</p>
1863
1864<h3><a name="XSLT2">The XSLT template compilation</a></h3>
1865
1866<p>A proper handling of templates lookup is one of the keys of fast XSLT
1867processing. (Given a node in the source document this is the process of
1868finding which templates should be applied to this node.) Libxslt follows the
1869hint suggested in the <a href="http://www.w3.org/TR/xslt#patterns">5.2
1870Patterns</a> section of the XSLT Recommendation, i.e. it doesn't evaluate it
1871as an XPath expression but tokenizes it and compiles it as a set of rules to
1872be evaluated on a candidate node. There usually is an indication of the node
1873name in the last step of this evaluation and this is used as a key check for
1874the match. As a result libxslt builds a relatively more complex set of
1875structures for the templates:</p>
1876
1877<p align="center"><img src="templates.gif"
1878alt="The templates related structure"></p>
1879
1880<p>Let's describe a bit more closely what is built. First the xsltStylesheet
1881structure holds a pointer to the template hash table. All the XSLT patterns
1882compiled in this stylesheet are indexed by the value of the the target
1883element (or attribute, pi ...) name, so when a element or an attribute "foo"
1884needs to be processed the lookup is done using the name as a key.</p>
1885
1886<p>Each of the patterns is compiled into an xsltCompMatch
1887(i.e. an ''XSLT compiled match') structure. It holds
1888the set of rules based on the tokenization of the pattern stored in reverse
1889order (matching is easier this way). </p>
1890
1891<p>The xsltCompMatch are then stored in the hash table, the clash list is
1892itself sorted by priority of the template to implement "naturally" the XSLT
1893priority rules.</p>
1894
1895<p>Associated to the compiled pattern is the xsltTemplate itself containing
1896the information required for the processing of the pattern including, of
1897course, a pointer to the list of elements used for building the pattern
1898result.</p>
1899
1900<p>Last but not least a number of patterns do not fit in the hash table
1901because they are not associated to a name, this is the case for patterns
1902applying to the root, any element, any attributes, text nodes, pi nodes, keys
1903etc. Those are stored independently in the stylesheet structure as separate
1904linked lists of xsltCompMatch.</p>
1905
1906<h3><a name="processing">The processing itself</a></h3>
1907
1908<p>The processing is defined by the XSLT specification (the basis of the
1909algorithm is explained in <a
1910href="http://www.w3.org/TR/xslt#section-Introduction">the Introduction</a>
1911section). Basically it works by taking the root of the input document
1912as the cureent node and applying the following algorithm:</p>
1913<ol>
1914  <li>Finding the template applying to current node.
1915    This is a lookup in the template hash table, walking the hash list until
1916    the node satisfies all the steps of the pattern, then checking the
1917    appropriate global template(s) (i.e.  templates applying to a node type)
1918    to see if there isn't a higher priority rule to apply</li>
1919  <li>If there is no template, apply the default rule (recurse on the
1920    children as the current node)</li>
1921  <li>else walk the content list of the selected templates, for each of them:
1922    <ul>
1923      <li>if the node is in the XSLT namespace then the node has a _private
1924        field pointing to the preprocessed values, jump to the specific
1925      code</li>
1926      <li>if the node is in an extension namespace, look up the associated
1927        behavior</li>
1928      <li>otherwise copy the node.</li>
1929    </ul>
1930    <p>The closure is usually done through the XSLT
1931    <strong>apply-templates</strong>construct, which invokes this process
1932      recursively starting at step 1, to find the appropriate template
1933      for the nodes selected by the 'select' attribute of the apply-templates
1934      instruction (default: the children of the node currently being
1935      processed)</p>
1936  </li>
1937</ol>
1938
1939<p>Note that large parts of the input tree may not be processed by a given
1940stylesheet and that conversely some may be processed multiple times.
1941(This often is the case when a Table of Contents is built).</p>
1942
1943<p>The module <code>transform.c</code> is the one implementing most of this
1944logic. <strong>xsltApplyStylesheet()</strong> is the entry point, it
1945allocates an xsltTransformContext containing the following:</p>
1946<ul>
1947  <li>a pointer to the stylesheet being processed</li>
1948  <li>a stack of templates</li>
1949  <li>a stack of variables and parameters</li>
1950  <li>an XPath context</li>
1951  <li>the template mode</li>
1952  <li>current document</li>
1953  <li>current input node</li>
1954  <li>current selected node list</li>
1955  <li>the current insertion points in the output document</li>
1956  <li>a couple of hash tables for extension elements and functions</li>
1957</ul>
1958
1959<p>Then a new document gets allocated (HTML or XML depending on the type of
1960output), the user parameters and global variables and parameters are
1961evaluated. Then <strong>xsltProcessOneNode()</strong> which implements the
19621-2-3 algorithm is called on the docuemnt node of the input. Step 1/ is
1963implemented by calling <strong>xsltGetTemplate()</strong>, step 2/ is
1964implemented by <strong>xsltDefaultProcessOneNode()</strong> and step 3/ is
1965implemented by <strong>xsltApplyOneTemplate()</strong>.</p>
1966
1967<h3><a name="XPath">XPath expression compilation</a></h3>
1968
1969<p>The XPath support is actually implemented in the libxml module (where it
1970is reused by the XPointer implementation). XPath is a relatively classic
1971expression language. The only uncommon feature is that it is working on XML
1972trees and hence has specific syntax and types to handle them.</p>
1973
1974<p>XPath expressions are compiled using <strong>xmlXPathCompile()</strong>.
1975It will take an expression string in input and generate a structure
1976containing the parsed expression tree, for example the expression:</p>
1977<pre>/doc/chapter[title='Introduction']</pre>
1978
1979<p>will be compiled as</p>
1980<pre>Compiled Expression : 10 elements
1981  SORT
1982    COLLECT  'child' 'name' 'node' chapter
1983      COLLECT  'child' 'name' 'node' doc
1984        ROOT
1985      PREDICATE
1986        SORT
1987          EQUAL =
1988            COLLECT  'child' 'name' 'node' title
1989              NODE
1990            ELEM Object is a string : Introduction
1991              COLLECT  'child' 'name' 'node' title
1992                NODE</pre>
1993
1994<p>This can be tested using the  <code>testXPath</code>  command (in the
1995libxml codebase) using the <code>--tree</code> option.</p>
1996
1997<p>Again, the KISS approach is used. No optimization is done. This could be
1998an interesting thing to add. <a
1999href="http://www-106.ibm.com/developerworks/library/x-xslt2/?dwzone=x?open&l=132%2ct=gr%2c+p=saxon">Michael
2000Kay describes</a> a lot of possible and interesting optimizations done in
2001Saxon which would be possible at this level. I'm unsure they would provide
2002much gain since the expressions tends to be relatively simple in general and
2003stylesheets are still hand generated. Optimizations at the interpretation
2004sounds likely to be more efficient.</p>
2005
2006<h3><a name="XPath1">XPath interpretation</a></h3>
2007
2008<p>The interpreter is implemented by <strong>xmlXPathCompiledEval()</strong>
2009which is the front-end to <strong>xmlXPathCompOpEval()</strong> the function
2010implementing the evaluation of the expression tree. This evaluation follows
2011the KISS approach again. It's recursive and calls
2012<strong>xmlXPathNodeCollectAndTest()</strong> to collect a set of nodes when
2013evaluating a <code>COLLECT</code> node.</p>
2014
2015<p>An evaluation is done within the framework of an XPath context stored in
2016an <strong>xmlXPathContext</strong> structure, in the framework of a
2017transformation the context is maintained within the XSLT context. Its content
2018follows the requirements from the XPath specification:</p>
2019<ul>
2020  <li>the current document</li>
2021  <li>the current node</li>
2022  <li>a hash table of defined variables (but not used by XSLT,
2023      which uses its own stack frame for variables, described below)</li>
2024  <li>a hash table of defined functions</li>
2025  <li>the proximity position (the place of the node in the current node
2026  list)</li>
2027  <li>the context size (the size of the current node list)</li>
2028  <li>the array of namespace declarations in scope (there also is a namespace
2029    hash table but it is not used in the XSLT transformation).</li>
2030</ul>
2031
2032<p>For the purpose of XSLT an <strong>extra</strong> pointer has been added
2033allowing to retrieve the XSLT transformation context. When an XPath
2034evaluation is about to be performed, an XPath parser context is allocated
2035containing an XPath object stack (this is actually an XPath evaluation
2036context, this is a relic of the time where there was no separate parsing and
2037evaluation phase in the XPath implementation). Here is an overview of the set
2038of contexts associated to an XPath evaluation within an XSLT
2039transformation:</p>
2040
2041<p align="center"><img src="contexts.gif"
2042alt="The set of contexts associated "></p>
2043
2044<p>Clearly this is a bit too complex and confusing and should be refactored
2045at the next set of binary incompatible releases of libxml. For example the
2046xmlXPathCtxt has a lot of unused parts and should probably be merged with
2047xmlXPathParserCtxt.</p>
2048
2049<h3><a name="Descriptio">Description of XPath Objects</a></h3>
2050
2051<p>An XPath expression manipulates XPath objects. XPath defines the default
2052types boolean, numbers, strings and node sets. XSLT adds the result tree
2053fragment type which is basically an unmodifiable node set.</p>
2054
2055<p>Implementation-wise, libxml follows again a KISS approach, the
2056xmlXPathObject is a structure containing a type description and the various
2057possibilities. (Using an enum could have gained some bytes.) In the case of
2058node sets (or result tree fragments), it points to a separate xmlNodeSet
2059object which contains the list of pointers to the document nodes:</p>
2060
2061<p align="center"><img src="object.gif"
2062alt="An Node set object pointing to "></p>
2063
2064<p>The <a href="http://xmlsoft.org/html/libxml-xpath.html">XPath API</a> (and
2065its <a href="http://xmlsoft.org/html/libxml-xpathinternals.html">'internal'
2066part</a>) includes a number of functions to create, copy, compare, convert or
2067free XPath objects.</p>
2068
2069<h3><a name="XPath3">XPath functions</a></h3>
2070
2071<p>All the XPath functions available to the interpreter are registered in the
2072function hash table linked from the XPath context. They all share the same
2073signature:</p>
2074<pre>void xmlXPathFunc (xmlXPathParserContextPtr ctxt, int nargs);</pre>
2075
2076<p>The first argument is the XPath interpretation context, holding the
2077interpretation stack. The second argument defines the number of objects
2078passed on the stack for the function to consume (last argument is on top of
2079the stack).</p>
2080
2081<p>Basically an XPath function does the following:</p>
2082<ul>
2083  <li>check <code>nargs</code> for proper handling of errors or functions
2084    with variable numbers of parameters</li>
2085  <li>pop the parameters from the stack using <code>obj =
2086    valuePop(ctxt);</code></li>
2087  <li>do the function specific computation</li>
2088  <li>push the result parameter on the stack using <code>valuePush(ctxt,
2089    res);</code></li>
2090  <li>free up the input parameters with
2091  <code>xmlXPathFreeObject(obj);</code></li>
2092  <li>return</li>
2093</ul>
2094
2095<p>Sometime the work can be done directly by modifying in-situ the top object
2096on the stack <code>ctxt-&gt;value</code>.</p>
2097
2098<h3><a name="stack">The XSLT variables stack frame</a></h3>
2099
2100<p>Not to be confused with XPath object stack, this stack holds the XSLT
2101variables and parameters as they are defined through the recursive calls of
2102call-template, apply-templates and default templates. This is used to define
2103the scope of variables being called.</p>
2104
2105<p>This part seems to be one needing most work , first it is
2106done in a very inefficient way since the location of the variables and
2107parameters within the stylesheet tree is still done at run time (it really
2108should be done statically at compile time), and I am still unsure that my
2109understanding of the template variables and parameter scope is actually
2110right.</p>
2111
2112<p>This part of the documentation is still to be written once this part of
2113the code will be stable. <span
2114style="background-color: #FF0000">TODO</span></p>
2115
2116<h3><a name="Extension">Extension support</a></h3>
2117
2118<p>There is a separate document explaining <a href="extensions.html">how the
2119extension support works</a>.</p>
2120
2121<h3><a name="Futher">Further reading</a></h3>
2122
2123<p>Michael Kay wrote <a
2124href="http://www-106.ibm.com/developerworks/library/x-xslt2/?dwzone=x?open&l=132%2ct=gr%2c+p=saxon">a
2125really interesting article on Saxon internals</a> and the work he did on
2126performance issues. I wish I had read it before starting libxslt design (I
2127would probably have avoided a few mistakes and progressed faster). A lot of
2128the ideas in his papers should be implemented or at least tried in
2129libxslt.</p>
2130
2131<p>The <a href="http://xmlsoft.org/">libxml documentation</a>, especially <a
2132href="http://xmlsoft.org/xmlio.html">the I/O interfaces</a> and the <a
2133href="http://xmlsoft.org/xmlmem.html">memory management</a>.</p>
2134
2135<h3><a name="TODOs">TODOs</a></h3>
2136
2137<p>redesign the XSLT stack frame handling. Far too much work is done at
2138execution time. Similarly for the attribute value templates handling, at
2139least the embedded subexpressions ought to be precompiled.</p>
2140
2141<p>Allow output to be saved to a SAX like output (this notion of SAX like API
2142for output should be added directly to libxml).</p>
2143
2144<p>Implement and test some of the optimization explained by Michael Kay
2145especially:</p>
2146<ul>
2147  <li>static slot allocation on the stack frame</li>
2148  <li>specific boolean interpretation of an XPath expression</li>
2149  <li>some of the sorting optimization</li>
2150  <li>Lazy evaluation of location path. (this may require more changes but
2151    sounds really interesting. XT does this too.)</li>
2152  <li>Optimization of an expression tree (This could be done as a completely
2153    independent module.)</li>
2154</ul>
2155
2156<p></p>
2157
2158<p>Error reporting, there is a lot of case where the XSLT specification
2159specify that a given construct is an error are not checked adequately by
2160libxslt. Basically one should do a complete pass on the XSLT spec again and
2161add all tests to the stylesheet compilation. Using the DTD provided in the
2162appendix and making direct checks using the libxml validation API sounds a
2163good idea too (though one should take care of not raising errors for
2164elements/attributes in different namespaces).</p>
2165
2166<p>Double check all the places where the stylesheet compiled form might be
2167modified at run time (extra removal of blanks nodes, hint on the
2168xsltCompMatch).</p>
2169
2170<h3><a name="Thanks">Thanks:</a></h3>
2171<p>Thanks to <a href="http://cmsmcq.com/">Michael Sperberg-McQueen</a> for
2172   various fixes and clarifications on this document!</p>
2173
2174<p></p>
2175
2176<h2><a name="Extensions">Writing extensions</a></h2>
2177
2178<h3>Table  of content</h3>
2179<ul>
2180  <li><a href="extensions.html#Introducti">Introduction</a></li>
2181  <li><a href="extensions.html#Basics">Basics</a></li>
2182  <li><a href="extensions.html#Keep">Extension modules</a></li>
2183  <li><a href="extensions.html#Registerin">Registering a module</a></li>
2184  <li><a href="extensions.html#module">Loading a module</a></li>
2185  <li><a href="extensions.html#Registerin1">Registering an extension
2186    function</a></li>
2187  <li><a href="extensions.html#Implementi">Implementing an extension
2188    function</a></li>
2189  <li><a href="extensions.html#Examples">Examples for extension
2190  functions</a></li>
2191  <li><a href="extensions.html#Registerin2">Registering an extension
2192    element</a></li>
2193  <li><a href="extensions.html#Implementi1">Implementing an extension
2194    element</a></li>
2195  <li><a href="extensions.html#Example">Example for extension
2196  elements</a></li>
2197  <li><a href="extensions.html#shutdown">The shutdown of a module</a></li>
2198  <li><a href="extensions.html#Future">Future work</a></li>
2199</ul>
2200
2201<h3><a name="Introducti1">Introduction</a></h3>
2202
2203<p>This document describes the work needed to write extensions to the
2204standard XSLT library for use with <a
2205href="http://xmlsoft.org/XSLT/">libxslt</a>, the <a
2206href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the <a
2207href="http://www.gnome.org/">GNOME</a> project.</p>
2208
2209<p>Before starting reading this document it is highly recommended to get
2210familiar with <a href="internals.html">the libxslt internals</a>.</p>
2211
2212<p>Note: this documentation is by definition incomplete and I am not good at
2213spelling, grammar, so patches and suggestions are <a
2214href="mailto:veillard@redhat.com">really welcome</a>.</p>
2215
2216<h3><a name="Basics">Basics</a></h3>
2217
2218<p>The <a href="http://www.w3.org/TR/xslt">XSLT specification</a> provides
2219two <a href="http://www.w3.org/TR/xslt">ways to extend an XSLT engine</a>:</p>
2220<ul>
2221  <li>providing <a href="http://www.w3.org/TR/xslt">new extension
2222    functions</a> which can be called from XPath expressions</li>
2223  <li>providing <a href="http://www.w3.org/TR/xslt">new extension
2224    elements</a> which can be inserted in stylesheets</li>
2225</ul>
2226
2227<p>In both cases the extensions need to be associated to a new namespace,
2228i.e. an URI used as the name for the extension's namespace (there is no need
2229to have a resource there for this to work).</p>
2230
2231<p>libxslt provides a few extensions itself, either in the libxslt namespace
2232"http://xmlsoft.org/XSLT/namespace" or in namespaces for other well known
2233extensions provided by other XSLT processors like Saxon, Xalan or XT.</p>
2234
2235<h3><a name="Keep">Extension modules</a></h3>
2236
2237<p>Since extensions are bound to a namespace name, usually sets of extensions
2238coming from a given source are using the same namespace name defining in
2239practice a group of extensions providing elements, functions or both. From
2240the libxslt point of view those are considered as an "extension module", and
2241most of the APIs work at a module point of view.</p>
2242
2243<p>Registration of new functions or elements are bound to the activation of
2244the module. This is currently done by declaring the namespace as an extension
2245by using the attribute  <code>extension-element-prefixes</code> on the
2246<code><a href="http://www.w3.org/TR/xslt">xsl:stylesheet</a></code>
2247element.</p>
2248
2249<p>An extension module is defined by 3 objects:</p>
2250<ul>
2251  <li>the namespace name associated</li>
2252  <li>an initialization function</li>
2253  <li>a shutdown function</li>
2254</ul>
2255
2256<h3><a name="Registerin">Registering a module</a></h3>
2257
2258<p>Currently a libxslt module has to be compiled within the application using
2259libxslt. There is no code to load dynamically shared libraries associated to
2260a namespace (this may be added but is likely to become a portability
2261nightmare).</p>
2262
2263<p>The current way to register a module is to link the code implementing it
2264with the application and to call a registration function:</p>
2265<pre>int xsltRegisterExtModule(const xmlChar *URI,
2266                          xsltExtInitFunction initFunc,
2267                          xsltExtShutdownFunction shutdownFunc);</pre>
2268
2269<p>The associated header is read by:</p>
2270<pre>#include&lt;libxslt/extensions.h&gt;</pre>
2271
2272<p>which also defines the type for the initialization and shutdown
2273functions</p>
2274
2275<h3><a name="module">Loading a module</a></h3>
2276
2277<p>Once the module URI has been registered and if the XSLT processor detects
2278that a given stylesheet needs the functionalities of an extended module, this
2279one is initialized.</p>
2280
2281<p>The xsltExtInitFunction type defines the interface for an initialization
2282function:</p>
2283<pre>/**
2284 * xsltExtInitFunction:
2285 * @ctxt:  an XSLT transformation context
2286 * @URI:  the namespace URI for the extension
2287 *
2288 * A function called at initialization time of an XSLT
2289 * extension module
2290 *
2291 * Returns a pointer to the module specific data for this
2292 * transformation
2293 */
2294typedef void *(*xsltExtInitFunction)(xsltTransformContextPtr ctxt,
2295                                     const xmlChar *URI);</pre>
2296
2297<p>There are 3 things to notice:</p>
2298<ul>
2299  <li>The function gets passed the namespace name URI as an argument. This
2300    allows a single function to provide the initialization for multiple
2301    logical modules.</li>
2302  <li>It also gets passed a transformation context. The initialization is
2303    done at run time before any processing occurs on the stylesheet but it
2304    will be invoked separately each time for each transformation.</li>
2305  <li>It returns a pointer.  This can be used to store module specific
2306    information which can be retrieved later when a function or an element
2307    from the extension is used.  An obvious example is a connection to a
2308    database which should be kept and reused along with the transformation.
2309    NULL is a perfectly valid return; there is no way to indicate a failure
2310    at this level</li>
2311</ul>
2312
2313<p>What this function is expected to do is:</p>
2314<ul>
2315  <li>prepare the context for this module (like opening the database
2316    connection)</li>
2317  <li>register the extensions specific to this module</li>
2318</ul>
2319
2320<h3><a name="Registerin1">Registering an extension function</a></h3>
2321
2322<p>There is a single call to do this registration:</p>
2323<pre>int xsltRegisterExtFunction(xsltTransformContextPtr ctxt,
2324                            const xmlChar *name,
2325                            const xmlChar *URI,
2326                            xmlXPathEvalFunc function);</pre>
2327
2328<p>The registration is bound to a single transformation instance referred by
2329ctxt, name is the UTF8 encoded name for the NCName of the function, and URI
2330is the namespace name for the extension (no checking is done, a module could
2331register functions or elements from a different namespace, but it is not
2332recommended).</p>
2333
2334<h3><a name="Implementi">Implementing an extension function</a></h3>
2335
2336<p>The implementation of the function must have the signature of a libxml
2337XPath function:</p>
2338<pre>/**
2339 * xmlXPathEvalFunc:
2340 * @ctxt: an XPath parser context
2341 * @nargs: the number of arguments passed to the function
2342 *
2343 * an XPath evaluation function, the parameters are on the
2344 * XPath context stack
2345 */
2346
2347typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
2348                                 int nargs);</pre>
2349
2350<p>The context passed to an XPath function is not an XSLT context but an <a
2351href="internals.html#XPath1">XPath context</a>. However it is possible to
2352find one from the other:</p>
2353<ul>
2354  <li>The function xsltXPathGetTransformContext provides this lookup facility:
2355    <pre>xsltTransformContextPtr
2356         xsltXPathGetTransformContext
2357                          (xmlXPathParserContextPtr ctxt);</pre>
2358  </li>
2359  <li>The <code>xmlXPathContextPtr</code> associated to an
2360    <code>xsltTransformContext</code> is stored in the <code>xpathCtxt</code>
2361    field.</li>
2362</ul>
2363
2364<p>The first thing an extension function may want to do is to check the
2365arguments passed on the stack, the <code>nargs</code> parameter will tell how
2366many of them were provided on the XPath expression. The macro valuePop will
2367extract them from the XPath stack:</p>
2368<pre>#include &lt;libxml/xpath.h&gt;
2369#include &lt;libxml/xpathInternals.h&gt;
2370
2371xmlXPathObjectPtr obj = valuePop(ctxt); </pre>
2372
2373<p>Note that <code>ctxt</code> is the XPath context not the XSLT one. It is
2374then possible to examine the content of the value. Check <a
2375href="internals.html#Descriptio">the description of XPath objects</a> if
2376necessary. The following is a common sequence checking whether the argument
2377passed is a string and converting it using the built-in XPath
2378<code>string()</code> function if this is not the case:</p>
2379<pre>if (obj-&gt;type != XPATH_STRING) {
2380    valuePush(ctxt, obj);
2381    xmlXPathStringFunction(ctxt, 1);
2382    obj = valuePop(ctxt);
2383}</pre>
2384
2385<p>Most common XPath functions are available directly at the C level and are
2386exported either in <code>&lt;libxml/xpath.h&gt;</code> or in
2387<code>&lt;libxml/xpathInternals.h&gt;</code>.</p>
2388
2389<p>The extension function may also need to retrieve the data associated to
2390this module instance (the database connection in the previous example) this
2391can be done using the xsltGetExtData:</p>
2392<pre>void * xsltGetExtData(xsltTransformContextPtr ctxt,
2393                      const xmlChar *URI);</pre>
2394
2395<p>Again the URI to be provided is the one which was used when registering
2396the module.</p>
2397
2398<p>Once the function finishes, don't forget to:</p>
2399<ul>
2400  <li>push the return value on the stack using <code>valuePush(ctxt,
2401    obj)</code></li>
2402  <li>deallocate the parameters passed to the function using
2403    <code>xmlXPathFreeObject(obj)</code></li>
2404</ul>
2405
2406<h3><a name="Examples">Examples for extension functions</a></h3>
2407
2408<p>The module libxslt/functions.c contains the sources of the XSLT built-in
2409functions, including document(), key(), generate-id(), etc. as well as a full
2410example module at the end. Here is the test function implementation for the
2411libxslt:test function:</p>
2412<pre>/**
2413 * xsltExtFunctionTest:
2414 * @ctxt:  the XPath Parser context
2415 * @nargs:  the number of arguments
2416 *
2417 * function libxslt:test() for testing the extensions support.
2418 */
2419static void
2420xsltExtFunctionTest(xmlXPathParserContextPtr ctxt, int nargs)
2421{
2422    xsltTransformContextPtr tctxt;
2423    void *data;
2424
2425    tctxt = xsltXPathGetTransformContext(ctxt);
2426    if (tctxt == NULL) {
2427        xsltGenericError(xsltGenericErrorContext,
2428            "xsltExtFunctionTest: failed to get the transformation context\n");
2429        return;
2430    }
2431    data = xsltGetExtData(tctxt, (const xmlChar *) XSLT_DEFAULT_URL);
2432    if (data == NULL) {
2433        xsltGenericError(xsltGenericErrorContext,
2434            "xsltExtFunctionTest: failed to get module data\n");
2435        return;
2436    }
2437#ifdef WITH_XSLT_DEBUG_FUNCTION
2438    xsltGenericDebug(xsltGenericDebugContext,
2439                     "libxslt:test() called with %d args\n", nargs);
2440#endif
2441}</pre>
2442
2443<h3><a name="Registerin2">Registering an extension element</a></h3>
2444
2445<p>There is a single call to do this registration:</p>
2446<pre>int xsltRegisterExtElement(xsltTransformContextPtr ctxt,
2447                           const xmlChar *name,
2448                           const xmlChar *URI,
2449                           xsltTransformFunction function);</pre>
2450
2451<p>It is similar to the mechanism used to register an extension function,
2452except that the signature of an extension element implementation is
2453different.</p>
2454
2455<p>The registration is bound to a single transformation instance referred to
2456by ctxt, name is the UTF8 encoded name for the NCName of the element, and URI
2457is the namespace name for the extension (no checking is done, a module could
2458register elements for a different namespace, but it is not recommended).</p>
2459
2460<h3><a name="Implementi1">Implementing an extension element</a></h3>
2461
2462<p>The implementation of the element must have the signature of an XSLT
2463transformation function:</p>
2464<pre>/** 
2465 * xsltTransformFunction: 
2466 * @ctxt: the XSLT transformation context
2467 * @node: the input node
2468 * @inst: the stylesheet node 
2469 * @comp: the compiled information from the stylesheet 
2470 * 
2471 * signature of the function associated to elements part of the
2472 * stylesheet language like xsl:if or xsl:apply-templates.
2473 */ 
2474typedef void (*xsltTransformFunction)
2475                          (xsltTransformContextPtr ctxt,
2476                           xmlNodePtr node,
2477                           xmlNodePtr inst,
2478                           xsltStylePreCompPtr comp);</pre>
2479
2480<p>The first argument is the XSLT transformation context. The second and
2481third arguments are xmlNodePtr i.e. internal memory <a
2482href="internals.html#libxml">representation of  XML nodes</a>. They are
2483respectively <code>node</code> from the the input document being transformed
2484by the stylesheet and <code>inst</code> the extension element in the
2485stylesheet. The last argument is <code>comp</code> a pointer to a precompiled
2486representation of <code>inst</code> but usually for an extension function
2487this value is <code>NULL</code> by default (it could be added and associated
2488to the instruction in <code>inst-&gt;_private</code>).</p>
2489
2490<p>The same functions are available from a function implementing an extension
2491element as in an extension function, including
2492<code>xsltGetExtData()</code>.</p>
2493
2494<p>The goal of an extension element being usually to enrich the generated
2495output, it is expected that they will grow the currently generated output
2496tree. This can be done by grabbing ctxt-&gt;insert which is the current
2497libxml node being generated (Note this can also be the intermediate value
2498tree being built for example to initialize a variable, the processing should
2499be similar). The functions for libxml tree manipulation from <a
2500href="http://xmlsoft.org/html/libxml-tree.html">&lt;libxml/tree.h&gt;</a> can
2501be employed to extend or modify the tree, but it is required to preserve the
2502insertion node and its ancestors since there are existing pointers to those
2503elements still in use in the XSLT template execution stack.</p>
2504
2505<h3><a name="Example">Example for extension elements</a></h3>
2506
2507<p>The module libxslt/transform.c contains the sources of the XSLT built-in
2508elements, including xsl:element, xsl:attribute, xsl:if, etc. There is a small
2509but full example in functions.c providing the implementation for the
2510libxslt:test element, it will output a comment in the result tree:</p>
2511<pre>/**
2512 * xsltExtElementTest:
2513 * @ctxt:  an XSLT processing context
2514 * @node:  The current node
2515 * @inst:  the instruction in the stylesheet
2516 * @comp:  precomputed information
2517 *
2518 * Process a libxslt:test node
2519 */
2520static void
2521xsltExtElementTest(xsltTransformContextPtr ctxt, xmlNodePtr node,
2522                   xmlNodePtr inst,
2523                   xsltStylePreCompPtr comp)
2524{
2525    xmlNodePtr comment;
2526
2527    if (ctxt == NULL) {
2528        xsltGenericError(xsltGenericErrorContext,
2529                         "xsltExtElementTest: no transformation context\n");
2530        return;
2531    }
2532    if (node == NULL) {
2533        xsltGenericError(xsltGenericErrorContext,
2534                         "xsltExtElementTest: no current node\n");
2535        return;
2536    }
2537    if (inst == NULL) {
2538        xsltGenericError(xsltGenericErrorContext,
2539                         "xsltExtElementTest: no instruction\n");
2540        return;
2541    }
2542    if (ctxt-&gt;insert == NULL) {
2543        xsltGenericError(xsltGenericErrorContext,
2544                         "xsltExtElementTest: no insertion point\n");
2545        return;
2546    }
2547    comment =
2548        xmlNewComment((const xmlChar *)
2549                      "libxslt:test element test worked");
2550    xmlAddChild(ctxt-&gt;insert, comment);
2551}</pre>
2552
2553<h3><a name="shutdown">The shutdown of a module</a></h3>
2554
2555<p>When the XSLT processor ends a transformation, the shutdown function (if
2556it exists) for each of the modules initialized is called.  The
2557xsltExtShutdownFunction type defines the interface for a shutdown
2558function:</p>
2559<pre>/**
2560 * xsltExtShutdownFunction:
2561 * @ctxt:  an XSLT transformation context
2562 * @URI:  the namespace URI for the extension
2563 * @data:  the data associated to this module
2564 *
2565 * A function called at shutdown time of an XSLT extension module
2566 */
2567typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
2568                                         const xmlChar *URI,
2569                                         void *data);</pre>
2570
2571<p>This is really similar to a module initialization function except a third
2572argument is passed, it's the value that was returned by the initialization
2573function. This allows the routine to deallocate resources from the module for
2574example close the connection to the database to keep the same example.</p>
2575
2576<h3><a name="Future">Future work</a></h3>
2577
2578<p>Well, some of the pieces missing:</p>
2579<ul>
2580  <li>a way to load shared libraries to instantiate new modules</li>
2581  <li>a better detection of extension functions usage and their registration
2582    without having to use the extension prefix which ought to be reserved to
2583    element extensions.</li>
2584  <li>more examples</li>
2585  <li>implementations of the <a href="http://www.exslt.org/">EXSLT</a> common
2586    extension libraries, Thomas Broyer nearly finished implementing them.</li>
2587</ul>
2588
2589<p></p>
2590
2591<h2><a name="Contributi">Contributions</a></h2>
2592<ul>
2593  <li>Bjorn Reese is the author of the number support and worked on the
2594    XSLTMark support</li>
2595  <li>William Brack was an early adopted, contributed a number of patches and
2596    spent quite some time debugging non-trivial problems in early versions of
2597    libxslt</li>
2598  <li><a href="mailto:igor@zlatkovic.com">Igor  Zlatkovic</a> is now the
2599    maintainer of the Windows port, <a
2600    href="http://www.zlatkovic.com/projects/libxml/index.html">he provides
2601    binaries</a></li>
2602  <li>Thomas Broyer provided a lot of suggestions, and drafted most of the
2603    extension API</li>
2604  <li>John Fleck maintains <a href="tutorial/libxslttutorial.html">a tutorial
2605    for libxslt</a></li>
2606  <li><a
2607    href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
2608    Sergeant</a> developed <a
2609    href="http://axkit.org/download/">XML::LibXSLT</a>, a perl wrapper for
2610    libxml2/libxslt as part of the <a href="http://axkit.com/">AxKit XML
2611    application server</a></li>
2612  <li>there is a module for <a
2613    href="http://acs-misc.sourceforge.net/nsxml.html">libxml/libxslt support
2614    in OpenNSD/AOLServer</a></li>
2615  <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provides
2616    libxml/libxslt <a href="http://www.rexx.com/~dkuhlman">wrappers for
2617    Python</a></li>
2618  <li><a href="mailto:Steve.Ball@explain.com.au">Steve Ball</a>, and
2619    contributors maintain <a href="http://tclxml.sourceforge.net/">tcl
2620    bindings for libxml2 and libxslt</a>, as well as <a
2621    href="http://tclxml.sf.net/tkxmllint.html">tkxmllint</a> a GUI for
2622    xmllint and <a href="http://tclxml.sf.net/tkxsltproc.html">tkxsltproc</a>
2623    a GUI for xsltproc.</li>
2624  <li>If you want to use libxslt in a Mac OS X/Cocoa or Objective-C
2625    framework, Marc Liyanage provides <a
2626    href="http://www.entropy.ch/software/macosx/#testxslt">an application
2627    TestXSLT for XSLT and XML editing</a> including wrapper classes for the
2628    XML parser and XSLT processor.</li>
2629</ul>
2630
2631<p></p>
2632
2633<p><a href="mailto:daniel@veillard.com">Daniel Veillard</a></p>
2634</body>
2635</html>
2636