Hi Niranjan,

that's why CachedXPathAPI was introduced:

CachedXPathAPI oldXpathAPI = new CachedXPathAPI();

CachedXPathAPI xpathAPIwithSameXPathContextasOldAPI = new CachedXPathAPI(oldXpathAPI);

Hope it's a hint to play around with (I had similar problems in bug 4336)
Christian


--On Dienstag, 11. Dezember 2001 15:30 -0500 Niranjan Kundapur <[EMAIL PROTECTED]> wrote:


I am processing around 10-15 compiled XPath objects on a single Node using
the method below. I notice that the empty constructor, new XPathContext(),
takes a significant amount of time. Is it possible to reuse the
XPathContext object for a _given_ Node so that it need not be constructed
each time an XPath needs to be executed on it? How is this implemented?
I am using XalanD13 and jdk1.3.

    public NodeList processXPath(XPath xp, Node target)
    throws javax.xml.transform.TransformerException
    {
        XPathContext context = new XPathContext(); //construct
XPathContext         XObject list = xp.execute(context, target,
prefixResolver);          return list.nodelist();
    }



Reply via email to