Re: FO->Area as XSLT extension function

On Tue, March 19, 2013 11:55 pm, Arved Sandstrom wrote:
...
> Attached is a modified extension for FOP 1.0. Also a run script that
> indicates the use of FOP 1.0 included JARs.
>
> Also, for FOP 1.0 this version of extension does not specify a FOP
> config file, so it's called like
>
> <xsl:value-of select="runfop:RunFOP.areaTreeUrl($foTree, 'example1.if')"/>

Thanks for that.  I could, of course, have just installed FOP 1.1, but I
was trying to work towards something that could work 'out of the box',
even if only on a Linux/Ubuntu system for now.

My shell script became:

----------------------
#!/bin/bash

JAVA_LIB=/usr/share/java
CP=$JAVA_LIB/fop.jar
CP=$CP:$JAVA_LIB/xalan-2.7.0.jar
CP=$CP:$JAVA_LIB/xercesImpl-2.7.1.jar
CP=$CP:$JAVA_LIB/xml-apis-1.3.04.jar
CP=$CP:$JAVA_LIB/serializer-2.7.0.jar
CP=$CP:$JAVA_LIB/xmlgraphics-commons-1.4.jar
CP=$CP:$JAVA_LIB/commons-logging-1.0.4.jar
CP=$CP:$JAVA_LIB/commons-io-1.3.1.jar
CP=$CP:$JAVA_LIB/avalon-framework-4.2.0.jar
CP=$CP:$JAVA_LIB/batik-all-1.7.jar
CP=$CP:FOPRunXSLTExt_1_0.jar
java -cp $CP org.apache.xalan.xslt.Process -IN $1 -XSL $2 -OUT $3
-----------------------

and after using the modified xsl:value-of that you provided, it worked for
me.

I could use a xsl:message to output the height of the viewport, but I
couldn't easily get the size of any of the created fo:block.  When I added
an @id to the source and modified the stylesheet to copy it into the FO,
it didn't show in the intermediate format file, which is going to make
things difficult since I've been figuring that one of the ways to avoid
having to do XPaths of the form:

   document($url)/if:document/if:page-sequence[1]/if:page[1]/if:content[1]/if:viewport[1]/@height

will be to insert IDs into the FO and use key() to look up based on the ID.

Regards,


Tony.

Received on Thursday, 21 March 2013 23:15:00 UTC