This code is very slow:
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
dbFactory.setNamespaceAware(false);
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
org.w3c.dom.Document doc = dBuilder.parse(new InputSource(new StringReader(content)));
System.out.println(doc.toString()); // outputs [#document: null]
And not only that it's slow it does not even parse:
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
<div>
<br />
</div>
<div>
<br />
</div>
<en-media hash="" type="application/octet-stream" />
<div>
<br />
</div>
<div>This is my first Evernote blog with image/photo attached.</div>
<div>
<br />
</div>
<div>This is another line. </div>
<div>
<br />
</div>
<div>Some
<i>formatting </i>also for
<b>some </b>lines.
</div>
</en-note>
What is the fastest way to parse this XML into a org.w3c.dom.Document?