

The XSLT C library for Gnome
libxslt
This document describes libxslt, the
XSLT C library developped for the Gnome project.
Here are some key points about libxslt:
- Libxslt is a C implementation
- Libxslt is based on libxml for XML parsing, tree manipulation and XPath
support
- It is written in plain C, making as few assumptions as possible, and
sticking closely to ANSI C/POSIX for easy embedding. Should works on
Linux/Unix/Windows.
- This library is released under the GNU LGPL. If you are
not happy with this, drop me a mail.
- Though not designed primarily with performances in mind, libxslt seems
to be a relatively fast processor.
There are some on-line resources about using libxslt:
- Check the API
documentation automatically extracted from code comments (using gtk
doc).
- Look at the mailing-list archive.
- Of course since libxslt is based on libxml, it's a good idea to at least
read libxml description
Well, bugs or missing features are always possible, and I will make a point
of fixing them in a timely fashion. The best way to report a bug is to use the
Gnome bug
tracking database (make sure to use the "libxslt" module name). I look at
reports there regularly and it's good to have a reminder when a bug is still
open. Check the instructions on
reporting bugs and be sure to specify that the bug is for the package
libxslt.
There is also a mailing-list xslt@gnome.org for libxslt, with an on-line archive. To subscribe to this
list, please visit the associated Web page and
follow the instructions.
Alternatively, you can just send the bug to the xslt@gnome.org list, if it's really libxslt
related I will approve it..
Of course, bugs reports with a suggested patch for fixing them will
probably be processed faster.
If you're looking for help, a quick look at the list archive may actually
provide the answer, I usually send source samples when answering libxml usage
questions. The auto-generated
documentation is not as polished as I would like (I need to learn more
about Docbook), but it's a good starting point.
You can help the project in various ways, the best thing to do first is to
subscribe to the mailing-list as explained before, check the archives and the Gnome bug
database::
- provide patches when you find problems
- provide the diffs when you port libxslt to a new platform. They may not
be integrated in all cases but help pinpointing portability problems
and
- provice documentation fixes (either as patches to the code comments or
as HTML diffs).
- provide new documentations pieces (translations, examples, etc ...)
- Check the TODO file and try to close one of the items
- take one of the points raised in the archive or the bug database and
provide a fix. Get in touch with
me before to avoid synchronization problems and check that the
suggested fix will fit in nicely :-)
The latest versions of libxslt can be found on xmlsoft.org or on the Gnome FTP server either
as a source
archive or RPM packages.
(NOTE that you need the libxml2, libxml2-devel, libxslt and libxslt-devel
packages installed to compile applications using libxslt.)
Contribs:
I do accept external contributions, especially if compiling on another
platform, get in touch with me to upload the package. I will keep them in the
contrib directory
Libxslt is also available from CVS:
CVS only : check the Changelog file
for a really accurate description
0.5.0: Mar 10 2001
- fifth beta
- some optimization work, for the moment 2 XSLT transform cannot use the
same stylesheet at the same time (to be fixed)
- fixed problems with handling of tree results
- fixed a reported strip-spaces problem
- added more reported/fixed bugs to the test suite
- incorporated William M. Brack fix for imports and global variables as
well as patch for with-param support in apply-templates
- a bug fix on for-each
0.4.0: Mar 1 2001
- fourth beta test, released at the same time of libxml2-2.3.3
- bug fixes
- some optimization
- started implement extension support, not finished
- implemented but not tested multiple file output
0.3.0: Feb 24 2001
- third beta test, released at the same time of libxml2-2.3.2
- lot of bug fixes
- some optimization
- added DocBook XSL based testsuite
0.2.0: Feb 15 2001
- second beta version, released at the same time as libxml2-2.3.1
- getting close to feature completion, lot of bug fixes, some in the HTML
and XPath support of libxml
- start becoming usable for real work. This version can now regenerate the
XML 2e HTML from the original XML sources and the associated stylesheets
(in section I of the
XML REC)
- Still misses extension element/function/prefixes support. Support of
key() and document() is not complete
0.1.0: Feb 8 2001
- first beta version, released at the same time as libxml2-2.3.0
- lots of bug fixes, first "testing" version, but incomplete
0.0.1: Jan 25 2001
- first alpha version released at the same time as libxml2-2.2.12
- Framework in place, should work on simple examples, but far from being
feature complete
The xsltproc command
This program is the simplest way to use libxslt from the command line, it
takes as first argument the path or URL to an XSLT stylesheet. the next
arguments are filenames or URIs of the inputs to be processed. The output of
the processing is redirected on the standard output.
The programming API
Okay this section is clearly incomplete. But integrating libxslt into your
application should be realitively easy. First check the few steps described
below, then for more detailed informations, look at the generated pages for the API and the source of
xsltproc.c .
Basically doing an XSLT transformation can be done in a few steps:
- configure the parser for XSLT:
xmlSubstituteEntitiesDefault(1);
xmlLoadExtDtdDefaultValue = 1;
- parse the stylesheet with xsltParseStylesheetFile()
- parse the document with xmlParseFile()
- apply the stylesheet using xsltApplyStylesheet()
- save the result using xsltSaveResultToFile() if needed set
xmlIndentTreeOutput to 1
Steps 2,3, and 5 will probably need to be changed depending on you
processing needs and environment for example if reading/saving from/to memory,
or if you want to apply XInclude processing to the stylesheet or input
documents.
- Bjorn Reese is the author of the number support
Daniel Veillard
$Id: xslt.html,v 1.11 2001/03/10 13:00:23 veillard Exp $