Subject: Re: [xsl] mod position() tests positive all of the time From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Sat, 30 Dec 2006 14:37:04 +0100 |
Cheers, -- Abel Braaksma http://www.nuntia.nl
<xsl:call-template name="results"/>
<xsl:template name="results">What this does highly depends on your input. For instance, if you have a set of "object" nodes, and each has one "thumbnail" node, then this for-each will select all of them (as postion() is always for each first thumbnail node under object). Depending on your input, you may want to write this a little different for readability, but as far as I can tell, this code is not wrong per se.
<table>
<xsl:for-each
select="insightResponse/searchResponse/collectionResultSet/object/thumbnail[position()
mod 5 = 1]">
<tr>
<xsl:apply-templates select=". | following-sibling::thumbnail[position()
< 5]" />
</tr> </xsl:for-each> </table> </xsl:template>
<xsl:template match="thumbnail">
<td align="center"><img src="{@URL}" /><br />
<xsl:for-each select="label"><xsl:value-of select="."/><br
/></xsl:for-each>
</td>
</xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] mod position() tests positive, Allen Jones | Thread | Re: [xsl] mod position() tests posi, Abel Braaksma |
[xsl] mod position() tests positive, Allen Jones | Date | RE: [xsl] mod position() tests posi, cknell |
Month |