Search code examples
xmlpdfxsl-fo

Multi page pdf using fop-one page for each person tag


I need to convert my xml data using xsl-fo template into pdf using fop. My XML data looks like.

<resultset>
<person>
</person>
<person>
</person>
<person>
</person>
</resultset>

Each of the person tags need to go into a separate page in the pdf. Can somebody please guide me with a sample xsl-fo template.


Solution

  • this will get you started, depending on what information is in the person tag.

    <xsl:template match="person">
        <fo:block page-break-before="always">
             process the contents of the person tag here
        </fo:block>
    </xsl:template>
    

    Some background info:
    XSLT
    XSL-FO
    XSL-FO 2