Wrox Programmer Forums
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2008, 01:28 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>and I don't understand it

As my maths teacher used to ask, which part of it don't you understand?

<xsl:for-each select="x[position() mod $N = 1]"

Assuming $N is 3, this will select x[1], x[4], x[7] and so on. It will then output a new row in your output table once for each one of these selected elements.

<xsl:for-each select=". | following-sibling::x[position() &lt; $N]">

Assuming $N is 3 and you are processing x[1], this will select x[1], x[2], and x[3] and output a new cell for each of these three elements. Similarly when you are processing x[4], it will output a new cell for each of x[4], x[5], and x[6].

I hope that makes it clearer and will enable you to start debugging your code.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.