Re: [xsl] XSLT Compiler for C/C++?

Subject: Re: [xsl] XSLT Compiler for C/C++?
From: "James A. Robinson" <jim.robinson@xxxxxxxxxxxx>
Date: Thu, 12 Jun 2008 09:10:35 -0700
> Does anyone know of an existing XSLT Compiler for C or C++, such that it
> takes as input an XSL stylesheet and outputs some form of executable
> code, binary, compiled C code, assembly, shared library, etc. which can
> then be directly executed to convert XML files?

Is part of your requirement that the executable be using a 'precomiled'
stylesheet, so that it is not spending any time performing that task?

If not, and if XSLT 1.0 is acceptable, you could build something yourself
by using libxslt or Xalan C++.  You'd write a C program which actually
embeds a stylesheet (as a static char *), and takes as its argument the
target XML file, internally calling the XSLT API routines to process
the two.

Writing an generic C program and a few python (or perl or awk) scripts
could net you a system where you call a script to build an executable by
combining the target stylesheet and the generic C program to output the
stylesheet-specific C, which could then be compiled into an executable.
An exercise in meta programming, I suppose.

There'd be overhead in that the program would have to parse and reparse
the embedded stylesheet on each execution, I'm not sure how much of
an impact that would be.

I'd point out that setting up a long running Java based processor
(Saxon in our case) which can consume the input documents and execute
pre-compiled stylesheets can be made very fast.  That's the route we
went with our new publication processing system, and it's worked out
very well for us.


Jim

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       jim.robinson@xxxxxxxxxxxx
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)

Current Thread