views:

499

answers:

1

I am attempting to parse an XML document against an XSLT 2.0 sheet. However, I am being told that the libraries on OSX 10.5.x only support XSLT 1.0 operations. When I look at xsltproc, I get this:

hmasing$ xsltproc --version Using libxml 20616, libxslt 10112 and libexslt 810 xsltproc was compiled against libxml 20616, libxslt 10112 and libexslt 810 libxslt 10112 was compiled against libxml 20616 libexslt 810 was compiled against libxml 20616

Does anyone have a concise guide to installing XSLT 2.0, the ruby xslt gems to work against those libs, and some good fu to pass my way? Please assume I am a total idiot in any instructions. Any help is greatly appreciated!

  • Hans
+1  A: 

Sadly, Saxon is the only game in town with a free XSLT 2.0 implementation. Saxon itself is brilliant, but it is Java or .NET only, with all that that implies.

Invoking it from the command line or via a system call will incur a JVM startup cost every time, so you probably don't want to do that.

Some things you can try:

1) Are you sure you need XSLT 2.0? Unless you're using functionality that isn't in 1.0, your XSLT might be 1.0-compatible. Then you could use xsltproc. If what you need is in EXSLT, xsltproc has some support for that.

2) If you definitely need 2.0, then you'll want to create some sort of wrapper for saxon. A lot depends on what environment you want to use this in, so this might be a web service or something like that. For a project I work on, we use a little TCP listener program that wraps saxon. You can see it here: http://idp.atlantides.org/svn/idp/idp.contenttool/trunk/epiduke_saxon/ It works well for command-line batch transforms, and is very fast.

hcayless
Java shouldn't technically be a problem on OSX. Isn't there some kind of builtin Java layer on the system that should at least help with the speed?
MrZombie