Gnome LogoRed Hat Logo

The XSLT C library for Gnome

libxslt

External documents:

Introduction

This document describes libxslt, the XSLT C library developped 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 gtk doc).
  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

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.. 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!).

Check the following too before posting:

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. provice 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 xmlsoft.org (Seattle, France) 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:

News

CVS only : check the Changelog file for a really accurate description

1.0.0: July 10 2001

0.14.0: July 5 2001

0.13.0: June 26 2001

0.12.0: June 18 2001

0.11.0: June 1 2001

Mostly a bug fix release.

0.10.0: May 19 2001

0.9.0: May 3 2001

0.8.0: Apr 22 2001

0.7.0: Apr 10 2001

0.6.0: Mar 22 2001

0.5.0: Mar 10 2001

0.4.0: Mar 1 2001

0.3.0: Feb 24 2001

0.2.0: Feb 15 2001

0.1.0: Feb 8 2001

0.0.1: Jan 25 2001

The xsltproc command line tool tool

This program is the simplest way to use libxslt: from the command line. It is also used for doing the regression tests of the library.

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. There is actually a few more options available:

orchis:~ -> xsltproc
Usage: xsltproc [options] stylesheet file [file ...]
   Options:
      --verbose or -v: show logs of what's happening
      --timing: display the time used
      --repeat: run the transformation 20 times
      --debug: dump the tree of the result instead
      --novalid: skip the Dtd loading phase
      --noout: do not dump the result
      --maxdepth val : increase the maximum depth
      --html: the input document is(are) an HTML file(s)
      --param name value
orchis:~ ->

The programming API

Okay this section is clearly incomplete. But integrating libxslt into your application should be realatively 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 libxslt/xsltproc.c and the tutorial.

Basically doing an XSLT transformation can be done in a few steps:

  1. configure the parser for XSLT:

    xmlSubstituteEntitiesDefault(1);

    xmlLoadExtDtdDefaultValue = 1;

  2. parse the stylesheet with xsltParseStylesheetFile()
  3. parse the document with xmlParseFile()
  4. apply the stylesheet using xsltApplyStylesheet()
  5. 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.

Contributions

I'm still waiting for someone to contribute a simple XSLT processing module for Apache :-)

Daniel Veillard

$Id: xslt.html,v 1.34 2001/07/10 16:08:08 veillard Exp $