Thanx Joerg and Colin
It is working fine
Thanx again for your help. This is how i have done it
<xsl:template match="report">
<xsl:param name="ReportNo" select="position()"/>
   <fo:page-sequence master-name="report" initial-page-number="1" >
     <fo:static-content flow-name="xsl-region-after">
       <fo:block text-align="end">
        <xsl:text>Page </xsl:text>
        <fo:page-number/>
        <xsl:text> of </xsl:text>
        <fo:page-number-citation ref-id="{$ReportNo}"/>
       </fo:block>
     </fo:static-content>
     <fo:flow flow-name="xsl-region-body">
       <xsl:apply-templates/>
       <fo:block id="{$ReportNo}"/>
     </fo:flow>
    </fo:page-sequence>
  </xsl:template>

wali


Hi wali,
>but one problem still persists.... can't do it coz FOP does not allow to
>declare a block with same id more than once in a document.
Use an individually generated id for each end-block. There are various
methods in XSL (so this is more a Q for the XSL-List). Try generate-id()
for most robustness. The following uses the generated id of the report
element which generates the flow. untested)

  <xsl:template match="report">
   <fo:page-sequence master-name="report" initial-page-number="1" >
     <fo:static-content flow-name="xsl-region-after">
       <fo:block text-align="end">
        <xsl:text>Page </xsl:text>
        <fo:page-number/>
        <xsl:text> of </xsl:text>
        <fo:page-number-citation ref-id="endofflow-{generate-id()}"/>
       </fo:block>
     </fo:static-content>
     <fo:flow flow-name="xsl-region-body">
       <xsl:apply-templates/>
       <fo:block id="endofflow-{generate-id()}"/>
     </fo:flow>
    </fo:page-sequence>
  </xsl:template>

If you want to refer to the last page number from somewhere else,
you'll have to supply a XPath to the "report" element which created
the flow, for example generate-id(ancestor::report) or
generate-id(//report[2]) or something, depending of the context.

HTH

Joerg Pietschmann






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to