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 Taras Tielkes <ta...@info.nl> on 2001/10/29 15:23:04 UTC

Precompiling XPath expressions without a target document

Hi,

I have a couple of XPath expressions that I want to evaluate over and over
again, but on different target xml documents.

I took the code from XPathAPI.eval(), and plugged in a custom implementation
of the PrefixResolver interface that just does static lookups from a table
of static prefixes and namespaces. (Since I don't have a Document reference
at the time I compile the XPath expressions.)

Is this a sane use of the available APIs, or should I take a different
route?

Thanks,

// tt




RE: Precompiling XPath expressions without a target document

Posted by Gary L Peskin <ga...@firstech.com>.
This is using PrefixResolver as intended.  You're doing things the right
way.

Gary

> -----Original Message-----
> From: Taras Tielkes [mailto:taras@info.nl] 
> Sent: Monday, October 29, 2001 6:23 AM
> To: 'xalan-j-users@xml.apache.org'
> Subject: Precompiling XPath expressions without a target document
> 
> 
> Hi,
> 
> I have a couple of XPath expressions that I want to evaluate 
> over and over again, but on different target xml documents.
> 
> I took the code from XPathAPI.eval(), and plugged in a custom 
> implementation of the PrefixResolver interface that just does 
> static lookups from a table of static prefixes and 
> namespaces. (Since I don't have a Document reference at the 
> time I compile the XPath expressions.)
> 
> Is this a sane use of the available APIs, or should I take a 
> different route?
> 
> Thanks,
> 
> // tt
> 
> 
>