Hmmmm. I just tried this with XalanJ 2.1.0 and it worked fine. Here is
my input XML:
<foo:bar xmlns:foo="http://dummyNamespace.com">
<inner>
Text node
</inner>
</foo:bar>
Can you please post your input XML and the results that you're receiving
that lead you to believe that this is not working.
Thanks,
Gary
Evan Lenz wrote:
>
> The website says this about xalan:evaluate():
>
> "evaluate (xpath-expression) function returns the result of evaluating the
> xpath-expression in the current XPath expression context (automatically
> passed in by the extension mechanism)."[1]
>
> It appears that namespace prefix-bindings are not being included in the
> evaluation context.
>
> For example:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:foo="http://dummyNamespace.com"
> xmlns:xalan="http://xml.apache.org/xalan"
> extension-element-prefixes="xalan">
>
> <xsl:param name="xpath" select="'/foo:bar'"/>
>
> <xsl:template match="/">
> <xsl:copy-of select="xalan:evaluate($xpath)"/>
> </xsl:template>
>
> </xsl:stylesheet>
>
> This should select all top-level bar elements in the "foo" namespace. But it
> selects nothing. It works fine when selecting elements not in a namespace.
>
> I am using xalan-j_2_1_0.
>
> Thanks for your time,
>
> Evan Lenz
> XYZFind Corp.
>
> [1] http://xml.apache.org/xalan-j/extensionslib.html#evaluate