This is an automated email from the ASF dual-hosted git repository.
lewismc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/any23.git
The following commit(s) were added to refs/heads/master by this push:
new 8562108 Address comments from liontree0110
new b70d367 Merge branch 'master' of https://github.com/apache/any23
8562108 is described below
commit 856210814c16ff720f1484019013dc77cf95a2d0
Author: Lewis John McGibbney <[email protected]>
AuthorDate: Thu Feb 17 15:23:02 2022 -0800
Address comments from liontree0110
---
.../java/org/apache/any23/extractor/rdfa/XSLTStylesheet.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git
a/core/src/main/java/org/apache/any23/extractor/rdfa/XSLTStylesheet.java
b/core/src/main/java/org/apache/any23/extractor/rdfa/XSLTStylesheet.java
index b2ef8d4..a561162 100644
--- a/core/src/main/java/org/apache/any23/extractor/rdfa/XSLTStylesheet.java
+++ b/core/src/main/java/org/apache/any23/extractor/rdfa/XSLTStylesheet.java
@@ -21,6 +21,7 @@ import org.slf4j.Logger;
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;
@@ -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);
}
}