Hi,

I use FOP to generate a PDF from a XML file and a SXLT file. I am trying to display something like "Page 1 of 5" in the PDF page header.
.
I found a suggestion from http://www.dpawson.co.uk/xsl/sect3/N8703.html#d9294e31, but I don't understand. It says:


<fo:page-number-citation ref-id="endofdoc"/> will produce it, if the last thing in your document is something with 'id="endofdoc"', e.g. <fo block id="endofdoc"></fo:block>

Given my test data and xlt following, can anyone please help me to produce the "Page 1 of 5" ? Thank you in advance.

R,
Biying

==========data.xml===========================
<AttachmentList>
      <Attachment showImage="true">
          <filename>Image5445.jpg</filename>
          <info>image information</info>
    </Attachment>

    <Attachment showImage="false">
          <filename>Image5446.jpg</filename>
          <info>image information</info>
    </Attachment>
    <Attachment showImage="true">
          <filename>Image5454.jpg</filename>
          <info>image information</info>
    </Attachment>

 </AttachmentList>

=========templates.xsl============================
 <?xml version="1.0" encoding="iso-8859-1"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                  xmlns="http://www.w3.org/1999/XSL/Format";
                  version="1.0">

 <xsl:output indent="yes"/>

 <xsl:template match="/">
 <root font-family="Times" font-size="20pt">

    <layout-master-set>
      <simple-page-master master-name="frame"
                          page-height="210mm" page-width="297mm"
                          margin-top="1cm" margin-bottom="1cm"
                          margin-left="1cm" margin-right="1cm">
        <region-body region-name="frame-body"/>
      </simple-page-master>
    </layout-master-set>

<fo:page-sequence language="en" master-reference="all" format="1"> - <#> <fo:static-content flow-name="xsl-region-before">
<xsl:call-template name="header" />
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="AttachmentList" />
</fo:flow>
</fo:page-sequence>


 </root>
 </xsl:template>

 <xsl:template name="header">
      <!-- How do I display "Page 1 of 1" here ??? -->
      <fo:block>Page</fo:block>

 </xsl:template>


<xsl:template match="AttachmentList"> <fo:block>Test of table columns</fo:block> <fo:table border="solid"> <fo:table-body> <xsl:apply-templates select="AttachmentList"/> </fo:table-body> </fo:table> </xsl:template>

<xsl:template match="Attachment">
<fo:table-row>
<fo:table-cell border="solid">
< <fo:block text-align="center">
<fo:external-graphic><xsl:attribute name="src"><xsl:value-of select="filename" /></xsl:attribute></fo:external-graphic>
</fo:block>
</fo:table-cell>


        <fo:table-cell border="solid">
          <fo:block><xsl:value-of select="info"/></block>
        </fo:table-cell>
      </fo:table-row>
 </xsl:template>


</xsl:stylesheet>


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



Reply via email to