From 60576173159b5da2c6dc72f19018622efbc4c12a Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sun, 10 Aug 2014 14:29:45 +0000 Subject: [PATCH] Redefine constant for secure processing, because it missing is stupid stax-api.jar and Java 5 itsself. git-svn-id: https://svn.apache.org/repos/asf/poi/branches/REL_3_10_BRANCH@1617109 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/util/SAXHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/util/SAXHelper.java b/src/ooxml/java/org/apache/poi/util/SAXHelper.java index b38b2c2be9..b69225dc81 100644 --- a/src/ooxml/java/org/apache/poi/util/SAXHelper.java +++ b/src/ooxml/java/org/apache/poi/util/SAXHelper.java @@ -22,8 +22,6 @@ import java.io.InputStream; import java.io.StringReader; import java.lang.reflect.Method; -import javax.xml.XMLConstants; - import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; @@ -37,6 +35,9 @@ import org.xml.sax.SAXException; */ public final class SAXHelper { private static POILogger logger = POILogFactory.getLogger(SAXHelper.class); + + // remove this constant once on Java 6 and stax-api.jar was removed (which is missing this constant): + private static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; /** * Creates a new SAX Reader, with sensible defaults @@ -50,7 +51,7 @@ public final class SAXHelper { return new InputSource(new StringReader("")); } }); - trySetSAXFeature(xmlReader, XMLConstants.FEATURE_SECURE_PROCESSING, true); + trySetSAXFeature(xmlReader, FEATURE_SECURE_PROCESSING, true); trySetXercesSecurityManager(xmlReader); return xmlReader; } -- 2.39.5