FO->Area as XSLT extension function

Ok, I've got product, just not sure how to best disseminate. So I've 
attached stuff. I suspect that my NetBeans project I'll want to get into 
Mercurial or whatever it was that we set up.

There is no doubt but that this is a version 0.1 attempt. I don't use 
XSLT enough to be particularly good at it.

Explanation of attachments:

1. example1.xml: self-explanatory, a trivial test XML.

2. example1fo.xsl: this stylesheet executes the transform to FO and then 
calls FOP on the FO via the Xalan extension function. The name of the 
FOP Intermediate Format file (area tree XML) is supplied as an argument, 
because, hey, where else? It also gets returned as the extension 
function result; probably redundant.

I am rusty enough at XSLT that I had to hardcode the location for the 
FOP configuration file into the argument list for the extension 
function.Just couldn't get variables to work.

3. runxalan.sh: my bash script for running Xalan. Easy enough.

4. RunFOP.java and FOPRunXSLTExt.jar: very simple because our scenario 
is simple. The JAR is referenced from runxalan.sh. I've included the 
souirce code so you can see how uncomplicated this is.

5. example1.if: the Intermediate Format area tree rendering for FOP.

6. example1.url: the XSLT output file (also the result of the extension 
function), namely the location of the IF. But since we knew that to 
specify it to the extension function... :-)

None of this would be difficult to modify or build on.

Arved

Received on Sunday, 17 March 2013 01:57:16 UTC