I tried setting:
dbFactory.setExpandEntityReferences(false);
but it does not work.
If you cannot change the contents of xml (using UTF-8, xml may contain u umlaut), you can add DTD:
<!DOCTYPE definition [ <!ENTITY uuml "ü"> ]>
If you cannot change your XML file, upload the xml content and add the DTD:
String dtd = "<!DOCTYPE definition [\n<!ENTITY uuml 'ü'>\n]>\n", contents = <load xmlFile>; Reader reader = new StringReader(dtd + contents); InputSource src = new InputSource(reader); Document doc = dBuilder.parse(src);
Hummeling Engineering BV
source share