|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Calculations in XSL
I need to add two values togethor, both are attributes. I have seen several
examples, all which look like they should work fine, but all of them have
given me this error:
Keyword xsl:variable may not be used here.
^^^^
^^^^
^^^^
^^^^
^^^^
Are there circumstances where xsl:variable cannot be used? I'm using it
like this:
<xsl:variable name="sum" select="$a + $b"/>
If anyone knows of an example that works please could they send me the
script.
It would be easier to offer help if you gave a clue _where_ you are
trying to use xsl:variable. Since the error message says that the error
is in the place where you have the xsl:variable element rather than the
particular attributes in this instance of the element.
As a wild guess you may be falling foul of this rule from section 11.5
of the PR:
A binding shadows another binding if the binding occurs at a point
where the other binding is visible, and the bindings have the same
name. It is an error if a binding established by an xsl:variable or
xsl:param element within a template shadows another binding
established by an xsl:variable or xsl:param element also within the
template.
which says that you can not do two bindings of the same variable name
within the same template.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








