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

RE: [Illegal?] setting xsl:variable inside xsl:if code

Subject: RE: [Illegal?] setting xsl:variable inside xsl:if code block
From: "Wong Chin Shin" <publicbbs@xxxxxxxxxxxxxxxx>
Date: Thu, 2 Dec 2004 16:02:44 +0800
xsl if code
It's the 2nd case :) I was trying to conditionally set the variable and then
save it for later use outside of the block. Oh well, as long as I know why.

Thanks!

-----Original Message-----
From: Raffaele Sena [mailto:raff@xxxxxxxxxxxx] 
Sent: Thursday, December 02, 2004 10:36 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  [Illegal?] setting xsl:variable inside xsl:if code block

I am not sure of what you are trying to do.

If you are trying to "change" the value of a variable that you defined
outside the "if" statement, it's an error (XSLT doesn't allow you to change
the value of variables).

If you are trying to set the variable inside the "if" block and use it
outside the "if" block, it's an error, because the variable exists only in
the scope of the "if" block.

If you are setting and using the variable inside the "if" block, it should
work because creation and use will be in the same block.

-- Raffaele

-----Original Message-----
From: Wong Chin Shin [mailto:publicbbs@xxxxxxxxxxxxxxxx] 
Sent: Wednesday, December 01, 2004 6:08 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  [Illegal?] setting xsl:variable inside xsl:if code block

Hi,

I got an error when I tried to do the following:

<xsl:if test="$x=$y">
	<xsl:variable something something>
</xsl:if>

It says it can't find the variable or something to that effect. How do I
accomplish this? 

Thanks!
Wong



!DSPAM:41ae6f4c275021367519020!

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.