xsl-list
[Top] [All Lists]

test expression in predicates - is this one legal???

2003-04-02 02:38:22
xml:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
   <bar>test</bar>
</root>

xsl:
<xsl:param name="foobar" select="'number'"/>

<xsl:template match="/">
 <xsl:apply-templates select="root/bar"/>
</xsl:template>


<xsl:template match="bar[$foobar='number']">
number
</xsl:template>

<xsl:template match="bar">
text
</xsl:template>

it gives: 
number

i expected it not to work.
but it works just fine.
is it legal?
is this way considered a normal way of working?

althou i'd prefer to use <xsl:choose/>

jian

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list