tyris
July 12th, 2001, 11:53 AM
hi all,
i try to do this :
[declare a variable called x]
<!-- locate Product index and keep it in a variable -->
<xsl:template match="document/tables/table/columnHeaders/columnHeader">
<xsl:if test="@text[.='Project']">
[make x = position()]
</xsl:if>
</xsl:template>
<!-- make a comparison with each column index to know if it's a product-->
<xsl:template match="/">
<xsl:for-each select="document/tables/table/rows/row">
<xsl:for-each select="column">
[if position() = the x i have initialise before then display]
</xsl:for-each>
</xsl:for-each>
the problem is that it seems that in the last part (<xsl:template match="/">) x is unknown. what is the way to :
1. define a variable
2. give this variable a value in one template
3. red this value in an other template
regards ;-)
elise
i try to do this :
[declare a variable called x]
<!-- locate Product index and keep it in a variable -->
<xsl:template match="document/tables/table/columnHeaders/columnHeader">
<xsl:if test="@text[.='Project']">
[make x = position()]
</xsl:if>
</xsl:template>
<!-- make a comparison with each column index to know if it's a product-->
<xsl:template match="/">
<xsl:for-each select="document/tables/table/rows/row">
<xsl:for-each select="column">
[if position() = the x i have initialise before then display]
</xsl:for-each>
</xsl:for-each>
the problem is that it seems that in the last part (<xsl:template match="/">) x is unknown. what is the way to :
1. define a variable
2. give this variable a value in one template
3. red this value in an other template
regards ;-)
elise