paging

Here should go questions about transforming XML with XSLT and FOP.
Misha
Posts: 2

paging

Fri Dec 01, 2006 2:41 pm

Hi! :)
Im havin xml:
<?xml version="1.0" encoding="iso-8859-1" ?>
<data>
<item id="i1" catalog="s1" subcatalog="u1">561</item>
<item id="i10" catalog="s3" subcatalog="u4">15</item>
<item id="i22" catalog="s2" subcatalog="u2">1234</item> etc
<catalog id="s1">catalog 1</catalog>
<catalog id="s2">catalog 2</catalog>
<catalog id="s3">catalog 3</catalog>

<subcatalog id="u1">Subcatalog 1</subcatalog>
<subcatalogid="u2">Subcatalog 2</subcatalog> etc
</data>

I ve grouped (2-level, using keys) it to recive:
catalog 1

Subcatalog 1

ID Value

id1 value1
...
...
catalog 2

Subcatalog 1

ID Value

id1 value1...
....
etc

I need to output it no more than 30 items/per page with page breaks but (the most interesting) page breakes shoulb be before catalog/subcatalog ONLY not within subcatalog.
Some suggestions? :)
may be like...
<xsl:choose>
<xsl:when test="position()mod 30!=0">
<xsl:choose>
<xsl:when test="(SOME TEST-??? which??)">
<xsl:apply-templates select="following-sibling::item[1]" mode="Mode">
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:text>(PageBreak)</xsl:text>
<xsl:apply-templates select="following-sibling::item[1]" mode="Mode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<span style="page-break-before: always"></span>
<xsl:text>(PageBreak)</xsl:text>
<xsl:apply-templates select="following-sibling::item[1]" mode="Mode"/>
</xsl:otherwise>
</xsl:choose>
Thanks a lot :)

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest