It appears the problem is that such feature is not defined in com/sun/org/apache/xalan/internal/utils/FeatureManager.java
.
If you are using java 8, then what you need to do is simply to call:
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
This is because in com/sun/org/apache/xalan/internal/xsltctrax/TransformerFactoryImpl.java
:
if (value && XalanConstants.IS_JDK8_OR_ABOVE) {
_xmlSecurityPropertyMgr.setValue(
Property.ACCESS_EXTERNAL_DTD,
State.FSP,
XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP
); // ACCESS_EXTERNAL_DTD is disabled by setting to the default value
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…