- factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- InputSource is = new InputSource(new StringReader(xmlPayload));
- Document doc = builder.parse(is);
+ Document doc;
+ try {
+ factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(xmlPayload)));
+ } catch (ParserConfigurationException | SAXException e) {
+ throw new IOException(e);
+ }