1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>The XSLT C library for Gnome</title>
6 <meta name="GENERATOR" content="amaya 5.1">
7 <meta http-equiv="Content-Type" content="text/html">
10 <body bgcolor="#ffffff">
11 <h1 align="center">The XSLT C library for Gnome</h1>
13 <h1 style="text-align: center">libxslt</h1>
15 <p>Libxslt is the <a href="http://www.w3.org/TR/xslt">XSLT</a> C library
16 developed for the Gnome project. XSLT itself is a an XML language to define
17 transformation for XML. Libxslt is based on <a
18 href="http://xmlsoft.org/">libxml2</a> the XML C library developed for the
19 Gnome project. It also implements most of the EXSLT set of extensions
20 functions and some of Saxon's evaluate and expressions extensions.</p>
22 <p>People can either embed the library in their application or use xsltproc
23 the command line processing tool. This library is free software and can be
24 reused in commercial applications (see the <a href="intro.html">intro</a>)</p>
26 <p>External documents:</p>
28 <li>John Fleck wrote <a href="tutorial/libxslttutorial.html">a tutorial for
30 <li><a href="xsltproc.html">xsltproc user manual</a></li>
31 <li><a href="http://xmlsoft.org/">the libxml documentation</a></li>
36 <h2><a name="Introducti">Introduction</a></h2>
38 <p>This document describes <a href="http://xmlsoft.org/XSLT/">libxslt</a>,
39 the <a href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the
40 <a href="http://www.gnome.org/">Gnome</a> project.</p>
42 <p>Here are some key points about libxslt:</p>
44 <li>Libxslt is a C implementation</li>
45 <li>Libxslt is based on libxml for XML parsing, tree manipulation and XPath
47 <li>It is written in plain C, making as few assumptions as possible, and
48 sticking closely to ANSI C/POSIX for easy embedding. Should works on
49 Linux/Unix/Windows.</li>
50 <li>This library is released under the <a
51 href="http://www.opensource.org/licenses/mit-license.html">MIT
53 <li>Though not designed primarily with performances in mind, libxslt seems
54 to be a relatively fast processor.</li>
57 <h2><a name="Documentat">Documentation</a></h2>
59 <p>There are some on-line resources about using libxslt:</p>
61 <li>Check the <a href="html/libxslt-lib.html#LIBXSLT-LIB">API
62 documentation</a> automatically extracted from code comments (using <a
63 href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gtk-doc">gtk
65 <li>Look at the <a href="http://mail.gnome.org/archives/xslt/">mailing-list
67 <li>Of course since libxslt is based on libxml, it's a good idea to at
68 least read <a href="http://xmlsoft.org/">libxml description</a></li>
71 <h2><a name="Reporting">Reporting bugs and getting help</a></h2>
73 <p>If you need help with the XSLT language itself, here are a number of
76 <li>I strongly suggest to subscribe to <a
77 href="http://www.mulberrytech.com/xsl/xsl-list">XSL-list</a>, check <a
78 href="http://www.biglist.com/lists/xsl-list/archives/">the XSL-list
80 <li>The <a href="http://www.dpawson.co.uk/xsl/xslfaq.html">XSL FAQ</a>.</li>
82 href="http://www.nwalsh.com/docs/tutorials/xsl/xsl/slides.html">tutorial</a>
83 written by Paul Grosso and Norman Walsh is a very good on-line
84 introdution to the language.</li>
86 href="http://www.zvon.org/xxl/XSLTutorial/Books/Book1/index.html">only
87 Zvon XSLT tutorial</a> details a lot of constructs with examples.</li>
88 <li><a href="http://www.jenitennison.com/xslt/index.html">Jeni Tennison's
89 XSLT</a> pages provide links to a lot of answers</li>
90 <li>the <a href="http://incrementaldevelopment.com/xsltrick/">Gallery of
91 XSLT Tricks</a> provides non-standard use case of XSLT</li>
92 <li>And I suggest to buy Michael Kay "XSLT Programmer's Reference" book
93 published by <a href="http://www.wrox.com/">Wrox</a> if you plan to work
94 seriously with XSLT in the future.</li>
97 <p>Well, bugs or missing features are always possible, and I will make a
98 point of fixing them in a timely fashion. The best way to report a bug is to
99 use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Gnome
100 bug tracking database</a> (make sure to use the "libxslt" module name). I
101 look at reports there regularly and it's good to have a reminder when a bug
102 is still open. Be sure to specify that the bug is for the package libxslt.</p>
104 <p>There is also a mailing-list <a
105 href="mailto:xslt@gnome.org">xslt@gnome.org</a> for libxslt, with an <a
106 href="http://mail.gnome.org/archives/xslt/">on-line archive</a>. To subscribe
107 to this list, please visit the <a
108 href="http://mail.gnome.org/mailman/listinfo/xslt">associated Web</a> page
109 and follow the instructions.</p>
111 <p>Alternatively, you can just send the bug to the <a
112 href="mailto:xslt@gnome.org">xslt@gnome.org</a> list, if it's really libxslt
113 related I will approve it.. Please do not send me mail directly especially
114 for portability problem, it makes things really harder to track and in some
115 cases I'm not the best person to answer a given question, ask the list
116 instead. <strong>Do not send code, I won't debug it</strong> (but patches are
117 really appreciated!).</p>
119 <p>Check the following too before posting:</p>
121 <li>make sure you are <a href="ftp://xmlsoft.org/">using a recent
122 version</a>, and that the problem still shows up in those</li>
123 <li>check the <a href="http://mail.gnome.org/archives/xslt/">list
124 archives</a> to see if the problem was reported already, in this case
125 there is probably a fix available, similarly check the <a
126 href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">registered
128 <li>make sure you can reproduce the bug with xsltproc, a very useful thing
129 to do is run the transformation with -v argument and redirect the
130 standard error to a file, then search in this file for the transformation
131 logs just preceding the possible problem</li>
132 <li>Please send the command showing the error as well as the input and
133 stylesheet (as an attachment)</li>
136 <p>Of course, bugs reports with a suggested patch for fixing them will
137 probably be processed faster.</p>
139 <p>If you're looking for help, a quick look at <a
140 href="http://mail.gnome.org/archives/xslt/">the list archive</a> may actually
141 provide the answer, I usually send source samples when answering libxslt
142 usage questions. The <a
143 href="html/libxslt-lib.html#LIBXSLT-LIB">auto-generated documentation</a> is
144 not as polished as I would like (I need to learn more about Docbook), but
145 it's a good starting point.</p>
147 <h2><a name="help">How to help</a></h2>
149 <p>You can help the project in various ways, the best thing to do first is to
150 subscribe to the mailing-list as explained before, check the <a
151 href="http://mail.gnome.org/archives/xslt/">archives </a>and the <a
152 href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Gnome bug
155 <li>provide patches when you find problems</li>
156 <li>provide the diffs when you port libxslt to a new platform. They may not
157 be integrated in all cases but help pinpointing portability problems
159 <li>provide documentation fixes (either as patches to the code comments or
161 <li>provide new documentations pieces (translations, examples, etc ...)</li>
162 <li>Check the TODO file and try to close one of the items</li>
163 <li>take one of the points raised in the archive or the bug database and
164 provide a fix. <a href="mailto:daniel@veillard.com">Get in touch with me
165 </a>before to avoid synchronization problems and check that the suggested
166 fix will fit in nicely :-)</li>
169 <h2><a name="Downloads">Downloads</a></h2>
171 <p>The latest versions of libxslt can be found on <a
172 href="ftp://xmlsoft.org/">xmlsoft.org</a> (<a
173 href="ftp://speakeasy.rpmfind.net/pub/libxml/">Seattle</a>, <a
174 href="ftp://fr.rpmfind.net/pub/libxml/">France</a>) or on the <a
175 href="ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html">Gnome FTP server</a> either
176 as a <a href="ftp://ftp.gnome.org/pub/GNOME/stable/sources/libxslt/">source
178 href="ftp://ftp.gnome.org/pub/GNOME/contrib/redhat/SRPMS/">RPM packages</a>.
179 (NOTE that you need the <a
180 href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a>, <a
181 href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>, <a
182 href="http://rpmfind.net/linux/RPM/libxslt.html">libxslt</a> and <a
183 href="http://rpmfind.net/linux/RPM/libxslt-devel.html">libxslt-devel</a>
184 packages installed to compile applications using libxslt.) <a
185 href="mailto:izlatkovic@daenet.de">Igor Zlatkovic</a> is now the maintainer
186 of the Windows port, <a
187 href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he
188 provides binaries</a>. <a href="mailto:Gary.Pennington@sun.com">Gary
189 Pennington</a> provides <a href="http://garypennington.net/libxml2/">Solaris
192 <p><a name="Contribs">Contribs:</a></p>
194 <p>I do accept external contributions, especially if compiling on another
195 platform, get in touch with me to upload the package. I will keep them in the
196 <a href="ftp://xmlsoft.org/contribs/">contrib directory</a></p>
198 <p>Libxslt is also available from CVS:</p>
201 href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=libxslt">Gnome
202 CVS base</a>. Check the <a
203 href="http://developer.gnome.org/tools/cvs.html">Gnome CVS Tools</a>
204 page; the CVS module is <b>libxslt</b>.</p>
207 href="ftp://xmlsoft.org/XSLT/cvs-snapshot.tar.gzftp://xmlsoft.org/XSLT/cvs-snapshot.tar.gzftp://xmlsoft.org/XSLT/cvs-snapshot.tar.gz">daily
208 snapshots from CVS</a> are also provided</li>
211 <h2><a name="FAQ">FAQ</a></h2>
213 <li><em>passing parameters on the xsltproc command line doesn't work</em>
214 <p><em>xsltproc --param test alpha foo.xsl foo.xml</em></p>
215 <p><em>the param does not get passed and ends up as ""</em></p>
216 <p>In a nutshell do a double escaping at the shell prompt:</p>
217 <p>xsltproc --param test "'alpha'" foo.xsl foo.xml</p>
218 <p>i.e. the string value is surrounded by " and ' then terminated by '
219 and ". Libxslt interpret the parameter values as XPath expressions, so
220 the string -><code>alpha</code><- is intepreted as the node set
221 matching this string. You really want -><code>'alpha'</code><- to
222 be passed to the processor. And to allow this you need to escape the
223 quotes at the shell level using -><code>"'alpha'"</code><- .</p>
225 <p>xsltproc --stringparam test alpha foo.xsl foo.xml</p>
229 <h2><a name="News">News</a></h2>
231 <h3>CVS only : check the <a
232 href="http://cvs.gnome.org/lxr/source/libxslt/ChangeLog">Changelog</a> file
233 for a really accurate description</h3>
235 <h3>1.0.13: Mar 8 2002</h3>
237 <li>a number of bug fixes including "namespace node have no parents"</li>
238 <li>Improvement of the Python bindings</li>
239 <li>Charles Bozeman provided fixes and regression tests for exslt date
243 <h3>1.0.12: Feb 11 2002</h3>
245 <li>Fixed the makefiles especially the python module ones</li>
246 <li>half a dozen bugs fixes including 2 old ones</li>
249 <h3>1.0.11: Feb 8 2002</h3>
251 <li>Change of Licence to the <a
252 href="http://www.opensource.org/licenses/mit-license.html">MIT
254 <li>Added a beta version of the Python bindings, including support to
255 extend the engine with functions written in Python</li>
256 <li>A number of bug fixes</li>
257 <li>Charlie Bozeman provided more EXSLT functions</li>
258 <li>Portability fixes</li>
261 <h3>1.0.10: Jan 14 2002</h3>
263 <li>Windows fixes for Win32 from Igor</li>
264 <li>Fixed the Solaris compilation trouble (Albert)</li>
265 <li>Documentation changes and updates: John Fleck</li>
266 <li>Added a stringparam option to avoid escaping hell at the shell
268 <li>A few bug fixes</li>
271 <h3>1.0.9: Dec 7 2001</h3>
273 <li>Makefile patches from Peter Williams</li>
274 <li>attempt to fix the compilation problem associated to prelinking</li>
275 <li>obsoleted libxsltbreakpoint now deprecated and frozen to 1.0.8 API</li>
276 <li>xsltproc return codes are now significant, John Fleck updated the
278 <li>patch to allow as much as 40 steps in patterns (Marc Tardif), should be
279 made dynamic really</li>
280 <li>fixed a bug raised by Nik Clayton when using doctypes with HTML
282 <li>patches from Keith Isdale to interface with xsltdebugger</li>
285 <h3>1.0.8: Nov 26 2001</h3>
287 <li>fixed an annoying header problem, removed a few bugs and some code
289 <li>patches for Windows and update of Windows Makefiles by Igor</li>
290 <li>OpenVMS port instructions from John A Fotheringham</li>
291 <li>fixed some Makefiles annoyance and libraries prelinking
295 <h3>1.0.7: Nov 10 2001</h3>
297 <li>remove a compilation problem with LIBXSLT_PUBLIC</li>
298 <li>Finishing the integration steps for Keith Isdale debugger</li>
299 <li>fixes the handling of indent="no" on HTML output</li>
300 <li>fixes on the configure script and RPM spec file</li>
303 <h3>1.0.6: Oct 30 2001</h3>
305 <li>bug fixes on number formatting (Thomas), date/time functions (Bruce
307 <li>update of the Windows Makefiles (Igor)</li>
308 <li>fixed DOCTYPE generation rules for HTML output (me)</li>
311 <h3>1.0.5: Oct 10 2001</h3>
313 <li>some portability fixes, including Windows makefile updates from
315 <li>fixed a dozen bugs on XSLT and EXSLT (me and Thomas Broyer)</li>
316 <li>support for Saxon's evaluate and expressions extensions added (initial
317 contribution from Darren Graves)</li>
318 <li>better handling of XPath evaluation errors</li>
321 <h3>1.0.4: Sep 12 2001</h3>
323 <li>Documentation updates from John fleck</li>
324 <li>bug fixes (DocBook FO generation should be fixed) and portability
326 <li>Thomas Broyer improved the existing EXSLT support and added String,
327 Time and Date core functions support</li>
330 <h3>1.0.3: Aug 23 2001</h3>
332 <li>XML Catalog support see the doc</li>
333 <li>New NaN/Infinity floating point code</li>
334 <li>A few bug fixes</li>
337 <h3>1.0.2: Aug 15 2001</h3>
339 <li>lot of bug fixes, increased the testsuite</li>
340 <li>a large chunk of EXSLT is implemented</li>
341 <li>improvements on the extension framework</li>
342 <li>documentation improvements</li>
343 <li>Windows MSC projects files should be up-to-date</li>
344 <li>handle attributes inherited from the DTD by default</li>
347 <h3>1.0.1: July 24 2001</h3>
349 <li>initial EXSLT framework</li>
350 <li>better error reporting</li>
351 <li>fixed the profiler on Windows</li>
355 <h3>1.0.0: July 10 2001</h3>
357 <li>a lot of cleanup, a lot of regression tests added or fixed</li>
358 <li>added a documentation for <a href="extensions.html">writing
360 <li>fixed some variable evaluation problems (with William)</li>
361 <li>added profiling of stylesheet execution accessible as the xsltproc
362 --profile option</li>
363 <li>fixed element-available() and the implementation of the various
364 chunking methods present, Norm Walsh provided a lot of feedback</li>
365 <li>exclude-result-prefixes and namespaces output should now work as
367 <li>added support of embedded stylesheet as described in section 2.7 of the
371 <h3>0.14.0: July 5 2001</h3>
373 <li>lot of bug fixes, and code cleanup</li>
374 <li>completion of the little XSLT-1.0 features left unimplemented</li>
375 <li>Added and implemented the extension API suggested by Thomas Broyer</li>
376 <li>the Windows MSC environment should be complete</li>
377 <li>tested and optimized with a really large document (DocBook Definitive
378 Guide) libxml/libxslt should really be faster on serious workloads</li>
381 <h3>0.13.0: June 26 2001</h3>
383 <li>lots of cleanups</li>
384 <li>fixed a C++ compilation problem</li>
385 <li>couple of fixes to xsltSaveTo()</li>
386 <li>try to fix Docbook-xslt-1.4 and chunking, updated the regression test
388 <li>fixed pattern compilation and priorities problems</li>
389 <li>Patches for Windows and MSC project mostly contributed by Yon Derek</li>
390 <li>update to the Tutorial by John Fleck</li>
391 <li>William fixed bugs in templates and for-each functions</li>
392 <li>added a new interface xsltRunStylesheet() for a more flexible output
393 (incomplete), added -o option to xsltproc</li>
396 <h3>0.12.0: June 18 2001</h3>
398 <li>fixed a dozen of bugs reported</li>
399 <li>HTML generation should be quite better (requires libxml-2.3.11 upgrade
401 <li>William fixed some problems with document()</li>
402 <li>Fix namespace nodes selection and copy (requires libxml-2.3.11 upgrade
404 <li>John Fleck added a<a href="tutorial/libxslttutorial.html">
406 <li>Fixes for namespace handling when evaluating variables</li>
407 <li>XInclude global flag added to process XInclude on document() if
409 <li>made xsltproc --version more detailed</li>
412 <h3>0.11.0: June 1 2001</h3>
414 <p>Mostly a bug fix release.</p>
416 <li>integration of catalogs from xsltproc</li>
417 <li>added --version to xsltproc for bug reporting</li>
418 <li>fixed errors when handling ID in external parsed entities</li>
419 <li>document() should hopefully work correctly but ...</li>
420 <li>fixed bug with PI and comments processing</li>
421 <li>William fixed the XPath string functions when using unicode</li>
424 <h3>0.10.0: May 19 2001</h3>
426 <li>cleanups to make stylesheet read-only (not 100% complete)</li>
427 <li>fixed URI resolution in document()</li>
428 <li>force all XPath expression to be compiled at stylesheet parsing time,
429 even if unused ...</li>
430 <li>Fixed HTML default output detection</li>
431 <li>Fixed double attribute generation #54446</li>
432 <li>Fixed {{ handling in attributes #54451</li>
433 <li>More tests and speedups for DocBook document transformations</li>
434 <li>Fixed a really bad race like bug in xsltCopyTreeList()</li>
435 <li>added a documentation on the libxslt internals</li>
436 <li>William Brack and Bjorn Reese improved format-number()</li>
437 <li>Fixed multiple sort, it should really work now</li>
438 <li>added a --docbook option for SGML DocBook input (hackish)</li>
439 <li>a number of other bug fixes and regression test added as people were
443 <h3>0.9.0: May 3 2001</h3>
445 <li>lot of various bugfixes, extended the regression suite</li>
446 <li>xsltproc should work with multiple params</li>
447 <li>added an option to use xsltproc with HTML input</li>
448 <li>improved the stylesheet compilation, processing of complex stylesheets
449 should be faster</li>
450 <li>using the same stylesheet for concurrent processing on multithreaded
451 programs should work now</li>
452 <li>fixed another batch of namespace handling problems</li>
453 <li>Implemented multiple level of sorting</li>
456 <h3>0.8.0: Apr 22 2001</h3>
458 <li>fixed ansidecl.h problem</li>
459 <li>fixed unparsed-entity-uri() and generate-id()</li>
460 <li>sort semantic fixes and priority prob from William M. Brack</li>
461 <li>fixed namespace handling problems in XPath expression computations
462 (requires libxml-2.3.7)</li>
463 <li>fixes to current() and key()</li>
464 <li>other, smaller fixes, lots of testing with N Walsh DocBook HTML
468 <h3>0.7.0: Apr 10 2001</h3>
470 <li>cleanup using stricter compiler flags</li>
471 <li>command line parameter passing</li>
472 <li>fix to xsltApplyTemplates from William M. Brack</li>
473 <li>added the XSLTMark in the regression tests as well as document()</li>
476 <h3>0.6.0: Mar 22 2001</h3>
478 <li>another beta</li>
479 <li>requires 2.3.5, which provide XPath expression compilation support</li>
480 <li>document() extension should function properly</li>
481 <li>fixed a number or reported bugs</li>
484 <h3>0.5.0: Mar 10 2001</h3>
487 <li>some optimization work, for the moment 2 XSLT transform cannot use the
488 same stylesheet at the same time (to be fixed)</li>
489 <li>fixed problems with handling of tree results</li>
490 <li>fixed a reported strip-spaces problem</li>
491 <li>added more reported/fixed bugs to the test suite</li>
492 <li>incorporated William M. Brack fix for imports and global variables as
493 well as patch for with-param support in apply-templates</li>
494 <li>a bug fix on for-each</li>
497 <h3>0.4.0: Mar 1 2001</h3>
499 <li>fourth beta test, released at the same time of libxml2-2.3.3</li>
501 <li>some optimization</li>
502 <li>started implement extension support, not finished</li>
503 <li>implemented but not tested multiple file output</li>
506 <h3>0.3.0: Feb 24 2001</h3>
508 <li>third beta test, released at the same time of libxml2-2.3.2</li>
509 <li>lot of bug fixes</li>
510 <li>some optimization</li>
511 <li>added DocBook XSL based testsuite</li>
514 <h3>0.2.0: Feb 15 2001</h3>
516 <li>second beta version, released at the same time as libxml2-2.3.1</li>
517 <li>getting close to feature completion, lot of bug fixes, some in the HTML
518 and XPath support of libxml</li>
519 <li>start becoming usable for real work. This version can now regenerate
520 the XML 2e HTML from the original XML sources and the associated
522 href="http://www.w3.org/TR/REC-xml#b4d250b6c21">section I of the XML
524 <li>Still misses extension element/function/prefixes support. Support of
525 key() and document() is not complete</li>
528 <h3>0.1.0: Feb 8 2001</h3>
530 <li>first beta version, released at the same time as libxml2-2.3.0</li>
531 <li>lots of bug fixes, first "testing" version, but incomplete</li>
534 <h3>0.0.1: Jan 25 2001</h3>
536 <li>first alpha version released at the same time as libxml2-2.2.12</li>
537 <li>Framework in place, should work on simple examples, but far from being
538 feature complete</li>
541 <h2><a name="xsltproc">The xsltproc tool</a></h2>
543 <p>This program is the simplest way to use libxslt: from the command line. It
544 is also used for doing the regression tests of the library.</p>
546 <p>It takes as first argument the path or URL to an XSLT stylesheet, the next
547 arguments are filenames or URIs of the inputs to be processed. The output of
548 the processing is redirected on the standard output. There is actually a few
549 more options available:</p>
550 <pre>orchis:~ -> xsltproc
551 Usage: xsltproc [options] stylesheet file [file ...]
553 --version or -V: show the version of libxml and libxslt used
554 --verbose or -v: show logs of what's happening
555 --output file or -o file: save to a given file
556 --timing: display the time used
557 --repeat: run the transformation 20 times
558 --debug: dump the tree of the result instead
559 --novalid: skip the Dtd loading phase
560 --noout: do not dump the result
561 --maxdepth val : increase the maximum depth
562 --html: the input document is(are) an HTML file(s)
563 --docbook: the input document is SGML docbook
564 --param name value : pass a (parameter,value) pair
565 --nonet refuse to fetch DTDs or entities over network
566 --warnnet warn against fetching over the network
567 --catalogs : use the catalogs from $SGML_CATALOG_FILES
568 --xinclude : do XInclude processing on document intput
569 --profile or --norman : dump profiling informations
572 <h2><a name="DocBook">DocBook</a></h2>
574 <p><a href="http://www.oasis-open.org/committees/docbook/">DocBook</a> is an
575 XML/SGML vocabulary particularly well suited to books and papers about
576 computer hardware and software.</p>
578 <p>xsltproc and libxslt are not specifically dependant on DocBook, but since
579 a lot of people use xsltproc and libxml2 for DocBook formatting, here are a
580 few pointers and informations which may be helpful:</p>
582 <li>The <a href="http://www.oasis-open.org/committees/docbook/">DocBook
583 homepage at Oasis</a> you should find pointers there on all the lastest
584 versions of the DTDs and XSLT stylesheets</li>
585 <li><a href="http://www.docbook.org/">DocBook: The Definitive Guide</a> is
586 the official reference documentation for DocBook.</li>
587 <li>Here is a <a href="/buildDocBookCatalog">shell script</a> to generate
588 XML Catalogs for DocBook 4.1.2 . If it can write to the /etc/xml/
589 directory, it will set-up /etc/xml/catalog and /etc/xml/docbook based on
590 the resources found on the system. Otherwise it will just create
591 ~/xmlcatalog and ~/dbkxmlcatalog and doing:
592 <p><code>export XMLCATALOG=$HOME/xmlcatalog</code></p>
593 <p>should allow to process DocBook documentations without requiring
594 network accesses for the DTd or stylesheets</p>
596 <li>I have uploaded <a href="ftp://xmlsoft.org/test/dbk412catalog.tar.gz">a
597 small tarball</a> containing XML Catalogs for DocBook 4.1.2 which seems
598 to work fine for me too</li>
599 <li>Informations on installing a <a
600 href="http://ourworld.compuserve.com/homepages/hoenicka_markus/cygc2057.html">Windows
601 DocBook processing setup</a> based on Cygwin (using the binaries from the
602 official Windows port should be possible too)</li>
603 <li>Alexander Kirillov's page on <a
604 href="http://www.math.sunysb.edu/~kirillov/dbxml/">Using DocBook XML
605 4.1.2</a> (RPM packages)</li>
606 <li>Tim Waugh's <a href="http://cyberelk.net/tim/xmlto/">xmlto front-end
607 conversion script</a></li>
608 <li>Linux Documentation Project <a
609 href="http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/">
610 DocBook-Install-mini-HOWTO</a></li>
611 <li>ScrollKeeper the open documentation cataloging project has a <a
612 href="http://scrollkeeper.sourceforge.net/docbook.shtml">DocBook
616 <p>Do not use the --docbook option of xsltproc to process XML DocBook
617 documents, this option is only intended to provide some (limited) support of
618 the SGML version of DocBook.</p>
620 <p>Points which are not DocBook specific but still worth mentionning
623 <li>if you think DocBook processing time is too slow, make sure you have
624 XML Catalogs pointing to a local installation of the DTD of DocBook.
625 Check the <a href="http://xmlsoft.org/catalog.html">XML Catalog page</a>
626 to understand more on this subject.</li>
627 <li>before processing a new document, use the command
628 <p><code>xmllint --valid --noout path_to_document</code></p>
629 <p>to make sure that your input is valid DocBook. And fixes the errors
630 before processing further. Note that XSLT processing may work correctly
631 with some forms of validity errors left, but in general it can give
632 troubles on output.</p>
636 <h2><a name="API">The programming API</a></h2>
638 <p>Okay this section is clearly incomplete. But integrating libxslt into your
639 application should be relatively easy. First check the few steps described
640 below, then for more detailed informations, look at the<a
641 href="html/libxslt-lib.html"> generated pages</a> for the API and the source
642 of libxslt/xsltproc.c and the <a
643 href="tutorial/libxslttutorial.html">tutorial</a>.</p>
645 <p>Basically doing an XSLT transformation can be done in a few steps:</p>
647 <li>configure the parser for XSLT:
648 <p>xmlSubstituteEntitiesDefault(1);</p>
649 <p>xmlLoadExtDtdDefaultValue = 1;</p>
651 <li>parse the stylesheet with xsltParseStylesheetFile()</li>
652 <li>parse the document with xmlParseFile()</li>
653 <li>apply the stylesheet using xsltApplyStylesheet()</li>
654 <li>save the result using xsltSaveResultToFile() if needed set
655 xmlIndentTreeOutput to 1</li>
658 <p>Steps 2,3, and 5 will probably need to be changed depending on you
659 processing needs and environment for example if reading/saving from/to
660 memory, or if you want to apply XInclude processing to the stylesheet or
663 <h2><a name="Python">Python and bindings</a></h2>
665 <p>There is a number of language bindings and wrappers available for libxml2,
666 the list below is not exhaustive. Please contact the <a
667 href="http://mail.gnome.org/mailman/listinfo/xml-bindings">xml-bindings@gnome.org</a>
668 (<a href="http://mail.gnome.org/archives/xml-bindings/">archives</a>) in
669 order to get updates to this list or to discuss the specific topic of libxml2
670 or libxslt wrappers or bindings:</p>
673 href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
674 Sergeant</a> developped <a href="http://axkit.org/download/">XML::LibXML
675 and XML::LibXSLT</a>, a perl wrapper for libxml2/libxslt as part of the
676 <a href="http://axkit.com/">AxKit XML application server</a></li>
677 <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provides and
678 earlier version of the libxml/libxslt <a
679 href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li>
680 <li>Petr Kozelka provides <a
681 href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
682 libxml2</a> with Kylix, Delphi and other Pascal compilers</li>
683 <li>Wai-Sun "Squidster" Chia provides <a
684 href="http://www.rubycolor.org/arc/redist/">bindings for Ruby</a> and
685 libxml2 bindings are also available in Ruby through the <a
686 href="http://libgdome-ruby.berlios.de/">libgdome-ruby</a> module
687 maintained by Tobias Peters.</li>
688 <li>Steve Ball and contributors maintains <a
689 href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings for
693 <p>The libxslt Python module depends on the <a
694 href="http://xmlsoft.org/python.html">libxml2 Python</a> module.</p>
696 <p>The distribution includes a set of Python bindings, which are garanteed to
697 be maintained as part of the library in the future, though the Python
698 interface have not yet reached the maturity of the C API.</p>
700 <p>To install the Python bindings there are 2 options:</p>
702 <li>If you use an RPM based distribution, simply install the <a
703 href="http://rpmfind.net/linux/rpm2html/search.php?query=libxml2-python">libxml2-python
705 href="http://rpmfind.net/linux/rpm2html/search.php?query=libxslt-python">libxslt-python
707 <li>Otherwise use the <a href="ftp://xmlsoft.org/python/">libxml2-python
708 module distribution</a> corresponding to your installed version of
709 libxml2 and libxslt. Note that to install it you will need both libxml2
710 and libxslt installed and run "python setup.py build install" in the
714 <p>The distribution includes a set of examples and regression tests for the
715 python bindings in the <code>python/tests</code> directory. Here are some
716 excepts from those tests:</p>
720 <p>This is a basic test of XSLT interfaces: loading a stylesheet and a
721 document, transforming the document and saving the result.</p>
725 styledoc = libxml2.parseFile("test.xsl")
726 style = libxslt.parseStylesheetDoc(styledoc)
727 doc = libxml2.parseFile("test.xml")
728 result = style.applyStylesheet(doc, None)
729 style.saveResultToFilename("foo", result, 0)
730 style.freeStylesheet()
732 result.freeDoc()</pre>
734 <p>The Python module is called libxslt, you will also need the libxml2 module
735 for the operations on XML trees. Let's have a look at the objects manipulated
736 in that example and how is the processing done:</p>
738 <li><code>styledoc</code> : is a libxml2 document tree. It is obtained by
739 parsing the XML file "test.xsl" containing the stylesheet.</li>
740 <li><code>style</code> : this is a precompiled stylesheet ready to be used
741 by the following transformations (note the plural form, multiple
742 transformations can resuse the same stylesheet).</li>
743 <li><code>doc</code> : this is the document to apply the transformation to.
744 In this case it is simply generated by parsing it from a file but any
745 other processing is possible as long as one get a libxml2 Doc. Note that
746 HTML tree are suitable for XSLT processing in libxslt. This is actually
747 how this page is generated !</li>
748 <li><code>result</code> : this is a document generated by applying the
749 stylesheet to the document. Note that some of the stylesheet informations
750 may be related to the serialization of that document and as in this
751 example a specific saveResultToFilename() method of the stylesheet should
752 be used to save it to a file (in that case to "foo").</li>
755 <p>Also note the need to explicitely deallocate documents with freeDoc()
756 except for the stylesheet document which is freed when its compiled form is
757 garbage collected.</p>
761 <p>This one is a far more complex test. It shows how to modify the behaviour
762 of an XSLT transformation by passing parameters and how to extend the XSLT
763 engine with functions defined in python:</p>
773 # Small check to verify the context is correcly accessed
776 pctxt = libxslt.xpathParserContext(_obj=ctx)
777 ctxt = pctxt.context()
778 tctxt = ctxt.transformContext()
779 nodeName = tctxt.insertNode().name
783 return string.upper(str)
785 libxslt.registerExtModuleFunction("foo", "http://example.com/foo", f)</pre>
787 <p>This code defines and register an extension function. Note that the
788 function can be bound to any name (foo) and how the binding is also
789 associated to a namespace name "http://example.com/foo". From an XSLT point
790 of view the function just returns an upper case version of the string passed
791 as a parameter. But the first part of the function also read some contextual
792 information from the current XSLT processing environement, in that case it
793 looks for the current insertion node in the resulting output (either the
794 resulting document or the Result Value Tree being generated), and saves it to
795 a global variable for checking that the access actually worked.</p>
797 <p>For more informations on the xpathParserContext and transformContext
798 objects check the <a href="internals.html">libray internals description</a>.
799 The pctxt is actually an object from a class derived from the
800 libxml2.xpathParserContext() with just a couple more properties including the
801 possibility to look up the XSLT transformation context from the XPath
803 <pre>styledoc = libxml2.parseDoc("""
804 <xsl:stylesheet version='1.0'
805 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
806 xmlns:foo='http://example.com/foo'
807 xsl:exclude-result-prefixes='foo'>
809 <xsl:param name='bar'>failure</xsl:param>
810 <xsl:template match='/'>
811 <article><xsl:value-of select='foo:foo($bar)'/></article>
812 </xsl:template>
813 </xsl:stylesheet>
816 <p>Here is a simple example of how to read an XML document from a python
817 string with libxml2. Note how this stylesheet:</p>
819 <li>Uses a global parameter <code>bar</code></li>
820 <li>Reference the extension function f</li>
821 <li>how the Namespace name "http://example.com/foo" has to be bound to a
823 <li>how that prefix is excluded from the output</li>
824 <li>how the function is called from the select</li>
826 <pre>style = libxslt.parseStylesheetDoc(styledoc)
827 doc = libxml2.parseDoc("<doc/>")
828 result = style.applyStylesheet(doc, { "bar": "'success'" })
829 style.freeStylesheet()
832 <p>that part is identical, to the basic example except that the
833 transformation is passed a dictionnary of parameters. Note that the string
834 passed "success" had to be quoted, otherwise it is interpreted as an XPath
835 query for the childs of root named "success".</p>
836 <pre>root = result.children
837 if root.name != "article":
838 print "Unexpected root node name"
840 if root.content != "SUCCESS":
841 print "Unexpected root node content, extension function failed"
843 if nodeName != 'article':
844 print "The function callback failed to access its context"
847 result.freeDoc()</pre>
849 <p>That part just verifies that the transformation worked, that the parameter
850 got properly passed to the engine, that the function f() got called and that
851 it properly accessed the context to find the name of the insertion node.</p>
853 <h3>pyxsltproc.py:</h3>
855 <p>this module is a bit too long to be described there but it is basically a
856 rewrite of the xsltproc command line interface of libxslt in Python. It
857 provides nearly all the functionalities of xsltproc and can be used as a base
858 module to write Python customized XSLT processors. One of the thing to notice
860 <pre>libxml2.lineNumbersDefault(1)
861 libxml2.substituteEntitiesDefault(1)</pre>
863 <p>those two calls in the main() function are needed to force the libxml2
864 processor to generate DOM trees compliant with the XPath data model.</p>
866 <h2><a name="Internals">Library internals</a></h2>
868 <h3>Table of contents</h3>
870 <li><a href="internals.html#Introducti">Introduction</a></li>
871 <li><a href="internals.html#Basics">Basics</a></li>
872 <li><a href="internals.html#Keep">Keep it simple stupid</a></li>
873 <li><a href="internals.html#libxml">The libxml nodes</a></li>
874 <li><a href="internals.html#XSLT">The XSLT processing steps</a></li>
875 <li><a href="internals.html#XSLT1">The XSLT stylesheet compilation</a></li>
876 <li><a href="internals.html#XSLT2">The XSLT template compilation</a></li>
877 <li><a href="internals.html#processing">The processing itself</a></li>
878 <li><a href="internals.html#XPath">XPath expressions compilation</a></li>
879 <li><a href="internals.html#XPath1">XPath interpretation</a></li>
880 <li><a href="internals.html#Descriptio">Description of XPath
882 <li><a href="internals.html#XPath3">XPath functions</a></li>
883 <li><a href="internals.html#stack">The variables stack frame</a></li>
884 <li><a href="internals.html#Extension">Extension support</a></li>
885 <li><a href="internals.html#Futher">Further reading</a></li>
886 <li><a href="internals.html#TODOs">TODOs</a></li>
889 <h3><a name="Introducti2">Introduction</a></h3>
891 <p>This document describes the processing of <a
892 href="http://xmlsoft.org/XSLT/">libxslt</a>, the <a
893 href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the <a
894 href="http://www.gnome.org/">Gnome</a> project.</p>
896 <p>Note: this documentation is by definition incomplete and I am not good at
897 spelling, grammar, so patches and suggestions are <a
898 href="mailto:veillard@redhat.com">really welcome</a>.</p>
900 <h3><a name="Basics1">Basics</a></h3>
902 <p>XSLT is a transformation language. It takes an input document and a
903 stylesheet document and generates an output document:</p>
905 <p align="center"><img src="processing.gif"
906 alt="the XSLT processing model"></p>
908 <p>Libxslt is written in C. It relies on <a
909 href="http://www.xmlsoft.org/">libxml</a>, the XML C library for Gnome, for
910 the following operations:</p>
912 <li>parsing files</li>
913 <li>building the in-memory DOM structure associated with the documents
915 <li>the XPath implementation</li>
916 <li>serializing back the result document to XML and HTML. (Text is handled
920 <h3><a name="Keep1">Keep it simple stupid</a></h3>
922 <p>Libxslt is not very specialized. It is built under the assumption that all
923 nodes from the source and output document can fit in the virtual memory of
924 the system. There is a big trade-off there. It is fine for reasonably sized
925 documents but may not be suitable for large sets of data. The gain is that it
926 can be used in a relatively versatile way. The input or output may never be
927 serialized, but the size of documents it can handle are limited by the size
928 of the memory available.</p>
930 <p>More specialized memory handling approaches are possible, like building
931 the input tree from a serialization progressively as it is consumed,
932 factoring repetitive patterns, or even on-the-fly generation of the output as
933 the input is parsed but it is possible only for a limited subset of the
934 stylesheets. In general the implementation of libxslt follows the following
937 <li>KISS (keep it simple stupid)</li>
938 <li>when there is a clear bottleneck optimize on top of this simple
939 framework and refine only as much as is needed to reach the expected
943 <p>The result is not that bad, clearly one can do a better job but more
944 specialized too. Most optimization like building the tree on-demand would
945 need serious changes to the libxml XPath framework. An easy step would be to
946 serialize the output directly (or call a set of SAX-like output handler to
947 keep this a flexible interface) and hence avoid the memory consumption of the
950 <h3><a name="libxml">The libxml nodes</a></h3>
952 <p>DOM-like trees, as used and generated by libxml and libxslt, are
953 relatively complex. Most node types follow the given structure except a few
954 variations depending on the node type:</p>
956 <p align="center"><img src="node.gif" alt="description of a libxml node"></p>
958 <p>Nodes carry a <strong>name</strong> and the node <strong>type</strong>
959 indicates the kind of node it represents, the most common ones are:</p>
961 <li>document nodes</li>
962 <li>element nodes</li>
966 <p>For the XSLT processing, entity nodes should not be generated (i.e. they
967 should be replaced by their content). Most nodes also contains the following
968 "navigation" informations:</p>
970 <li>the containing <strong>doc</strong>ument</li>
971 <li>the <strong>parent</strong> node</li>
972 <li>the first <strong>children</strong> node</li>
973 <li>the <strong>last</strong> children node</li>
974 <li>the <strong>prev</strong>ious sibling</li>
975 <li>the following sibling (<strong>next</strong>)</li>
978 <p>Elements nodes carries the list of attributes in the properties, an
979 attribute itself holds the navigation pointers and the children list (the
980 attribute value is not represented as a simple string to allow usage of
981 entities references).</p>
983 <p>The <strong>ns</strong> points to the namespace declaration for the
984 namespace associated to the node, <strong>nsDef</strong> is the linked list
985 of namespace declaration present on element nodes.</p>
987 <p>Most nodes also carry an <strong>_private</strong> pointer which can be
988 used by the application to hold specific data on this node.</p>
990 <h3><a name="XSLT">The XSLT processing steps</a></h3>
992 <p>There are a few steps which are clearly decoupled at the interface
995 <li>parse the stylesheet and generate a DOM tree</li>
996 <li>take the stylesheet tree and build a compiled version of it (the
997 compilation phase)</li>
998 <li>take the input and generate a DOM tree</li>
999 <li>process the stylesheet against the input tree and generate an output
1001 <li>serialize the output tree</li>
1004 <p>A few things should be noted here:</p>
1006 <li>the steps 1/ 3/ and 5/ are optional</li>
1007 <li>the stylesheet obtained at 2/ can be reused by multiple processing 4/
1008 (and this should also work in threaded programs)</li>
1009 <li>the tree provided in 2/ should never be freed using xmlFreeDoc, but by
1010 freeing the stylesheet.</li>
1011 <li>the input tree 4/ is not modified except the _private field which may
1012 be used for labelling keys if used by the stylesheet</li>
1015 <h3><a name="XSLT1">The XSLT stylesheet compilation</a></h3>
1017 <p>This is the second step described. It takes a stylesheet tree, and
1018 "compiles" it. This associates to each node a structure stored in the
1019 _private field and containing information computed in the stylesheet:</p>
1021 <p align="center"><img src="stylesheet.gif"
1022 alt="a compiled XSLT stylesheet"></p>
1024 <p>One xsltStylesheet structure is generated per document parsed for the
1025 stylesheet. XSLT documents allow includes and imports of other documents,
1026 imports are stored in the <strong>imports</strong> list (hence keeping the
1027 tree hierarchy of includes which is very important for a proper XSLT
1028 processing model) and includes are stored in the <strong>doclist</strong>
1029 list. An imported stylesheet has a parent link to allow browsing of the
1032 <p>The DOM tree associated to the document is stored in <strong>doc</strong>.
1033 It is preprocessed to remove ignorable empty nodes and all the nodes in the
1034 XSLT namespace are subject to precomputing. This usually consist of
1035 extracting all the context information from the context tree (attributes,
1036 namespaces, XPath expressions), and storing them in an xsltStylePreComp
1037 structure associated to the <strong>_private</strong> field of the node.</p>
1039 <p>A couple of notable exceptions to this are XSLT template nodes (more on
1040 this later) and attribute value templates. If they are actually templates,
1041 the value cannot be computed at compilation time. (Some preprocessing could
1042 be done like isolation and preparsing of the XPath subexpressions but it's
1045 <p>The xsltStylePreComp structure also allows storing of the precompiled form
1046 of an XPath expression that can be associated to an XSLT element (more on
1049 <h3><a name="XSLT2">The XSLT template compilation</a></h3>
1051 <p>A proper handling of templates lookup is one of the keys of fast XSLT
1052 processing. (Given a node in the source document this is the process of
1053 finding which templates should be applied to this node.) Libxslt follows the
1054 hint suggested in the <a href="http://www.w3.org/TR/xslt#patterns">5.2
1055 Patterns</a> section of the XSLT Recommendation, i.e. it doesn't evaluate it
1056 as an XPath expression but tokenizes it and compiles it as a set of rules to
1057 be evaluated on a candidate node. There usually is an indication of the node
1058 name in the last step of this evaluation and this is used as a key check for
1059 the match. As a result libxslt builds a relatively more complex set of
1060 structures for the templates:</p>
1062 <p align="center"><img src="templates.gif"
1063 alt="The templates related structure"></p>
1065 <p>Let's describe a bit more closely what is built. First the xsltStylesheet
1066 structure holds a pointer to the template hash table. All the XSLT patterns
1067 compiled in this stylesheet are indexed by the value of the the target
1068 element (or attribute, pi ...) name, so when a element or an attribute "foo"
1069 needs to be processed the lookup is done using the name as a key.</p>
1071 <p>Each of the patterns is compiled into an xsltCompMatch structure. It holds
1072 the set of rules based on the tokenization of the pattern stored in reverse
1073 order (matching is easier this way). It also holds some information about the
1074 previous matches used to speed up the process when one iterates over a set of
1075 siblings. (This optimization may be defeated by trashing when running
1076 threaded computation, it's unclear that this is a big deal in practice.)
1077 Predicate expressions are not compiled at this stage, they may be at run-time
1078 if needed, but in this case they are compiled as full XPath expressions (the
1079 use of some fixed predicate can probably be optimized, they are not yet).</p>
1081 <p>The xsltCompMatch are then stored in the hash table, the clash list is
1082 itself sorted by priority of the template to implement "naturally" the XSLT
1085 <p>Associated to the compiled pattern is the xsltTemplate itself containing
1086 the information required for the processing of the pattern including, of
1087 course, a pointer to the list of elements used for building the pattern
1090 <p>Last but not least a number of patterns do not fit in the hash table
1091 because they are not associated to a name, this is the case for patterns
1092 applying to the root, any element, any attributes, text nodes, pi nodes, keys
1093 etc. Those are stored independently in the stylesheet structure as separate
1094 linked lists of xsltCompMatch.</p>
1096 <h3><a name="processing">The processing itself</a></h3>
1098 <p>The processing is defined by the XSLT specification (the basis of the
1099 algorithm is explained in <a
1100 href="http://www.w3.org/TR/xslt#section-Introduction">the Introduction</a>
1101 section). Basically it works by taking the root of the input document and
1102 applying the following algorithm:</p>
1104 <li>Finding the template applying to it. This is a lookup in the template
1105 hash table, walking the hash list until the node satisfies all the steps
1106 of the pattern, then checking the appropriate(s) global templates to see
1107 if there isn't a higher priority rule to apply</li>
1108 <li>If there is no template, apply the default rule (recurse on the
1110 <li>else walk the content list of the selected templates, for each of them:
1112 <li>if the node is in the XSLT namespace then the node has a _private
1113 field pointing to the preprocessed values, jump to the specific
1115 <li>if the node is in an extension namespace, look up the associated
1117 <li>otherwise copy the node.</li>
1119 <p>The closure is usually done through the XSLT
1120 <strong>apply-templates</strong> construct recursing by applying the
1121 adequate template on the input node children or on the result of an
1122 associated XPath selection lookup.</p>
1126 <p>Note that large parts of the input tree may not be processed by a given
1127 stylesheet and that on the opposite some may be processed multiple times.
1128 (This often is the case when a Table of Contents is built).</p>
1130 <p>The module <code>transform.c</code> is the one implementing most of this
1131 logic. <strong>xsltApplyStylesheet()</strong> is the entry point, it
1132 allocates an xsltTransformContext containing the following:</p>
1134 <li>a pointer to the stylesheet being processed</li>
1135 <li>a stack of templates</li>
1136 <li>a stack of variables and parameters</li>
1137 <li>an XPath context</li>
1138 <li>the template mode</li>
1139 <li>current document</li>
1140 <li>current input node</li>
1141 <li>current selected node list</li>
1142 <li>the current insertion points in the output document</li>
1143 <li>a couple of hash tables for extension elements and functions</li>
1146 <p>Then a new document gets allocated (HTML or XML depending on the type of
1147 output), the user parameters and global variables and parameters are
1148 evaluated. Then <strong>xsltProcessOneNode()</strong> which implements the
1149 1-2-3 algorithm is called on the root element of the input. Step 1/ is
1150 implemented by calling <strong>xsltGetTemplate()</strong>, step 2/ is
1151 implemented by <strong>xsltDefaultProcessOneNode()</strong> and step 3/ is
1152 implemented by <strong>xsltApplyOneTemplate()</strong>.</p>
1154 <h3><a name="XPath">XPath expression compilation</a></h3>
1156 <p>The XPath support is actually implemented in the libxml module (where it
1157 is reused by the XPointer implementation). XPath is a relatively classic
1158 expression language. The only uncommon feature is that it is working on XML
1159 trees and hence has specific syntax and types to handle them.</p>
1161 <p>XPath expressions are compiled using <strong>xmlXPathCompile()</strong>.
1162 It will take an expression string in input and generate a structure
1163 containing the parsed expression tree, for example the expression:</p>
1164 <pre>/doc/chapter[title='Introduction']</pre>
1166 <p>will be compiled as</p>
1167 <pre>Compiled Expression : 10 elements
1169 COLLECT 'child' 'name' 'node' chapter
1170 COLLECT 'child' 'name' 'node' doc
1175 COLLECT 'child' 'name' 'node' title
1177 ELEM Object is a string : Introduction
1178 COLLECT 'child' 'name' 'node' title
1181 <p>This can be tested using the <code>testXPath</code> command (in the
1182 libxml codebase) using the <code>--tree</code> option.</p>
1184 <p>Again, the KISS approach is used. No optimization is done. This could be
1185 an interesting thing to add. <a
1186 href="http://www-106.ibm.com/developerworks/library/x-xslt2/?dwzone=x?open&l=132%2ct=gr%2c+p=saxon">Michael
1187 Kay describes</a> a lot of possible and interesting optimizations done in
1188 Saxon which would be possible at this level. I'm unsure they would provide
1189 much gain since the expressions tends to be relatively simple in general and
1190 stylesheets are still hand generated. Optimizations at the interpretation
1191 sounds likely to be more efficient.</p>
1193 <h3><a name="XPath1">XPath interpretation</a></h3>
1195 <p>The interpreter is implemented by <strong>xmlXPathCompiledEval()</strong>
1196 which is the front-end to <strong>xmlXPathCompOpEval()</strong> the function
1197 implementing the evaluation of the expression tree. This evaluation follows
1198 the KISS approach again. It's recursive and calls
1199 <strong>xmlXPathNodeCollectAndTest()</strong> to collect nodes set when
1200 evaluating a <code>COLLECT</code> node.</p>
1202 <p>An evaluation is done within the framework of an XPath context stored in
1203 an <strong>xmlXPathContext</strong> structure, in the framework of a
1204 transformation the context is maintained within the XSLT context. Its content
1205 follows the requirements from the XPath specification:</p>
1207 <li>the current document</li>
1208 <li>the current node</li>
1209 <li>a hash table of defined variables (but not used by XSLT)</li>
1210 <li>a hash table of defined functions</li>
1211 <li>the proximity position (the place of the node in the current node
1213 <li>the context size (the size of the current node list)</li>
1214 <li>the array of namespace declarations in scope (there also is a namespace
1215 hash table but it is not used in the XSLT transformation).</li>
1218 <p>For the purpose of XSLT an <strong>extra</strong> pointer has been added
1219 allowing to retrieve the XSLT transformation context. When an XPath
1220 evaluation is about to be performed, an XPath parser context is allocated
1221 containing and XPath object stack (this is actually an XPath evaluation
1222 context, this is a remain of the time where there was no separate parsing and
1223 evaluation phase in the XPath implementation). Here is an overview of the set
1224 of contexts associated to an XPath evaluation within an XSLT
1227 <p align="center"><img src="contexts.gif"
1228 alt="The set of contexts associated "></p>
1230 <p>Clearly this is a bit too complex and confusing and should be refactored
1231 at the next set of binary incompatible releases of libxml. For example the
1232 xmlXPathCtxt has a lot of unused parts and should probably be merged with
1233 xmlXPathParserCtxt.</p>
1235 <h3><a name="Descriptio">Description of XPath Objects</a></h3>
1237 <p>An XPath expression manipulates XPath objects. XPath defines the default
1238 types boolean, numbers, strings and node sets. XSLT adds the result tree
1239 fragment type which is basically an unmodifiable node set.</p>
1241 <p>Implementation-wise, libxml follows again a KISS approach, the
1242 xmlXPathObject is a structure containing a type description and the various
1243 possibilities. (Using an enum could have gained some bytes.) In the case of
1244 node sets (or result tree fragments), it points to a separate xmlNodeSet
1245 object which contains the list of pointers to the document nodes:</p>
1247 <p align="center"><img src="object.gif"
1248 alt="An Node set object pointing to "></p>
1250 <p>The <a href="http://xmlsoft.org/html/libxml-xpath.html">XPath API</a> (and
1251 its <a href="http://xmlsoft.org/html/libxml-xpathinternals.html">'internal'
1252 part</a>) includes a number of functions to create, copy, compare, convert or
1253 free XPath objects.</p>
1255 <h3><a name="XPath3">XPath functions</a></h3>
1257 <p>All the XPath functions available to the interpreter are registered in the
1258 function hash table linked from the XPath context. They all share the same
1260 <pre>void xmlXPathFunc (xmlXPathParserContextPtr ctxt, int nargs);</pre>
1262 <p>The first argument is the XPath interpretation context, holding the
1263 interpretation stack. The second argument defines the number of objects
1264 passed on the stack for the function to consume (last argument is on top of
1267 <p>Basically an XPath function does the following:</p>
1269 <li>check <code>nargs</code> for proper handling of errors or functions
1270 with variable numbers of parameters</li>
1271 <li>pop the parameters from the stack using <code>obj =
1272 valuePop(ctxt);</code></li>
1273 <li>do the function specific computation</li>
1274 <li>push the result parameter on the stack using <code>valuePush(ctxt,
1276 <li>free up the input parameters with
1277 <code>xmlXPathFreeObject(obj);</code></li>
1281 <p>Sometime the work can be done directly by modifying in-situ the top object
1282 on the stack <code>ctxt->value</code>.</p>
1284 <h3><a name="stack">The XSLT variables stack frame</a></h3>
1286 <p>Not to be confused with XPath object stack, this stack holds the XSLT
1287 variables and parameters as they are defined through the recursive calls of
1288 call-template, apply-templates and default templates. This is used to define
1289 the scope of variables being called.</p>
1291 <p>This part seems to be the most urgent attention right now, first it is
1292 done in a very inefficient way since the location of the variables and
1293 parameters within the stylesheet tree is still done at run time (it really
1294 should be done statically at compile time), and I am still unsure that my
1295 understanding of the template variables and parameter scope is actually
1298 <p>This part of the documentation is still to be written once this part of
1299 the code will be stable. <span
1300 style="background-color: #FF0000">TODO</span></p>
1302 <h3><a name="Extension">Extension support</a></h3>
1304 <p>There is a separate document explaining <a href="extensions.html">how the
1305 extension support works</a>.</p>
1307 <h3><a name="Futher">Further reading</a></h3>
1309 <p>Michael Kay wrote <a
1310 href="http://www-106.ibm.com/developerworks/library/x-xslt2/?dwzone=x?open&l=132%2ct=gr%2c+p=saxon">a
1311 really interesting article on Saxon internals</a> and the work he did on
1312 performance issues. I wishes I had read it before starting libxslt design (I
1313 would probably have avoided a few mistakes and progressed faster). A lot of
1314 the ideas in his papers should be implemented or at least tried in
1317 <p>The <a href="http://xmlsoft.org/">libxml documentation</a>, especially <a
1318 href="http://xmlsoft.org/xmlio.html">the I/O interfaces</a> and the <a
1319 href="http://xmlsoft.org/xmlmem.html">memory management</a>.</p>
1321 <h3><a name="TODOs">TODOs</a></h3>
1323 <p>redesign the XSLT stack frame handling. Far too much work is done at
1324 execution time. Similarly for the attribute value templates handling, at
1325 least the embedded subexpressions ought to be precompiled.</p>
1327 <p>Allow output to be saved to a SAX like output (this notion of SAX like API
1328 for output should be added directly to libxml).</p>
1330 <p>Implement and test some of the optimization explained by Michael Kay
1333 <li>static slot allocation on the stack frame</li>
1334 <li>specific boolean interpretation of an XPath expression</li>
1335 <li>some of the sorting optimization</li>
1336 <li>Lazy evaluation of location path. (this may require more changes but
1337 sounds really interesting. XT does this too.)</li>
1338 <li>Optimization of an expression tree (This could be done as a completely
1339 independent module.)</li>
1344 <p>Error reporting, there is a lot of case where the XSLT specification
1345 specify that a given construct is an error are not checked adequately by
1346 libxslt. Basically one should do a complete pass on the XSLT spec again and
1347 add all tests to the stylesheet compilation. Using the DTD provided in the
1348 appendix and making direct checks using the libxml validation API sounds a
1349 good idea too (though one should take care of not raising errors for
1350 elements/attributes in different namespaces).</p>
1352 <p>Double check all the places where the stylesheet compiled form might be
1353 modified at run time (extra removal of blanks nodes, hint on the
1358 <h2><a name="Extensions">Writing extensions</a></h2>
1360 <h3>Table of content</h3>
1362 <li><a href="extensions.html#Introducti">Introduction</a></li>
1363 <li><a href="extensions.html#Basics">Basics</a></li>
1364 <li><a href="extensions.html#Keep">Extension modules</a></li>
1365 <li><a href="extensions.html#Registerin">Registering a module</a></li>
1366 <li><a href="extensions.html#module">Loading a module</a></li>
1367 <li><a href="extensions.html#Registerin1">Registering an extension
1369 <li><a href="extensions.html#Implementi">Implementing an extension
1371 <li><a href="extensions.html#Examples">Examples for extension
1373 <li><a href="extensions.html#Registerin2">Registering an extension
1375 <li><a href="extensions.html#Implementi1">Implementing an extension
1377 <li><a href="extensions.html#Example">Example for extension
1379 <li><a href="extensions.html#shutdown">The shutdown of a module</a></li>
1380 <li><a href="extensions.html#Future">Future work</a></li>
1383 <h3><a name="Introducti1">Introduction</a></h3>
1385 <p>This document describes the work needed to write extensions to the
1386 standard XSLT library for use with <a
1387 href="http://xmlsoft.org/XSLT/">libxslt</a>, the <a
1388 href="http://www.w3.org/TR/xslt">XSLT</a> C library developed for the <a
1389 href="http://www.gnome.org/">Gnome</a> project.</p>
1391 <p>Before starting reading this document it is highly recommended to get
1392 familiar with <a href="internals.html">the libxslt internals</a>.</p>
1394 <p>Note: this documentation is by definition incomplete and I am not good at
1395 spelling, grammar, so patches and suggestions are <a
1396 href="mailto:veillard@redhat.com">really welcome</a>.</p>
1398 <h3><a name="Basics">Basics</a></h3>
1400 <p>The <a href="http://www.w3.org/TR/xslt">XSLT specification</a> provides
1401 two <a href="http://www.w3.org/TR/xslt">ways to extend an XSLT engine</a>:</p>
1403 <li>providing <a href="http://www.w3.org/TR/xslt">new extension
1404 functions</a> which can be called from XPath expressions</li>
1405 <li>providing <a href="http://www.w3.org/TR/xslt">new extension
1406 elements</a> which can be inserted in stylesheets</li>
1409 <p>In both cases the extensions need to be associated to a new namespace,
1410 i.e. an URI used as the name for the extension's namespace (there is no need
1411 to have a resource there for this to work).</p>
1413 <p>libxslt provides a few extensions itself, either in libxslt namespace
1414 "http://xmlsoft.org/XSLT/" or in other namespace for well known extensions
1415 provided by other XSLT processors like Saxon, Xalan or XT.</p>
1417 <h3><a name="Keep">Extension modules</a></h3>
1419 <p>Since extensions are bound to a namespace name, usually sets of extensions
1420 coming from a given source are using the same namespace name defining in
1421 practice a group of extensions providing elements, functions or both. From
1422 libxslt point of view those are considered as an "extension module", and most
1423 of the APIs work at a module point of view.</p>
1425 <p>Registration of new functions or elements are bound to the activation of
1426 the module, this is currently done by declaring the namespace as an extension
1427 by using the attribute <code>extension-element-prefixes</code> on the
1428 <code><a href="http://www.w3.org/TR/xslt">xsl:stylesheet</a></code>
1431 <p>And extension module is defined by 3 objects:</p>
1433 <li>the namespace name associated</li>
1434 <li>an initialization function</li>
1435 <li>a shutdown function</li>
1438 <h3><a name="Registerin">Registering a module</a></h3>
1440 <p>Currently a libxslt module has to be compiled within the application using
1441 libxslt, there is no code to load dynamically shared libraries associated to
1442 namespace (this may be added but is likely to become a portability
1445 <p>So the current way to register a module is to link the code implementing
1446 it with the application and to call a registration function:</p>
1447 <pre>int xsltRegisterExtModule(const xmlChar *URI,
1448 xsltExtInitFunction initFunc,
1449 xsltExtShutdownFunction shutdownFunc);</pre>
1451 <p>The associated header is read by:</p>
1452 <pre>#include<libxslt/extensions.h></pre>
1454 <p>which also defines the type for the initialization and shutdown
1457 <h3><a name="module">Loading a module</a></h3>
1459 <p>Once the module URI has been registered and if the XSLT processor detects
1460 that a given stylesheet needs the functionalities of an extended module, this
1461 one is initialized.</p>
1463 <p>The xsltExtInitFunction type defines the interface for an initialization
1466 * xsltExtInitFunction:
1467 * @ctxt: an XSLT transformation context
1468 * @URI: the namespace URI for the extension
1470 * A function called at initialization time of an XSLT
1473 * Returns a pointer to the module specific data for this
1476 typedef void *(*xsltExtInitFunction)(xsltTransformContextPtr ctxt,
1477 const xmlChar *URI);</pre>
1479 <p>There are 3 things to notice:</p>
1481 <li>the function gets passed the namespace name URI as an argument, this
1482 allow a single function to provide the initialization for multiple
1483 logical modules</li>
1484 <li>it also gets passed a transformation context, the initialization is
1485 done at run time before any processing occurs on the stylesheet but it
1486 will be invoked separately each time for each transformation</li>
1487 <li>it returns a pointer, this can be used to store module specific
1488 informations which can be retrieved later when a function or an element
1489 from the extension are used, an obvious example is a connection to a
1490 database which should be kept and reused along the transformation. NULL
1491 is a perfectly valid return, there is no way to indicate a failure at
1495 <p>What this function is expected to do is:</p>
1497 <li>prepare the context for this module (like opening the database
1499 <li>register the extensions specific to this module</li>
1502 <h3><a name="Registerin1">Registering an extension function</a></h3>
1504 <p>There is a single call to do this registration:</p>
1505 <pre>int xsltRegisterExtFunction(xsltTransformContextPtr ctxt,
1506 const xmlChar *name,
1508 xmlXPathEvalFunc function);</pre>
1510 <p>The registration is bound to a single transformation instance referred by
1511 ctxt, name is the UTF8 encoded name for the NCName of the function, and URI
1512 is the namespace name for the extension (no checking is done, a module could
1513 register functions or elements from a different namespace, but it is not
1516 <h3><a name="Implementi">Implementing an extension function</a></h3>
1518 <p>The implementation of the function must have the signature of a libxml
1522 * @ctxt: an XPath parser context
1523 * @nargs: the number of arguments passed to the function
1525 * an XPath evaluation function, the parameters are on the
1526 * XPath context stack
1529 typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
1532 <p>The context passed to an XPath function is not an XSLT context but an <a
1533 href="internals.html#XPath1">XPath context</a>. However it is possible to
1534 find one from the other:</p>
1536 <li>The function xsltXPathGetTransformContext provide this lookup facility:
1537 <pre>xsltTransformContextPtr
1538 xsltXPathGetTransformContext
1539 (xmlXPathParserContextPtr ctxt);</pre>
1541 <li>The <code>xmlXPathContextPtr</code> associated to an
1542 <code>xsltTransformContext</code> is stored in the <code>xpathCtxt</code>
1546 <p>The first thing an extension function may want to do is to check the
1547 arguments passed on the stack, the <code>nargs</code> will precise how many
1548 of them were provided on the XPath expression. The macros valuePop will
1549 extract them from the XPath stack:</p>
1550 <pre>#include <libxml/xpath.h>
1551 #include <libxml/xpathInternals.h>
1553 xmlXPathObjectPtr obj = valuePop(ctxt); </pre>
1555 <p>Note that <code>ctxt</code> is the XPath context not the XSLT one. It is
1556 then possible to examine the content of the value. Check <a
1557 href="internals.html#Descriptio">the description of XPath objects</a> if
1558 necessary. The following is a common sequcnce checking whether the argument
1559 passed is a string and converting it using the built-in XPath
1560 <code>string()</code> function if this is not the case:</p>
1561 <pre>if (obj->type != XPATH_STRING) {
1562 valuePush(ctxt, obj);
1563 xmlXPathStringFunction(ctxt, 1);
1564 obj = valuePop(ctxt);
1567 <p>Most common XPath functions are available directly at the C level and are
1568 exported either in <code><libxml/xpath.h></code> or in
1569 <code><libxml/xpathInternals.h></code>.</p>
1571 <p>The extension function may also need to retrieve the data associated to
1572 this module instance (the database connection in the previous example) this
1573 can be done using the xsltGetExtData:</p>
1574 <pre>void * xsltGetExtData(xsltTransformContextPtr ctxt,
1575 const xmlChar *URI);</pre>
1577 <p>again the URI to be provided is the one used which was used when
1578 registering the module.</p>
1580 <p>Once the function finishes, don't forget to:</p>
1582 <li>push the return value on the stack using <code>valuePush(ctxt,
1584 <li>deallocate the parameters passed to the function using
1585 <code>xmlXPathFreeObject(obj)</code></li>
1588 <h3><a name="Examples">Examples for extension functions</a></h3>
1590 <p>The module libxslt/functions.c containsthe sources of the XSLT built-in
1591 functions, including document(), key(), generate-id(), etc. as well as a full
1592 example module at the end. Here is the test function implementation for the
1593 libxslt:test function:</p>
1595 * xsltExtFunctionTest:
1596 * @ctxt: the XPath Parser context
1597 * @nargs: the number of arguments
1599 * function libxslt:test() for testing the extensions support.
1602 xsltExtFunctionTest(xmlXPathParserContextPtr ctxt, int nargs)
1604 xsltTransformContextPtr tctxt;
1607 tctxt = xsltXPathGetTransformContext(ctxt);
1608 if (tctxt == NULL) {
1609 xsltGenericError(xsltGenericErrorContext,
1610 "xsltExtFunctionTest: failed to get the transformation context\n");
1613 data = xsltGetExtData(tctxt, (const xmlChar *) XSLT_DEFAULT_URL);
1615 xsltGenericError(xsltGenericErrorContext,
1616 "xsltExtFunctionTest: failed to get module data\n");
1619 #ifdef WITH_XSLT_DEBUG_FUNCTION
1620 xsltGenericDebug(xsltGenericDebugContext,
1621 "libxslt:test() called with %d args\n", nargs);
1625 <h3><a name="Registerin2">Registering an extension element</a></h3>
1627 <p>There is a single call to do this registration:</p>
1628 <pre>int xsltRegisterExtElement(xsltTransformContextPtr ctxt,
1629 const xmlChar *name,
1631 xsltTransformFunction function);</pre>
1633 <p>It is similar to the mechanism used to register an extension function,
1634 except that the signature of an extension element implementation is
1637 <p>The registration is bound to a single transformation instance referred by
1638 ctxt, name is the UTF8 encoded name for the NCName of the element, and URI is
1639 the namespace name for the extension (no checking is done, a module could
1640 register elements for a different namespace, but it is not recommended).</p>
1642 <h3><a name="Implementi1">Implementing an extension element</a></h3>
1644 <p>The implementation of the element must have the signature of an XSLT
1645 transformation function:</p>
1647 * xsltTransformFunction:
1648 * @ctxt: the XSLT transformation context
1649 * @node: the input node
1650 * @inst: the stylesheet node
1651 * @comp: the compiled information from the stylesheet
1653 * signature of the function associated to elements part of the
1654 * stylesheet language like xsl:if or xsl:apply-templates.
1656 typedef void (*xsltTransformFunction)
1657 (xsltTransformContextPtr ctxt,
1660 xsltStylePreCompPtr comp);</pre>
1662 <p>The first argument is the XSLT transformation context. The second and
1663 third arguments are xmlNodePtr i.e. internal memory <a
1664 href="internals.html#libxml">representation of XML nodes</a>. They are
1665 respectively <code>node</code> from the the input document being transformed
1666 by the stylesheet and <code>inst</code> the extension element in the
1667 stylesheet. The last argument is <code>comp</code> a pointer to a precompiled
1668 representation of <code>inst</code> but usually for extension function this
1669 value is <code>NULL</code> by default (it could be added and associated to
1670 the instruction in <code>inst->_private</code>).</p>
1672 <p>The same functions are available from a function implementing an extension
1673 element as in an extension function, including
1674 <code>xsltGetExtData()</code>.</p>
1676 <p>The goal of extension element being usually to enrich the generated
1677 output, it is expected that they will grow the currently generated output
1678 tree, this can be done by grabbing ctxt->insert which is the current
1679 libxml node being generated (Note this can also be the intermediate value
1680 tree being built for example to initialize a variable, the processing should
1681 be similar). The functions for libxml tree manipulation from <a
1682 href="http://xmlsoft.org/html/libxml-tree.html"><libxml/tree.h></a> can
1683 be employed to extend or modify the tree, but it is required to preserve the
1684 insertion node and its ancestors since there is existing pointers to those
1685 elements still in use in the XSLT template execution stack.</p>
1687 <h3><a name="Example">Example for extension elements</a></h3>
1689 <p>The module libxslt/transform.c containsthe sources of the XSLT built-in
1690 elements, including xsl:element, xsl:attribute, xsl:if, etc. There is a small
1691 but full example in functions.c providing the implementation for the
1692 libxslt:test element, it will output a comment in the result tree:</p>
1694 * xsltExtElementTest:
1695 * @ctxt: an XSLT processing context
1696 * @node: The current node
1697 * @inst: the instruction in the stylesheet
1698 * @comp: precomputed informations
1700 * Process a libxslt:test node
1703 xsltExtElementTest(xsltTransformContextPtr ctxt, xmlNodePtr node,
1705 xsltStylePreCompPtr comp)
1710 xsltGenericError(xsltGenericErrorContext,
1711 "xsltExtElementTest: no transformation context\n");
1715 xsltGenericError(xsltGenericErrorContext,
1716 "xsltExtElementTest: no current node\n");
1720 xsltGenericError(xsltGenericErrorContext,
1721 "xsltExtElementTest: no instruction\n");
1724 if (ctxt->insert == NULL) {
1725 xsltGenericError(xsltGenericErrorContext,
1726 "xsltExtElementTest: no insertion point\n");
1730 xmlNewComment((const xmlChar *)
1731 "libxslt:test element test worked");
1732 xmlAddChild(ctxt->insert, comment);
1735 <h3><a name="shutdown">The shutdown of a module</a></h3>
1737 <p>When the XSLT processor ends a transformation, the shutdown function (if
1738 it exists) of all the modules initialized are called.The
1739 xsltExtShutdownFunction type defines the interface for a shutdown
1742 * xsltExtShutdownFunction:
1743 * @ctxt: an XSLT transformation context
1744 * @URI: the namespace URI for the extension
1745 * @data: the data associated to this module
1747 * A function called at shutdown time of an XSLT extension module
1749 typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
1753 <p>this is really similar to a module initialization function except a third
1754 argument is passed, it's the value that was returned by the initialization
1755 function. This allow to deallocate resources from the module for example
1756 close the connection to the database to keep the same example.</p>
1758 <h3><a name="Future">Future work</a></h3>
1760 <p>Well some of the pieces missing:</p>
1762 <li>a way to load shared libraries to instanciate new modules</li>
1763 <li>a better detection of extension function usage and their registration
1764 without having to use the extension prefix which ought to be reserved to
1765 element extensions.</li>
1766 <li>more examples</li>
1767 <li>implementations of the <a href="http://www.exslt.org/">EXSLT</a> common
1768 extension libraries, Thomas Broyer nearly finished implementing them.</li>
1773 <h2><a name="Contributi">Contributions</a></h2>
1775 <li>Bjorn Reese is the author of the number support and worked on the
1776 XSLTMark support</li>
1777 <li>William Brack was an early adopted, contributed a number of patches and
1778 spent quite some time debugging non-trivial problems in early versions of
1780 <li><a href="mailto:izlatkovic@daenet.de">Igor Zlatkovic</a> is now the
1781 maintainer of the Windows port, <a
1782 href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he
1783 provides binaries</a></li>
1784 <li>Thomas Broyer provided a lot of suggestions, and drafted most of the
1786 <li>John Fleck maintains <a href="tutorial/libxslttutorial.html">a tutorial
1787 for libxslt</a></li>
1789 href="http://mail.gnome.org/archives/xml/2001-March/msg00014.html">Matt
1790 Sergeant</a> developed <a
1791 href="http://axkit.org/download/">XML::LibXSLT</a>, a perl wrapper for
1792 libxml2/libxslt as part of the <a href="http://axkit.com/">AxKit XML
1793 application server</a></li>
1794 <li>there is a module for <a
1795 href="http://acs-misc.sourceforge.net/nsxml.html">libxml/libxslt support
1796 in OpenNSD/AOLServer</a></li>
1797 <li><a href="mailto:dkuhlman@cutter.rexx.com">Dave Kuhlman</a> provides
1798 libxml/libxslt <a href="http://www.rexx.com/~dkuhlman">wrappers for
1800 <li>Steve Ball and contributors maintains <a
1801 href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings for
1805 <p>I'm still waiting for someone to contribute a simple XSLT processing
1806 module for Apache :-)</p>
1810 <p><a href="mailto:daniel@veillard.com">Daniel Veillard</a></p>