Skip to content

Commit

Permalink
Addresses Issue #37
Browse files Browse the repository at this point in the history
  • Loading branch information
APHDKO committed Feb 29, 2024
1 parent 9c9aa02 commit d4b79a9
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ public XML_DOM(final Document document){
protected XML_DOM(final String xml) throws ContentException {
InputSource in = new InputSource();
in.setCharacterStream(new StringReader(xml));
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
try {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
dbFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
dbFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
dBuilder = dbFactory.newDocumentBuilder();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
this.xmlDocument = dBuilder.parse(in);
} catch (ParserConfigurationException e) {
throw new ContentException(e);
}
try {
this.xmlDocument = dBuilder.parse(in);
} catch (SAXException e) {
throw new ContentException(e);
} catch (IOException e) {
Expand Down

0 comments on commit d4b79a9

Please sign in to comment.