cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pannetier Alain <>
Subject RE: How to asign a value to a variable??
Date Thu, 19 Jan 2006 07:57:52 GMT
Hi Christian, 

This is probably what you want to achieve : 

<xsl:variable name="element" select= 
       | *[local-name()='trennwaende']/trennwand"/> 

<xsl:for-each select="$element"> 
        <xsl:value-of select="."/> 

The node-set is created by an XPath expression. Note the "|" that ORs
your two cases. 
As you probably know by now, doing it "in one go" is the only way. 


From: Christian Barth [
<> ] 
Sent: 18 January 2006 19:21 
Subject: How to asign a value to a variable?? 

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:when test="local-name() = 'rettungswege'"> 
                <xsl:variable name="element" select="rettungswege/rw" />

            <xsl:when test="local-name() = 'trennwaende'"> 
                <xsl:variable name="element"
select="trennwaende/trennwand" /> 
<xsl:for-each select="$element"> something... 
Is this possible? 

View raw message