diff options
-rw-r--r-- | poi/src/main/java/org/apache/poi/util/XMLHelper.java | 2 | ||||
-rw-r--r-- | poi/src/test/java/org/apache/poi/util/TestXMLHelper.java | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/util/XMLHelper.java b/poi/src/main/java/org/apache/poi/util/XMLHelper.java index 8e7bae2898..58917e25d4 100644 --- a/poi/src/main/java/org/apache/poi/util/XMLHelper.java +++ b/poi/src/main/java/org/apache/poi/util/XMLHelper.java @@ -221,7 +221,7 @@ public final class XMLHelper { public static TransformerFactory getTransformerFactory() { TransformerFactory factory = TransformerFactory.newInstance(); trySet(factory::setFeature, FEATURE_SECURE_PROCESSING, true); - trySet(factory::setAttribute, ACCESS_EXTERNAL_DTD, ""); + quietSet(factory::setAttribute, ACCESS_EXTERNAL_DTD, ""); trySet(factory::setAttribute, ACCESS_EXTERNAL_STYLESHEET, ""); quietSet(factory::setAttribute, ACCESS_EXTERNAL_SCHEMA, ""); return factory; diff --git a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java index a4e8732b8d..52041ffdba 100644 --- a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java +++ b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java @@ -158,4 +158,12 @@ class TestXMLHelper { void testNewXMLEventFactory() { assertNotNull(XMLHelper.newXMLEventFactory()); } + + /** + * test that newTransformer returns a transformer + */ + @Test + void testNewTransformer() throws Exception { + assertNotNull(XMLHelper.newTransformer()); + } } |