|
next
|
Subject: howto loop through a sequence Author: peter teichert Date: 06 Nov 2007 08:56 AM Originally Posted: 05 Nov 2007 09:59 AM
|
Hi XSLT programmers,
I am looking for a solution how to loop through a sequence.
Please look the following code snippet:
How I can choose $input[1,3,5] and $input[2,4,6] ?
Or should I change the <xsl:apply-templates> statement ?
<xsl:template match="/">
<xsl:variable name="input" as="item()*">
<xsl:sequence select="('B100000', 100, 'B105100', 50, 'B106311', 10)"/>
</xsl:variable>
<xsl:apply-templates select="in:ingredient/in:ing[@in:id=$input[1]]">
<xsl:with-param name="input_amt" select="$input[2]"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="in:ingredient/in:ing">
<xsl:param name="input_amt">0</xsl:param>
<xsl:variable name="GCAL" select="in:GCAL * $input_amt"/>
</xsl:template>
thanks
Peter Teichert
|
|
|