RE: [Illegal?] setting xsl:variable inside 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!
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