Skip to content

Commit 200d673

Browse files
Enhance XMl reader (#45)
1 parent 11215ad commit 200d673

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/java/io/github/project/openubl/xsender/files/xml/XmlContentProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import org.xml.sax.SAXException;
2020

21+
import javax.xml.XMLConstants;
22+
import javax.xml.parsers.DocumentBuilderFactory;
2123
import javax.xml.parsers.ParserConfigurationException;
2224
import javax.xml.parsers.SAXParser;
2325
import javax.xml.parsers.SAXParserFactory;
@@ -32,10 +34,14 @@ private XmlContentProvider() {
3234

3335
public static XmlContent getSunatDocument(InputStream is) throws ParserConfigurationException, SAXException, IOException {
3436
XmlHandler handler = new XmlHandler();
37+
3538
SAXParserFactory factory = SAXParserFactory.newInstance();
39+
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
3640
factory.setNamespaceAware(true);
41+
3742
SAXParser parser = factory.newSAXParser();
3843
parser.parse(is, handler);
44+
3945
return handler.getModel();
4046
}
4147
}

0 commit comments

Comments
 (0)