Skip to content Skip to sidebar Skip to footer

Xml, Xslt - Header And Footer On All Pages With Continuing Table Data Contents

I have a requirement to generate PDF file from XML document. And that PDF should have header and footer on each and every page, and in the body of the PDF should have table data fr

Solution 1:

Try following code. Adding page-break-before:always; style for the first generation of tr element will split table by <page> element. This will solve your requirement.

<tbody>
    <xsl:for-each select="order/page[exists(*)]">
        <xsl:for-each-group select="*" group-adjacent="count(self::line_number|preceding-sibling::line_number)">
            <xsl:variable name="pos" as="xs:integer" select="position()"/>
            <tr style="{concat('font-size: 9px;',if ($pos eq 1) then 'page-break-before:always;' else '')}">
                <td>
                    <xsl:value-of select="current-group()[1]"/>
                </td>
                <td>
                    <xsl:value-of select="current-group()[2]"/>
                </td>
            </tr>
        </xsl:for-each-group>
    </xsl:for-each>
</tbody>

Post a Comment for "Xml, Xslt - Header And Footer On All Pages With Continuing Table Data Contents"