Re: Dynamic evaluatino of XPath expression - should java:evaluate() work?

Martin Klang <[email protected]> Wed, 18 Apr 2007 19:51:41 +0200
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
Hi Eric,

I'm surprised, I thought we had removed java:evaluate some time ago!
The thought was that it breaks the 'compile once, run many' model,  
though I can see that sometimes it might be a useful feature. I will  
check to see what the status is and get back to you.

Have you considered using an XSLT to turn your XPath expressions into  
an o:XML program (or hatatap script)?
If the expressions aren't kept in an XML file, you could still write  
an o:XML program that reads the expressions and produces an o:XML  
output file.

If necessary, the same program could write the results to a file  
(using io:File.write(Nodeset) ), and invoke the dynamically created  
program using the built-in Program type.

However, the most straightforward would be a two-step process:
1) run the program that generates the xpath checks.
2) run the checks (or a program/script that imports/includes them).

hope this helps,

/m

On 18 Apr 2007, at 19:06, Hilfer, Eric wrote:

> I have a file with a list of xpath expressions.  Using a hatatap  
> o:Xml script, I want to evaluate each of those strings as an xpath  
> path against a $dom variable that has been loaded by a POST request.
>
>
>
> Is there a dynamic evaluation function in o:Xml?  I have tried  
> using java:evaluate( $stringPath, $dom) but is always returns an  
> empty result, I think.
>
>
>
> Thanks for your help!