The XSLT C library for GNOME

libxslt

Libxslt is the XSLT C library developed for the GNOME project. XSLT itself is a an XML language to define transformation for XML. Libxslt is based on libxml2 the XML C library developed for the GNOME project. It also implements most of the EXSLT set of processor-portable extensions functions and some of Saxon's evaluate and expressions extensions.

People can either embed the library in their application or use xsltproc the command line processing tool. This library is free software and can be reused in commercial applications (see the intro)

External documents:

Logo designed by Marc Liyanage.

Introduction

This document describes libxslt, the XSLT C library developed for the GNOME project.

Here are some key points about libxslt:

Documentation

There are some on-line resources about using libxslt:

  1. Check the API documentation automatically extracted from code comments (using the program apibuild.py, developed for libxml, together with the xsl script 'newapi.xsl' and the libxslt xsltproc program).
  2. Look at the mailing-list archive.
  3. Of course since libxslt is based on libxml, it's a good idea to at least read libxml description

Reporting bugs and getting help

If you need help with the XSLT language itself, here are a number of useful resources:

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). Before filing a bug, check the list of existing libxslt bugs to make sure it hasn't already been filed. I look at reports there regularly and it's good to have a reminder when a bug is still open. Be sure to specify that the bug is for the package libxslt.

For small problems you can try to get help on IRC, the #xml channel on irc.gnome.org (port 6667) usually have a few person subscribed which may help (but there is no guarantee and if a real issue is raised it should go on the mailing-list for archival).

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.. Please do not send me mail directly especially for portability problem, it makes things really harder to track and in some cases I'm not the best person to answer a given question, ask the list instead. Do not send code, I won't debug it (but patches are really appreciated!).

Please note that with the current amount of virus and SPAM, sending mail to the list without being subscribed won't work. There is *far too many bounces* (in the order of a thousand a day !) I cannot approve them manually anymore. If your mail to the list bounced waiting for administrator approval, it is LOST ! Repost it and fix the problem triggering the error. Also please note that emails with a legal warning asking to not copy or redistribute freely the information they contain are NOT acceptable for the mailing-list, such mail will as much as possible be discarded automatically, and are less likely to be answered if they made it to the list, DO NOT post to the list from an email address where such legal requirements are automatically added, get private paying support if you can't share information.

Check the following too before posting:

Then send the bug with associated information to reproduce it to the xslt@gnome.org list; if it's really libxslt related I will approve it. Please do not send mail to me directly, it makes things really hard to track and in some cases I am not the best person to answer a given question, ask on the list.

To be really clear about support:

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 libxslt 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.

How to help

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::

  1. provide patches when you find problems
  2. 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
  3. provide documentation fixes (either as patches to the code comments or as HTML diffs).
  4. provide new documentations pieces (translations, examples, etc ...)
  5. Check the TODO file and try to close one of the items
  6. 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 :-)

Downloads

The latest versions of libxslt can be found on the xmlsoft.org server. (NOTE that you need the libxml2, libxml2-devel, libxslt and libxslt-devel packages installed to compile applications using libxslt.) Igor Zlatkovic is now the maintainer of the Windows port, he provides binaries. CSW provides Solaris binaries, and Steve Ball provides Mac Os X binaries.

Snapshot:

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 GIT:

FAQ

  1. Troubles compiling or linking programs using libxslt

    Usually the problem comes from the fact that the compiler doesn't get the right compilation or linking flags. There is a small shell script xslt-config which is installed as part of libxslt usual install process which provides those flags. Use

    xslt-config --cflags

    to get the compilation flags and

    xslt-config --libs

    to get the linker flags. Usually this is done directly from the Makefile as:

    CFLAGS=`xslt-config --cflags`

    LIBS=`xslt-config --libs`

    Note also that if you use the EXSLT extensions from the program then you should prepend -lexslt to the LIBS options

  2. passing parameters on the xsltproc command line doesn't work

    xsltproc --param test alpha foo.xsl foo.xml

    the param does not get passed and ends up as ""

    In a nutshell do a double escaping at the shell prompt:

    xsltproc --param test "'alpha'" foo.xsl foo.xml

    i.e. the string value is surrounded by " and ' then terminated by ' and ". Libxslt interpret the parameter values as XPath expressions, so the string ->alpha<- is intepreted as the node set matching this string. You really want ->'alpha'<- to be passed to the processor. And to allow this you need to escape the quotes at the shell level using ->"'alpha'"<- .

    or use

    xsltproc --stringparam test alpha foo.xsl foo.xml

  3. Is there C++ bindings ?

    Yes for example xmlwrapp , see the related pages about bindings

News

See the git page to get a description of the recent commits.

v1.1.35: Feb 16 2022

v1.1.34: Oct 30 2019