2232 // just use our own SAX parser. 2233 catch (SAXException se) { 2234 parser = new SAXParser(); 2235 } 2236 try { 2237 parser.setFeature(NAMESPACE_PREFIXES, true); 2238 namespacePrefixes = true; 2239 // If this is a Xerces SAX parser set the security manager if there is one 2240 if (parser instanceof SAXParser) { 2241 Object securityManager = fSchemaParser.getProperty(SECURITY_MANAGER); 2242 if (securityManager != null) { 2243 parser.setProperty(SECURITY_MANAGER, securityManager); 2244 } 2245 } 2246 } 2247 catch (SAXException se) {} 2248 2249 try { 2250 parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, fAccessExternalDTD); 2251 } catch (SAXNotRecognizedException exc) { 2252 System.err.println("Warning: " + parser.getClass().getName() + ": " + 2253 exc.getMessage()); 2254 } 2255 } 2256 // If XML names and Namespace URIs are already internalized we 2257 // can avoid running them through the SymbolTable. 2258 boolean stringsInternalized = false; 2259 try { 2260 stringsInternalized = parser.getFeature(STRING_INTERNING); 2261 } 2262 catch (SAXException exc) { 2263 // The feature isn't recognized or getting it is not supported. 2264 // In either case, assume that strings are not internalized. 2265 } 2266 if (fXSContentHandler == null) { 2267 fXSContentHandler = new SchemaContentHandler(); 2268 } 2269 fXSContentHandler.reset(fSchemaParser, fSymbolTable, 2270 namespacePrefixes, stringsInternalized); 2271 parser.setContentHandler(fXSContentHandler); 2272 parser.setErrorHandler(fErrorReporter.getSAXErrorHandler()); 2273 | 2232 // just use our own SAX parser. 2233 catch (SAXException se) { 2234 parser = new SAXParser(); 2235 } 2236 try { 2237 parser.setFeature(NAMESPACE_PREFIXES, true); 2238 namespacePrefixes = true; 2239 // If this is a Xerces SAX parser set the security manager if there is one 2240 if (parser instanceof SAXParser) { 2241 Object securityManager = fSchemaParser.getProperty(SECURITY_MANAGER); 2242 if (securityManager != null) { 2243 parser.setProperty(SECURITY_MANAGER, securityManager); 2244 } 2245 } 2246 } 2247 catch (SAXException se) {} 2248 2249 try { 2250 parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, fAccessExternalDTD); 2251 } catch (SAXNotRecognizedException exc) { 2252 XMLSecurityManager.printWarning(parser.getClass().getName(), 2253 XMLConstants.ACCESS_EXTERNAL_DTD, exc); 2254 } 2255 } 2256 // If XML names and Namespace URIs are already internalized we 2257 // can avoid running them through the SymbolTable. 2258 boolean stringsInternalized = false; 2259 try { 2260 stringsInternalized = parser.getFeature(STRING_INTERNING); 2261 } 2262 catch (SAXException exc) { 2263 // The feature isn't recognized or getting it is not supported. 2264 // In either case, assume that strings are not internalized. 2265 } 2266 if (fXSContentHandler == null) { 2267 fXSContentHandler = new SchemaContentHandler(); 2268 } 2269 fXSContentHandler.reset(fSchemaParser, fSymbolTable, 2270 namespacePrefixes, stringsInternalized); 2271 parser.setContentHandler(fXSContentHandler); 2272 parser.setErrorHandler(fErrorReporter.getSAXErrorHandler()); 2273 |