Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Address comments from liontree0110
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismc committed Feb 17, 2022
1 parent dda25df commit 8562108
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;

import javax.xml.XMLConstants;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
Expand All @@ -47,9 +48,12 @@ public class XSLTStylesheet {

public XSLTStylesheet(InputStream xsltFile) {
try {
transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltFile));
} catch (TransformerConfigurationException e) {
throw new RuntimeException("Should not happen, we use the default configuration", e);
TransformerFactory tf = TransformerFactory.newInstance();
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
this.transformer = tf.newTransformer(new StreamSource(xsltFile));
} catch (TransformerConfigurationException tce) {
throw new RuntimeException("Should not happen, we use the default configuration", tce);
}
}

Expand Down

0 comments on commit 8562108

Please sign in to comment.