[jdom-interest] Using XPath in Multi-Threaded Env

Rajan Gupta rgupta99_1999 at yahoo.com
Thu Jun 5 10:10:02 PDT 2003

Is it possible to reuse an instance of XPath across multiple threads of
execution using different instances of DOM Documents in each thread?

I was looking at the code in JaxenPath.java & noticed that context is
stored as an attribute of the class, while not being really used anywhere
except in translateNamespacePrefixToUri() method. Following is a code

public List selectNodes(Object context) throws JDOMException {
      try {
         currentContext = context;

         return xPath.selectNodes(context);
      catch (JaxenException ex1) {
         throw new JDOMException("XPath error while evaluating \"" +
                        xPath.toString() + "\": " + ex1.getMessage(),
      finally {
         currentContext = null;

Thanks in advance,

Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).

More information about the jdom-interest mailing list