From 9b60986f682ad3a23f3e5d4f19ddd645879ad8bb Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 28 Mar 2022 20:37:21 +0000 Subject: [PATCH] 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 --- poi/src/main/java/org/apache/poi/util/XMLHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 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; } -- 2.39.5