cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
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():
  http://exslt.org/dyn/functions/evaluate/index.html

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

J.Pietschmann



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


Mime
View raw message