I want to load a very big XML file into a DOM tree (using JAXP), do some modifications and run XPath queries on the resulting DOM.
We use our own DOM implementation which is implemented using lazy loading (i.e. in the beginning only the first two levels of the DOM are loaded from the file, if getChildNodes()/etc. is called we go back to the file and load more levels). This is very slow, however, we are able to load much bigger files, especially if we only use parts of the file.
My question: XPath is using a different view on the XML (afaik). I'm curious if the default Oracle JDK implementation is now converting the whole DOM document into some internal XPath document (which would be really bad, as it would eagerly load the whole document) or if the XPath implementation is able to work directly on our DOM tree (i.e. no further loading if the XPath can be evaluated within the already loaded elements).