Subject: [xsl] Problem with passing argument to external registered function|
From: Jesper Noehr <jesper@xxxxxxxxx>
Date: Mon, 17 Apr 2006 18:05:40 +0200
I'm experiencing a problem, and I'm hoping someone might shed some light on a solution.
I'm trying to pass data to an externally registered function. For example, this function returns the uppercase version of what was passed to it.
This works: <xsl:value-of select="foo:bar('test')"/>
This doesn't: <xsl:value-of select="foo:bar(element/.)"/>
Is it not possible to give XPath expressions as argument? I've tried storing the content in both a param and a variable before sending it on to the function. E.g. <xsl:variable name="foo"> This is a string. </xsl:variable> <xsl:value-of select="foo:bar($foo)"/>
...which also fails. The error I'm getting from libxslt is: xmlXPathCompiledEval: evaluation failed runtime error: file xsl/function.xsl element value-of xsltValueOf: text copy failed
What am I doing wrong? Am I trying to go beyond the capabilities of XSLT?
-- Jesper Nxhr, Information Systems Developer, Opera Software tel: +47-24164348 / cell: +47-93460263 / jespern@xxxxxxxxx