>Why the execute method needs a PrefixResolver as a parameter?
XPath is expressed in terms of QNames, but is intended to be evaluated in
terms of the expanded names (semantic meaning, namespace plus localname).
Depending on the context in which you're using XPath, the mapping from the
former to the latter by be determined by the document you're searching, the
document the XPath expression appeared in, or some other definition of
current namespaces. The PrefixResolver parameter allows you to specify
which of these contexts should be applied.
>2. Is XPath object thread-safe?
Good question. I _think_ the answers are similar to those for XSLT
transforms (http://xml.apache.org/xalan-j/usagepatterns.html#multithreading
) ... but I'm not 100% sure. We should probably document that officially...