Subject: Re: [xsl] two at a time, using a sequence expression From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 05 Jun 2008 18:33:26 +0200 |
<xsl:template match="/pairs"> <xsl:copy> <xsl:for-each select="for $i in 1 to (count(*) idiv 2 + (count(*) mod 2)) return *[($i*2)-1]"> <pair> <xsl:copy-of select="." /> <xsl:copy-of select="./following-sibling::*[1]" /> </pair> </xsl:for-each> </xsl:copy> </xsl:template>
<xsl:template match="/pairs"> <xsl:copy> <xsl:for-each select="*[position() mod 2 = 1]"> <pair> <xsl:copy-of select="."/> <xsl:copy-of select="following-sibling::*[1]"/> </pair> </xsl:for-each> </xsl:copy> </xsl:template>
Martin Honnen http://JavaScript.FAQTs.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] two at a time, using a sequen, John Cavalieri | Thread | RE: [xsl] two at a time, using a se, Michael Kay |
[xsl] two at a time, using a sequen, John Cavalieri | Date | [xsl] searching for occurrences of , Julie |
Month |