< prev index next >
src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java
Print this page
*** 126,137 ****
// XMLReaderFactory if setXMLReader is not used
reader = XMLReaderFactory.createXMLReader();
try {
reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing);
} catch (SAXNotRecognizedException e) {
! System.err.println("Warning: " + reader.getClass().getName() + ": "
! + e.getMessage());
}
} catch (Exception e) {
try {
// If unable to create an instance, let's try to use
// the XMLReader from JAXP
--- 126,137 ----
// XMLReaderFactory if setXMLReader is not used
reader = XMLReaderFactory.createXMLReader();
try {
reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing);
} catch (SAXNotRecognizedException e) {
! XMLSecurityManager.printWarning(reader.getClass().getName(),
! XMLConstants.FEATURE_SECURE_PROCESSING, e);
}
} catch (Exception e) {
try {
// If unable to create an instance, let's try to use
// the XMLReader from JAXP
*** 170,196 ****
try {
//reader is cached, but this property might have been reset
reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
} catch (SAXException se) {
! System.err.println("Warning: " + reader.getClass().getName() + ": "
! + se.getMessage());
}
try {
if (_xmlSecurityManager != null) {
for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
! reader.setProperty(limit.apiProperty(),
_xmlSecurityManager.getLimitValueAsString(limit));
}
if (_xmlSecurityManager.printEntityCountInfo()) {
reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
}
}
} catch (SAXException se) {
! System.err.println("Warning: " + reader.getClass().getName() + ": "
! + se.getMessage());
}
return reader;
}
--- 170,198 ----
try {
//reader is cached, but this property might have been reset
reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
} catch (SAXException se) {
! XMLSecurityManager.printWarning(reader.getClass().getName(),
! XMLConstants.ACCESS_EXTERNAL_DTD, se);
}
+ String lastProperty = "";
try {
if (_xmlSecurityManager != null) {
for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
! lastProperty = limit.apiProperty();
! reader.setProperty(lastProperty,
_xmlSecurityManager.getLimitValueAsString(limit));
}
if (_xmlSecurityManager.printEntityCountInfo()) {
+ lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO;
reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
}
}
} catch (SAXException se) {
! XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se);
}
return reader;
}
< prev index next >