Remove child <fo:block id="last-page"/> from the <fo:static-content> parent.
Add <fo:block id="last-page"> to parent <fo:flow> as the one and only child
(encompasses every other child that is currently in fo:flow).  Add the end
tag for the fo:block just before the </fo:flow>.

BTW, this is an FAQ.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 08, 2003 1:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Page number


Here is the error

org.apache.fop.apps.FOPException: The id "last-page" already exists in this
document
      at
org.apache.fop.datatypes.IDReferences.createID(IDReferences.java:77)
      at org.apache.fop.fo.flow.Block.layout(Block.java:148)
      at org.apache.fop.fo.flow.StaticContent.layout(StaticContent.java:73)
      at
org.apache.fop.fo.pagination.PageSequence.layoutStaticContent(PageSequence.j
ava:428)
      at
org.apache.fop.fo.pagination.PageSequence.formatStaticContent(PageSequence.j
ava:392)
      at
org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:358)
      at
org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:290)
      at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:218)
      at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown

Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
      at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
      at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.fop.apps.Driver.render(Driver.java:457)

Here is the style sheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl
="http://www.w3.org/1999/XSL/Transform"; xmlns:fo
="http://www.w3.org/1999/XSL/Format"; exclude-result-prefixes="fo">
  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent
="yes"/>
  <!-- ========================= -->
  <!-- root element: projectteam -->
  <!-- ========================= -->
  <xsl:template match="Report">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
      <fo:layout-master-set>

 <fo:simple-page-master master-name="simpleA4" page-height="21cm"
page-width="29.7cm" margin-top="2cm" margin-bottom="2cm" margin-left="1cm"
margin-right="1cm"
 writing-mode="tb-rl">
<fo:region-before extent="4cm"/>
   <fo:region-after extent="1cm"/>
          <fo:region-body margin-top="2cm" margin-bottom="2cm"/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence initial-page-number="1" language="en" country="us"
master-reference="simpleA4">

  <fo:static-content  flow-name="xsl-region-before">
 <fo:block font-size="16pt"   space-after="2mm"><xsl:value-of select
="projectname"/>
</fo:block>
 <fo:block font-size="10pt"  color="red"  font-style="italic"  space-after
="5mm"><xsl:value-of select="reportInfo"/>
</fo:block>
</fo:static-content >
<fo:static-content flow-name="xsl-region-after">
          <fo:block text-align="center">page
<fo:page-number/><fo:page-nuber-citation ref-id="last-page"/> of</fo:block>

<fo:block id="last-page"/>
</fo:static-content>

        <fo:flow flow-name="xsl-region-body">



 <fo:block font-size="8pt"  space-after="2mm">
            <fo:table table-layout="auto"  text-align="center">
<xsl:variable name="reportName"><xsl:value-of select
="reportname"/></xsl:variable>
 <xsl:choose>
<xsl:when test="$reportName='RPT_USER_ACCESS'"><xsl:call-template name
="RPT_USER_ACCESS"/></xsl:when>
 <xsl:when test="$reportName='RPT_TECH_ACCESS'"><xsl:call-template name
="RPT_TECH_ACCESS"/></xsl:when>
 <xsl:when test="$reportName='RPT_NB_BY_DISPCDE'"><xsl:call-template name
="RPT_NB_BY_DISPCDE"/></xsl:when>
<xsl:when test="$reportName='RPT_NB_BY_NR'"><xsl:call-template name
="RPT_NB_BY_NR"/></xsl:when>
<xsl:when test="$reportName='RPT_FOR_TOTAL'"><xsl:call-template name
="RPT_FOR_TOTAL"/></xsl:when>
</xsl:choose>


   <fo:table-header reference-orientation="90" >
 <fo:table-row text-align="center" background-color="#A1A1A1">
<xsl:for-each select="ColumnHeader">
<fo:table-cell border-style="solid" border-width="0.2mm" padding ="1.5mm"
>
  <fo:block><xsl:value-of select="text()"/></fo:block>
  </fo:table-cell>
 </xsl:for-each>
 </fo:table-row>
</fo:table-header>
   <fo:table-body reference-orientation="90"  >
                <xsl:apply-templates select="Row"/>
              </fo:table-body>
            </fo:table>
          </fo:block>

</fo:flow>

      </fo:page-sequence>
    </fo:root>
  </xsl:template>
  <!-- ========================= -->
  <!-- child element: member     -->
  <!-- ========================= -->
  <xsl:template match="Row">
<fo:table-row>
<xsl:for-each select="Column">
      <fo:table-cell border-style="solid"   border-width="0.2mm" padding
="1.5mm">
        <fo:block>
          <xsl:value-of select="text()"/>
        </fo:block>
      </fo:table-cell>
      </xsl:for-each>
    </fo:table-row>
  </xsl:template>

  <xsl:include href="/includes.xsl"/>

</xsl:stylesheet>








"Partridge, Michael" <[EMAIL PROTECTED]> on 04/08/2003 12:03:36
PM

Please respond to [EMAIL PROTECTED]

To:    [EMAIL PROTECTED]
cc:
Subject:    RE: Page number


Exactly what happens when you try that? Do you get a compiler error or a
transformer error? Also, please post your stylesheet so we can look at
it. Thanks.

Mike

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 08, 2003 10:42 AM
To: [EMAIL PROTECTED]
Subject: Page number



Hai,

I am tryinf to print page # in the format  1 0f 12.
I included the following tags it does not work.

<fo:block id="last-page"/>

and the tag
<fo:page-nuber-citation ref-id="last-page"/>  @ the end of follow.

Could anyone pls help, in getting page number in the above mentioned
format.

Thanks
Vikram



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


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










---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

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

Reply via email to