< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java

Print this page

        

@@ -487,22 +487,24 @@
                         parser.getClass().getName() + ": " + e.getMessage());
                 reportError(WARNING, err);
             }
 
             final XMLReader reader = parser.getXMLReader();
+            String lastProperty = "";
             try {
                 XMLSecurityManager securityManager =
                         (XMLSecurityManager)_xsltc.getProperty(XalanConstants.SECURITY_MANAGER);
                 for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
-                    reader.setProperty(limit.apiProperty(), securityManager.getLimitValueAsString(limit));
+                    lastProperty = limit.apiProperty();
+                    reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit));
                 }
                 if (securityManager.printEntityCountInfo()) {
+                    lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO;
                     parser.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
                 }
             } catch (SAXException se) {
-                System.err.println("Warning:  " + reader.getClass().getName() + ": "
-                            + se.getMessage());
+                XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se);
             }
 
             return(parse(reader, input));
         }
         catch (ParserConfigurationException e) {
< prev index next >