Mohamed Abdel Hameed wrote:
i have an xml file which contrain categories and each category cotain some article
...
<category>
    <category-name>Category 1</category-name>
...
</category>
...
and i'd ike to start a new page with every category in the PDF file

There are several possibilites to do this. Most of them are easy to find in the XSLFO spec at http://www.w3.org/TR/xsl

The preferred method to use with FOP is to generate
a fo:page-sequence for every category. This is very
easy to achieve in XSLT:
  <xsl:template match="category">
    <fo:page-sequence master-reference="...">
      <fo:flow flow-name="xsl-region-body">
        <xsl:apply-templates/>
      </fo:flow>
    </fo:page-sequence>
  </xsl:template>

Complete this with your own page master name and static content.
If you want to set up your static content somewhere else, pass
it as parameter and use xsl:copy-of to put it into the right
place.

You can also use break-before="page" and similar porperties
to insert page breaks.

J.Pietschmann



Reply via email to