Changeset 9:42d240325e43 in rrlib_xml-java


Ignore:
Timestamp:
15.07.2015 11:10:15 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Implemented disabling DTD check when loading XML documents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLDocument.java

    r7 r9  
    8888        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
    8989        try { 
     90            if (!validate) { 
     91                factory.setValidating(false); 
     92                factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); 
     93            } 
    9094            DocumentBuilder dbuilder = factory.newDocumentBuilder(); 
    9195            document = dbuilder.parse(fileName); 
     
    127131        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
    128132        try { 
     133            if (!validate) { 
     134                factory.setValidating(false); 
     135                factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); 
     136            } 
    129137            DocumentBuilder dbuilder = factory.newDocumentBuilder(); 
    130138            document = dbuilder.parse(input); 
Note: See TracChangeset for help on using the changeset viewer.