Refer variables from XSLT Include or Import
Is it possible to refer a variable from Include/Import
<xsl:template match="/">
<xsl:for-each select="Data">
<xsl:variable name="Type" select ="Type" />
<xsl:choose>
<xsl:when test="$Type= 'Test1'">
<xsl:variable name="Count">10</variable>
<xsl:variable name="First">First </variable>
</xsl:when></xsl:choose></xsl:for-each>
The above template, i am using as include in the following xslt. Which seems not working. I have conditions based the Type, then the variable list changes, The dynamic variable i am trying to refer to the following xslt to make a generic template
<xsl:for-each select="/ematrix/businessObject">
<xsl:variable name="Type" select="./Type"/>
<xsl:choose>
<xsl:when test="$Type = 'Test1">
<xsl:value-of select="$Count"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
Error i am getting is Variable $Count has not been declared, $Count is a number, i am trying to loop through that number with other declared variables as a tag name values
Appreciate your help in advance
Last edited by chilly; July 21st, 2010 at 05:29 PM..
|