Jump to content

Modifying Variable value


Guest Tejas

Recommended Posts

Guest Tejas

I am new to XSL. I face some problem xsl. In my application I need to calculate Weighted average. Here I need to store summation in temporary variable. But I came to know that, I can't re-assign value of a variable in XSL!!!(How it's named variable??! :) ) Does anybody know the workaround for the same?

Link to comment
Share on other sites

The xsl:variable is only made as a temporary store for data that would otherwise be hard to get in a match.The xsl:param can be changed once per template. If you really need to change a value that often, you can create a template that calls itself with the new value as a parameter of it, possibly executing another template on a certain condition.Btw, XSLT 2.0 has the avg() function, ideal for finding the average value in a node-set.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...