Hi there,
I am very new to XSL. I wanted to do the following:
Assign a variable named "Total_Amount" in the global scope.
Then I loop through each child nodes using
<xsl:for-each select="RESULTSET/ROW">
and add the node value of "Amount" to the global "Total_Amount" variable and finally display it as Grand Total at the end.
<xsl:variable name="Total_Amount"><xsl:value-of select="$Total_Amount + $Amount"/></xsl:variable>
But the global variable is not being modified. It seems that it creates a local variable with the same name of the global variable.
Also it seems that a variable within the for loop is not global even within each iteration of the loop.
I have no idea how to work this around.
Please shed some lights on my issue.
Thanks a lot.
Hameed
I am very new to XSL. I wanted to do the following:
Assign a variable named "Total_Amount" in the global scope.
Then I loop through each child nodes using
<xsl:for-each select="RESULTSET/ROW">
and add the node value of "Amount" to the global "Total_Amount" variable and finally display it as Grand Total at the end.
<xsl:variable name="Total_Amount"><xsl:value-of select="$Total_Amount + $Amount"/></xsl:variable>
But the global variable is not being modified. It seems that it creates a local variable with the same name of the global variable.
Also it seems that a variable within the for loop is not global even within each iteration of the loop.
I have no idea how to work this around.
Please shed some lights on my issue.
Thanks a lot.
Hameed