You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Petr Zeman <Pe...@jlabs.cz> on 2001/09/13 11:03:30 UTC
Re: Getting number of rendered pages
Sorry,
but after calling command from your example
<xsl:variable name="loc"><fo:page-number-citation ref-id="@id"/></xsl:variable>
is variable "loc" empty. Could't you why? I tried fop 0.20.1.
My tested version:
<!-- conditional adding even page -->
<xsl:template name="addEvenPage">
<xsl:param name="attrPageNumber"/>
<xsl:variable name="pNumber"> <fo:page-number-citation ref-id="{$attrPageNumber}"/> </xsl:variable>
<fo:block break-before="page"> page : <xsl:value-of select="$pNumber"/> </fo:block>
<fo:block> page: <fo:page-number-citation ref-id="{$attrPageNumber}"/> </fo:block>
<fo:block> mod : <xsl:value-of select="number($pNumber) mod 2"/> </fo:block>
<fo:block> id : <xsl:value-of select="$attrPageNumber"/> </fo:block>
</xsl:template>
<!-- end of definitions -->
Petr Zeman
----- Original Message -----
From: "GALLO Jean-Claude" <Je...@airbus.aeromatra.com>
To: <fo...@xml.apache.org>
Sent: Monday, July 30, 2001 9:46 AM
Subject: RE: Getting number of rendered pages
Erik
try java-extensions. This help you to write external Java classes directly
callable from your XSL transformation rules.
a simple exmaple :
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
xmlns:xjava="xalan:://mycompany.util.PrintInfo"
xmlns:java="http://www.apache.org/xslt/java"
exclude-result-prefixes="java">
....
<xsl:template match ="TITLE">
<xsl:variable name="loc"><fo:page-number-citation
ref-id="@id"/></xsl:variable>
<xsl:variable name="title" select="text()"/>
<xsl:value-of select="ejava:putValue($loc, $title)"/>
<fo:block font-size="11pt"
...
Just select the right place to put such rules in order to detect the start
and the end of your chapters. I suppose you know JDBC to connect java code
to your database.
Good luck.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org