Thanks,
Tried that but now get the following error when trying to convert the .fo file to a .pdf file using org.apache.fop.apps.Fop:
fo:flow must contain block level children.
I have attached my .xsl file (as it is not too long) and left the suggested <xsl:for-each...> in See line 33.
Any other ideas, or is my xsl wrong!!.
Thanks Andrew
XSL FILE:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin-right="25pt" margin-left="25pt"
page-height="8.0in" page-width="11in"
margin-bottom="15pt" margin-top="15pt" master-name="odd">
<fo:region-before extent="25pt"/>
<fo:region-body margin-top="30pt" margin-bottom="30pt"/>
<fo:region-after extent="25pt"/>
</fo:simple-page-master>
<fo:simple-page-master margin-right="25pt" margin-left="25pt"
page-height="8.0in" page-width="11in"
margin-bottom="15pt" margin-top="15pt" master-name="even">
<fo:region-before extent="25pt"/>
<fo:region-body margin-top="30pt" margin-bottom="30pt"/>
<fo:region-after extent="25pt"/>
</fo:simple-page-master><fo:page-sequence-master master-reference="odd">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="even" odd-or-even="even"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<xsl:for-each select="/iDocSys/PortfolioList/Portfolio">
<fo:page-sequence master-reference="even" initial-page-number="1"> <!-- need to alter the page number -->
<!-- <fo:static-content flow-name="xsl-region-before">
<fo:block text-align="end"
font-size="8pt"
font-family="serif"
line-height="10pt">Page <fo:page-number/>
</fo:block>
</fo:static-content> --> <fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="iDocSys"/>
</fo:flow> </fo:page-sequence>
</xsl:for-each>
</fo:root>
</xsl:template> <xsl:template match="iDocSys">
<xsl:apply-templates select="PortfolioList"/>
</xsl:template><xsl:template match="PortfolioList">
<xsl:for-each select="Portfolio">
<fo:block line-height="24pt" font-size="8pt" text-align="left" break-after="page">
<fo:table table-layout="fixed" width="270mm">
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="90mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="25mm"/>
<fo:table-header>
<fo:table-row keep-together="always">
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="18pt" vertical-align="top">
<xsl:text>Portfolio No</xsl:text>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="18pt" font-weight="bold" vertical-align="top">
<xsl:value-of select="PortfolioName"/>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2">
<fo:block line-height="18pt" font-weight="bold" vertical-align="top">
<xsl:value-of select="PortfolioTown"/>
<xsl:text> </xsl:text>
<xsl:value-of select="PortfolioAddress"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="18pt" vertical-align="top">
<xsl:value-of select="CreationDate"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end" vertical-align="top"
font-size="8pt"
font-family="serif"
line-height="10pt">Page <fo:page-number/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
File
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Drg No
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Rev
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Title
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Type
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Status
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Unit
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="14pt" font-weight="bold" text-align="left" vertical-align="middle"
border-width="1pt" border-color="black">
Floor
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body font-size="8pt" font-family="sans-serif">
<xsl:for-each select="DisciplineList">
<xsl:for-each select="Discipline">
<xsl:for-each select="SourceList">
<xsl:for-each select="Source">
<fo:table-row keep-together="always">
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" vertical-align="top"><xsl:value-of select="SourceName"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" vertical-align="top"><xsl:value-of select="../../DisciplineName"/></fo:block>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="Documents">
<xsl:for-each select="Document">
<xsl:sort select="DocRefPartOne"/>
<xsl:sort select="RevisionNo"/>
<xsl:sort select="Unit"/>
<xsl:sort select="Floor"/>
<xsl:for-each select="FileList/File">
<fo:table-row keep-together="always" space-after="4mm">
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="FileName"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../DocRefPartOne"/><xsl:value-of select="../../DocRefPartTwo"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="RevisionNo"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../Title"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../Type"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../Status"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../Unit"/></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="12pt" vertical-align="top"><xsl:value-of select="../../Floor"/></fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Zieseni�, Markus wrote:
I would put a for-each loop around the main page-sequence like:
<xsl:for-each select="ChAPTER">
<fo:page-sequence master-reference="alleSeiten" initial-page-number="1">
<fo:static-content flow-name="xsl-region-after"> <fo:block font-family="serif" font-size="10pt" font-style="normal" font-weight="normal" text-align="left" start-indent="2.0cm">
Seite <fo:page-number/>,
</fo:block> </fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="YOUR-TEMPLATES"/> </fo:flow>
</fo:page-sequence>
</xsl:for-each>
greetings Markus
-----Urspr�ngliche Nachricht----- Von: andrew mercer [SMTP:[EMAIL PROTECTED] Gesendet am: Montag, 24. Februar 2003 12:15 An: [EMAIL PROTECTED] Betreff: How do I rest Page Number to 1 for each new section/chapter
Hi,
Sorry if this is in the Archive, I have searched it and the FAQ to no avail.
I am trying to create a pdf file from an xml file that is converted using fop. The layout is based mainly on tables/rows etc.
I can successfully create the document, however I have many sections within the whole document that need to to be numbered separatley. Therefore at the start of each new section the page number should revert to one and then increment by one for each new page.
At present the page numbers will keep incrementing from the initial value of one for each new page so they relate to the number of pages for the whole document.
My xsl document is available if that helps.
Thanks Andrew Mercer --
Andrew Mercer, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites.
--------------------------------------------------------------------- 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]
--
Andrew Mercer, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
