You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Joona Palaste <jo...@dmm.fi> on 2004/01/07 14:34:02 UTC

Question about XPathAPI

Hello,
                                                                                
I have a question about the Xalan XPathAPI class. How can I use
variables in the XPath expression? I've tried running the example
program ApplyXPath with the following kind of argument:
/doc/name[@first=$foo]
and it gives me an exception:
Exception in thread "main" java.lang.RuntimeException: Variable not
resolvable:
foo
How can I change the Java program to resolve the variable "foo" to
something, like "John Doe"? Is there a way to do this with the
XPathAPI class? Or do I have to change the XML document itself?
Thanks!
                                                                                
Joona Palaste
joona.palaste@dmm.fi