[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Calculations in XSL

Subject: Re: Calculations in XSL
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 25 Oct 1999 15:44:51 +0100 (BST)
xsl variable calculations
   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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.