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

Re: Getting an error with a variable

Subject: Re: Getting an error with a variable
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 28 Jul 2006 16:25:09 +0530
Re:  Getting an error with a variable
You must declare the variable as following:

<xsl:variable name="sNum">
 <xsl:choose>
   <xsl:when test="0=$paramVal4">
      <xsl:for-each select="/stages/competition/itinerary/stage[1]">
         <xsl:value-of select="@no"/>
      </xsl:for-each>
   </xsl:when>
   <xsl:otherwise>
      <xsl:value-of select="$paramVal2"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:variable>

Regards,
Mukul

http://gandhimukul.tripod.com

On 7/28/06, Garry Searle <garry@xxxxxxxxxxxxxxxxxx> wrote:
Hi all

I have some code which is causing me grief, and my experience isnt enough to
figure it out. I have the code below. The last line creates an error:

msxml3.dll error '80004005'
A reference to variable or parameter 'sNum' cannot be resolved. The variable
or parameter may not be defined, or it may not be in scope.

If I remove the line it works fine. Would someone like to suggest how I can
use the variable.

Thanks
Garry

=============================================
<xsl:choose>
 <xsl:when test="0=$paramVal4">
      <xsl:for-each select="/stages/competition/itinerary/stage[1]">
             <xsl:variable name="sNum">
               <xsl:value-of select="@no"/>
             </xsl:variable>
      </xsl:for-each>
 </xsl:when>

 <xsl:otherwise>
       <xsl:variable name="sNum">
           <xsl:value-of select="$paramVal2"/>
       </xsl:variable>
 </xsl:otherwise>
</xsl:choose>

<h2><xsl:value-of select="$sNum" /></h2> <--- causes error

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.