Hello,
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();
}
Thank you in advance,
Niranjan