Title: Message
This code looks way of track...
 
You are trying to create a elementlist by declaring the variable element once and in the choose-construction  you assign values.  Next you try to loop over a none existing elementlist....
 
Better explain what kind of starting situation you have and what you are trying to accomplish.
 
Cheers,
Robby Pelssers
-----Original Message-----
From: Christian Barth [mailto:[EMAIL PROTECTED]
Sent: woensdag 18 januari 2006 19:21
To: [email protected]
Subject: How to asign a value to a variable??

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?

 

Thanks,

Barthi