Quick primer on running XSLT stylesheets

ziggy on 2002-08-20T21:29:39

Given a source document (input.xml), and a stylesheet (transform.xsl), what's the easiest way to apply the stylesheet and get some output?

The Quickest Way: On windows, download and run Instant Saxon:

C:\> saxon source.xml transform.xsl
The Quick, Portable Way: If you have a Java2 environment (JDK 1.2 or better), download Saxon, and follow the installation instructions. You can transform documents on the command line like this:
[ziggy@duvel ~]$ java net.sf.saxon.Transform source.xml transform.xsl
The One True Way: Install libxml2 and libxslt on your system. Both of these libraries are written in C, and are [standalone] components of the Gnome project. libxslt comes with a command line utility, xsltproc, that will apply an XSLT transformation to a source document:
xsltproc transform.xsl source.xml
Once you've installed libxml2 and libxslt on your system, you can install XML::LibXML and XML::LibXSLT to use these libraries from Perl.

Enjoy!