Skip to content

Commit

Permalink
using access extenal dtd property as not allowed in xmleventreader of…
Browse files Browse the repository at this point in the history
… lemminx

Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Aug 7, 2024
1 parent 103116d commit a42af18
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Set;
import java.util.logging.Logger;

import javax.xml.XMLConstants;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
Expand Down Expand Up @@ -92,6 +93,7 @@ private static XMLInputFactory getXmlInputFactory() {
factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
} catch (Exception e) {
LOGGER.warning("Could not set properties on XMLInputFactory.");
}
Expand All @@ -114,7 +116,7 @@ public static Map<String, String> getElementValues(Path file, Set<String> elemen
}
Map<String, String> returnValues = new HashMap<String, String> ();

XMLInputFactory factory = XMLInputFactory.newInstance();
XMLInputFactory factory = getXmlInputFactory();
XMLEventReader reader = null;
try {
reader = factory.createXMLEventReader(new FileInputStream(file.toFile()));
Expand Down

0 comments on commit a42af18

Please sign in to comment.