|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sample Code for multiple fo:page-sequence
At 2002-12-19 15:52 -0500, Prateek Gupta wrote:
- call for a page sequence per new page, wherein I specify that the number of records per page is, say, 5 Can anyone point out how I can re-code my XSL. This is another example of going from no structure (a single collection of rows) into structure (multiple collections of nodes). An example is below. I hope this helps. ................ Ken
<xsl:output indent="yes"/> <xsl:template match="table">
<result>
<xsl:for-each select="row[ position() mod 5 = 1 ]">
<page-sequence>
<table>
<xsl:copy-of select="."/>
<xsl:for-each select="following-sibling::row[ position() < 5 ]">
<xsl:copy-of select="."/>
</xsl:for-each>
</table>
</page-sequence>
</xsl:for-each>
</result>
</xsl:template></xsl:stylesheet> T:\ftemp>xt prateek.xml prateek.xsl <?xml version="1.0" encoding="utf-8"?> <result> <page-sequence> <table> <row>Row 1</row> <row>Row 2</row> <row>Row 3</row> <row>Row 4</row> <row>Row 5</row> </table> </page-sequence> <page-sequence> <table> <row>Row 6</row> <row>Row 7</row> <row>Row 8</row> <row>Row 9</row> <row>Row 10</row> </table> </page-sequence> <page-sequence> <table> <row>Row 11</row> <row>Row 12</row> <row>Row 13</row> <row>Row 14</row> <row>Row 15</row> </table> </page-sequence> <page-sequence> <table> <row>Row 16</row> <row>Row 17</row> <row>Row 18</row> <row>Row 19</row> <row>Row 20</row> </table> </page-sequence> <page-sequence> <table> <row>Row 21</row> <row>Row 22</row> <row>Row 23</row> <row>Row 24</row> <row>Row 25</row> </table> </page-sequence> <page-sequence> <table> <row>Row 26</row> <row>Row 27</row> </table> </page-sequence> </result>
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Next conference training: 2003-03-03,06 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








