So, any time you see code like this:
DOMBuilder builder = new DOMBuilder( );
// Building from a file
Document doc = builder.build(new File("input.xml"));
// Building from a URL
Document doc = builder.build(
new URL("http://newInstance.com/javaxml2/copyright.xml"));
// Building from an I/O stream
Document doc = builder.build(new FileInputStream("input.xml"));
You should run screaming! Seriously, DOMBuilder
has its place: it's great for taking existing DOM structures
and going to JDOM. But for raw, speedy input, it's simply an
inferior choice in terms of performance. Save yourself some headaches
and commit this fact to memory now!