From: PJ Fanning Date: Mon, 28 Mar 2022 20:37:21 +0000 (+0000) Subject: do not fail if xslt transformer does not support accessExternalStylesheet attribute X-Git-Tag: REL_5_2_3~389 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9b60986f682ad3a23f3e5d4f19ddd645879ad8bb;p=poi.git do not fail if xslt transformer does not support accessExternalStylesheet attribute git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899326 13f79535-47bb-0310-9956-ffa450edef68 --- 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 e584762c21..a5ebc6db83 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 { 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; }