[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Standalone XSLT processor for FreeBSD.


Subject: Re: [xsl] Standalone XSLT processor for FreeBSD.
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 7 May 2003 23:26:13 -0600 (MDT)

Ben Trafford wrote:
> 	Does anybody know of a standalone XSLT processor that will work on 
> FreeBSD? It must not require anything outside itself (e.g. libraries, Java, 
> etc.).
> 
> 	I just want something where I can type "./xsltprocessor [command line]" 
> and have it work.

All XSLT processors that meet your criteria are still going to rely on an XML
parser external to themselves. For example, the ones that are the least hassle
out of the box, sablotron and libxslt, still require the expat and iconv C
libraries. You probably installed them when you set up your system, or perhaps
they got installed when you added some other packages, but it's still
conceivable that you could have a system that doesn't have them.

If you're asking because you want something guaranteed to work when
distributed in binary form, then you want a C based processor distributed as a
static binary that has all the libs it needs compiled in. You might be able to
find someone to build a static binary for you, but you probably won't find any
online for download.

I think your latter requirement is the key. It's actually not hard to set up
any of the commonly available XSLT processors to meet your requirements. I
have oraxsl, saxon, xalan, sabcmd, libxslt, 4xslt all running from the command
line on my FreeBSD system.

I use shell aliases for OraXSL (the XSLT processor that comes with Oracle
XDK-whatever-whatever), Saxon 6.5.2, and Xalan-J 2.4.1. I use tcsh, so the
syntax I use to make the aliases is

  alias oraxsl java -classpath /home/mike/xml/oracle/lib/xmlparserv2.jar:/home/mike/xml/oracle/lib/xmlmesg.jar oracle.xml.parser.v2.oraxsl
  alias saxon java -classpath /home/mike/xml/saxon:/home/mike/xml/saxon/saxon.jar com.icl.saxon.StyleSheet
  alias xalan java -classpath /home/mike/xml/xalan/bin/xalan.jar:/home/mike/xml/xalan/bin/xml-apis.jar:/home/mike/xml/xalan/bin/xercesImpl.jar org.apache.xalan.xslt.Process

For all 3 I just untarred their distributions somewhere and made symlinks to
the actual directories (/home/mike/xml/xalan -> /home/mike/xml/xalan-j_2_4_1,
etc.) so I could upgrade and just update the symlinks rather than all my
aliases.

To install a recent JDK, I installed the Linux Blackdown JDK 1.4.1 port from
the Ports Collection... make sure yours is up to date, and then as root, just
do

  cd /usr/ports/java/linux-blackdown-jdk14
  make
  (and assuming no errors) make install

and then add /usr/local/linux-jdk1.4.1/bin to your path. As you saw above, 
the classpath is set on the command line when calling the JVM, so there's no
need to pfutz with the environment variables.

The C based processors libxslt and sabcmd install right into /usr/local/bin,
so there's not even any setup aside from the install of the software itself.

And now for the plug. The processor I help develop, 4xslt, is part of
4suite... which is, among other things, a library of XML processing tools for
the Python programming language.

I've always got the latest code direct from the CVS server (anon CVS
instructions are on http://4suite.org/ ), but installing any version from
scratch is pretty painless. You just need to have Python installed, preferably
with pyexpat built-in (automatic if you have expat C libs on your system
already, or you can install PyXML 0.8.2 if you don't). I installed my Python
from the packages collection:

  pkg_add -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/python/python-2.2.2_2.tgz

but I'd build from source in the ports collection if I were reinstalling today,
just to be sure it was "in tune" with my system. 

Anyway, once you've got Python, either get the latest 4Suite source (1.0a1) or
a CVS snapshot from ftp://ftp.4suite.org/, untar it, and run

  python setup.py install

from the top directory. This is the standard way of installing Python software.
After it is installed, add /usr/local/lib/python2.2/site-packages/Ft/Share/Bin
to your path, and you can now run 4xslt and various other tools from the command
line.

Also, if you have expat 1.95.5 on your system, it's very crash-prone and you
should replace it. 1.95.2, 1.95.4, and 1.95.6 are more stable.

-Mike

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords