> Document parsedDoc = builder.parse(new File("apple.xml")); > > The stream-source gave the expected results. > The parsed-dom-source (from the same file as the stream-source) gave bad > results - its like the Document was not recognized. > The manually-built-dom-source gave the expected results.
Is your |builder| configured to produce a namespace aware DOM? Is your "manually-built-dom" namespace aware? If both DOM instances have different namespace awareness - this could be the reason, although I can't think of anything specific at the moment.