|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSL N-up like Reports
Hi,
> I need to develop N-up reports using XSL for XML data like this. This
> includes paging.
>
> Page 1 for provider "Z"
> ~~~~~~~~~~~~~~~~~~~~~~~
>
> +---------+
> | 1 | 4 |
> |--------+
> | 2 | 5 |
> |---------+
> | 3 | 6 |
> +---------+
>
> Page 2 (contd.) for provider "Z"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> +---------+
> | 7 | 10 |
> |---------+
> | 8 | 11 |
> |---------+
> | 9 | |
> +---------+
>
> Page 2 for provider "Y"
> ~~~~~~~~~~~~~~~~~~~~~~~~
> +-----+
> | 12 |
> |-----+
> | 13 |
> +-----+
e.g.
<xsl:key name="provider" match="roaming" use="@provider" />
<xsl:template match="billing">
<xsl:for-each select="roaming[generate-id(.) = generate-id(key('provider', @provider))]">
<xsl:for-each select="key('provider', @provider)[position() mod 6 = 1]">
<table>
<caption>
<xsl:text/>Page <xsl:value-of select="position()" />
<xsl:if test="not(position() = 1)"> (contd.)</xsl:if>
<xsl:text/> for provider "<xsl:value-of select="@provider" />"<xsl:text/>
</caption>
<tbody>
<xsl:for-each select="self::* | following-sibling::roaming[position() < 7][position() mod 2 = 1]">
<tr>
<td>
<xsl:value-of select="." />
</td>
<xsl:if test="following-sibling::roaming[position() = 3]">
<td>
<xsl:value-of select="following-sibling::roaming[position() = 3]" />
</td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
Hope this helps. Launch auto-documentation daemon and all that,
Jarno - SITD: Hurt (Club Version)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








