xsl-list
[Top] [All Lists]

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

2004-12-02 01:02:44
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(_at_)aromatic(_dot_)org] 
Sent: Thursday, December 02, 2004 10:36 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] [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(_at_)nascencetech(_dot_)com] 
Sent: Wednesday, December 01, 2004 6:08 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] [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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



!DSPAM:41ae6f4c275021367519020!



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>