]> source.dussan.org Git - poi.git/commitdiff
do not fail if xslt transformer does not support accessExternalStylesheet attribute
authorPJ Fanning <fanningpj@apache.org>
Mon, 28 Mar 2022 20:37:21 +0000 (20:37 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 28 Mar 2022 20:37:21 +0000 (20:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899326 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/util/XMLHelper.java

index e584762c21ac15db239253ef3c1e4505d203c5c5..a5ebc6db83f372a7fec8437bc22259b47101d763 100644 (file)
@@ -221,7 +221,7 @@ public final class XMLHelper {
         TransformerFactory factory = TransformerFactory.newInstance();
         trySet(factory::setFeature, FEATURE_SECURE_PROCESSING, true);
         quietSet(factory::setAttribute, ACCESS_EXTERNAL_DTD, "");
-        trySet(factory::setAttribute, ACCESS_EXTERNAL_STYLESHEET, "");
+        quietSet(factory::setAttribute, ACCESS_EXTERNAL_STYLESHEET, "");
         quietSet(factory::setAttribute, ACCESS_EXTERNAL_SCHEMA, "");
         return factory;
     }
@@ -239,9 +239,9 @@ public final class XMLHelper {
     public static SchemaFactory getSchemaFactory() {
         SchemaFactory factory = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
         trySet(factory::setFeature, FEATURE_SECURE_PROCESSING, true);
-        trySet(factory::setProperty, ACCESS_EXTERNAL_DTD, "");
-        trySet(factory::setProperty, ACCESS_EXTERNAL_STYLESHEET, "");
-        trySet(factory::setProperty, ACCESS_EXTERNAL_SCHEMA, "");
+        quietSet(factory::setProperty, ACCESS_EXTERNAL_DTD, "");
+        quietSet(factory::setProperty, ACCESS_EXTERNAL_STYLESHEET, "");
+        quietSet(factory::setProperty, ACCESS_EXTERNAL_SCHEMA, "");
         return factory;
     }