|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: FW: problem integrating xsl iteration
> which would be something like
>
> <xsl:template match="TotalPages">
> <xsl:param name="x" select="."/>
> <xsl:if test="$x != 1">
> <xsl:apply-templates select="."/>
> <xsl:with-param name="x" select="$x - 1"/>
> </xsl:apply-templates> </xsl:if> <a
> href="page{$x}.html"><xsl:value-of select="$x"/></a> </xsl:template>
A potential (non head-recursive :) XSLT 2.0 solution would be:
<xsl:template match="TotalPages">
<xsl:for-each select="for $i in 1 to . return $i">
<a href="page{.}.html"><xsl:value-of select="."/></a>
</xsl:for-each>
</xsl:template>
I'm still learning v.2.0 things - can this all be done in a single xpath
(create the element and the attribute)?
cheers
andrew
|
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








