[xuriella-devel] Looking for a general approach
David Lichteblau
david at lichteblau.com
Fri Dec 3 17:00:42 UTC 2010
Hi.
Xuriella's method of stylesheet compilation is roughly like this:
1. parse the .xslt into memory, using STP.
2. transform the STP nodes into a sexp representation
3. compile the sexps into lambdas
(then at runtime, i.e. transformation time, the lambdas get invoked).
You can hook into step #2 using xuriella:define-extension-parser.
Quoting Andrei Stebakov (lispercat at gmail.com):
> I looked into the extension functions and it looks like you can only
> define them in terms of XSLT language itself. I couldn't find a way to
> use external (lisp) functions for that purpose.
If your extension is just a macro-like mechanism on top of other XSLT
facilities, this is all you need. Just expand into the sexps for the
XSLT calls you'd like to expand into.
But you can also hook into #3 using define-extension-compiler as a
second step, allowing you to compile into arbitrary Lisp code.
d.
More information about the xuriella-devel
mailing list