cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <>
Subject Re: XML-Query language
Date Tue, 02 Dec 2003 00:00:27 GMT
Scherler, Thorsten wrote:
> with (where *expr* is a parameter parsed from a formular):
> expr=date[date='Nov 28']
> ...
> <xsl:param name="expr" />
> ...
> <xsl:apply-templates select="{$expr}"/>
> This is not working, neither *select="$expr"*, nor *select="'{$expr}'"* 

The value of the select attribute must be an XPath expression itself,
and it must evaluate into a node set. The first, {$expr}, is not a
valid XPath expression. The second, $expr, evaluates to the string
'date[date='Nov 28']', which is not a node set. The third evaluates
to the string '{$expr}' which still isn't a node set.

> (or I did something wrong). I came to the conclusion that you can't use 
> dynamic XPath expression.

Not in standard XSLT. Xalan should support the EXSLT dynamic
functions, specifically evaluate():

Don't expect it to be blindingly fast (though not as bad as dynamic
SQL compared to prepared statements).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message