[Home] [By Thread] [By Date] [Recent Entries]
Hi,
Backwards from Andrew's answer: <xsl:stylesheet ...> <xsl:variable name="repeater" select="/input/repeat"/> <xsl:template match="repeat"/> <!-- suppresses output on default traversal --> <xsl:template match="data">
<xsl:for-each select="item">
<xsl:apply-templates select="$repeater" mode="repeat">
<xsl:with-param name="item" select="."/>
<xsl:with-param name="pos" select="position()"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template><xsl:template match="repeat" mode="repeat">
<xsl:param name="item" select="/.."/>
<xsl:param name="pos" select="0"/>
<item>
<xsl:apply-templates>
<xsl:with-param name="item" select="$item"/>
<xsl:with-param name="pos" select="position()"/>
</xsl:apply-templates/>
</item>
</xsl:template><xsl:template match="value-of"> <xsl:param name="item"/> <xsl:value-of select="$item"/> </xsl:template> <xsl:template match="position-of"> <xsl:param name="pos"/> <xsl:value-of select="$pos"/> </xsl:template> </xsl:stylesheet> Untested. Cheers, Wendell
|

Cart



