# HG changeset patch # User aefimov # Date 1412781796 -3600 # Node ID f2880ca8746ed03f43d4416650b2b40bc7a1653c # Parent e0358adf5a13135a7c04416600987c100916a6b5 8039533: Higher resolution resolvers Reviewed-by: joehw diff -r e0358adf5a13 -r f2880ca8746e drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java --- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Tue Jul 15 10:28:01 2014 -0400 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Wed Oct 08 16:23:16 2014 +0100 @@ -604,9 +604,9 @@ //fElementStack2.clear(); //fReplaceEntityReferences = true; //fSupportExternalEntities = true; - Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_REPLACING_ENTITY_REFERENCES); + Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES); fReplaceEntityReferences = bo.booleanValue(); - bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_SUPPORTING_EXTERNAL_ENTITIES); + bo = (Boolean)propertyManager.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES); fSupportExternalEntities = bo.booleanValue(); Boolean cdata = (Boolean)propertyManager.getProperty(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.STAX_REPORT_CDATA_EVENT) ; if(cdata != null) diff -r e0358adf5a13 -r f2880ca8746e drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java --- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Tue Jul 15 10:28:01 2014 -0400 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Wed Oct 08 16:23:16 2014 +0100 @@ -43,6 +43,7 @@ import java.util.Locale; import java.util.Map; import java.util.Stack; +import javax.xml.stream.XMLInputFactory; import com.sun.org.apache.xerces.internal.impl.io.*; @@ -302,6 +303,10 @@ /** Property Manager. This is used from Stax */ protected PropertyManager fPropertyManager ; + /** StAX properties */ + boolean fSupportDTD = true; + boolean fReplaceEntityReferences = true; + boolean fSupportExternalEntities = true; // settings @@ -1138,7 +1143,8 @@ boolean parameter = entityName.startsWith("%"); boolean general = !parameter; if (unparsed || (general && !fExternalGeneralEntities) || - (parameter && !fExternalParameterEntities)) { + (parameter && !fExternalParameterEntities) || + !fSupportDTD || !fSupportExternalEntities) { if (fEntityHandler != null) { fResourceIdentifier.clear(); @@ -1437,6 +1443,10 @@ fStaxEntityResolver = null; } + fSupportDTD = ((Boolean)propertyManager.getProperty(XMLInputFactory.SUPPORT_DTD)).booleanValue(); + fReplaceEntityReferences = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)).booleanValue(); + fSupportExternalEntities = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)).booleanValue(); + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); // initialize state @@ -1552,6 +1562,11 @@ } entityExpansionIndex = fSecurityManager.getIndex(Constants.JDK_ENTITY_EXPANSION_LIMIT); + //StAX Property + fSupportDTD = true; + fReplaceEntityReferences = true; + fSupportExternalEntities = true; + //reset general state reset();