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
This commit is contained in:
PJ Fanning 2022-03-28 20:37:21 +00:00
parent cba63eda75
commit 9b60986f68
1 changed files with 4 additions and 4 deletions

View 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;
}