xsl-list
[Top] [All Lists]

Re: [xsl] simulating for with foreach

2006-07-05 04:01:02

 Do I have to use <xsl:if test="position() mod 4 = 1", or 
in addition to the comments in the reply I just sent,  you don't need to
use xsl:if, just put it in a predicate in the select


<xsl:for-each select="node[position() mod 4 = 1]">

it's usually preferable just to select the nodes you want rather than
select everything and then use an xsl:if as then within the for-each
position() goes in the sequence 1,2,3,4... numbering the items that are
actually being selected, which is often useful.


David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--