Java and XML (JAXP) - What about caching and thread-safety?

Viewed 8299
  1. I'd like to know which objects can be reused (in the same or different document) when using the Java API for XML processing, JAXP:

    • DocumentBuilderFactory
    • DocumentBuilder
    • XPath
    • Node
    • ErrorHandler (EDIT: I forgot that this has to be implemented in my own code, sorry)
  2. Is it recommended to cache those objects or do the JAXP implementations already cache them?

  3. Is the (re)use of those objects thread-safe?

1 Answers
Related