cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Johnston" <coc...@lojjic.net>
Subject Re: How to asign a value to a variable??
Date Wed, 18 Jan 2006 18:36:35 GMT
> Hi!
>
> I want to define a global variable with no value.
>
> Then I want to asign a value to the variable in a choose-when-select.
>
> I think of something like this (but this one doesn't work):
>
> <xsl:variable name="element" />
>
>     <xsl:for-each select="*">
>
>         <xsl:choose>
>
>             <xsl:when test="local-name() = 'rettungswege'">
>
>                 <xsl:variable name="element" select="rettungswege/rw" />
>
>             </xsl:when>
>
>             <xsl:when test="local-name() = 'trennwaende'">
>
>                 <xsl:variable name="element"
> select="trennwaende/trennwand"
> />
>
>             </xsl:when>
>
>         </xsl:choose>
>
>     </xsl:for-each>
>
> <xsl:for-each select="$element">
>
>     ...do something...
>
> </xsl:for-each>
>
>
>
> Is this possible?
>


Nope, sorry!

"Variables" in XSLT aren't reassignable, so once you create a variable its
value is set.  In this way the term "variable" is a bit of a misnomer.

There are probably other ways besides reassigning variables to accomplish
what you're trying to do though.  Your best bet would be to post to an
XSLT-related mailing list as that's where you're going to find the most
experts able and willing to help you out.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message