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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to