225 // Initial EntityResolver 226 fInitEntityResolver = xmlReader.getEntityResolver(); 227 } 228 229 /** 230 * Set any features of our XMLReader based on any features set on the 231 * SAXParserFactory. 232 * 233 * XXX Does not handle possible conflicts between SAX feature names and 234 * JAXP specific feature names, eg. SAXParserFactory.isValidating() 235 */ 236 private void setFeatures(Hashtable features) 237 throws SAXNotSupportedException, SAXNotRecognizedException { 238 if (features != null) { 239 Iterator entries = features.entrySet().iterator(); 240 while (entries.hasNext()) { 241 Map.Entry entry = (Map.Entry) entries.next(); 242 String feature = (String) entry.getKey(); 243 boolean value = ((Boolean) entry.getValue()).booleanValue(); 244 xmlReader.setFeature0(feature, value); 245 if (feature.equals(XMLConstants.FEATURE_SECURE_PROCESSING) && value) { 246 xmlReader.setProperty0(ACCESS_EXTERNAL_DTD, ""); 247 xmlReader.setProperty0(ACCESS_EXTERNAL_SCHEMA, ""); 248 } 249 } 250 } 251 } 252 253 public Parser getParser() throws SAXException { 254 // Xerces2 AbstractSAXParser implements SAX1 Parser 255 // assert(xmlReader instanceof Parser); 256 return (Parser) xmlReader; 257 } 258 259 /** 260 * Returns the XMLReader that is encapsulated by the implementation of 261 * this class. 262 */ 263 public XMLReader getXMLReader() { 264 return xmlReader; 265 } 266 267 public boolean isNamespaceAware() { 268 try { 269 return xmlReader.getFeature(NAMESPACES_FEATURE); 270 } | 225 // Initial EntityResolver 226 fInitEntityResolver = xmlReader.getEntityResolver(); 227 } 228 229 /** 230 * Set any features of our XMLReader based on any features set on the 231 * SAXParserFactory. 232 * 233 * XXX Does not handle possible conflicts between SAX feature names and 234 * JAXP specific feature names, eg. SAXParserFactory.isValidating() 235 */ 236 private void setFeatures(Hashtable features) 237 throws SAXNotSupportedException, SAXNotRecognizedException { 238 if (features != null) { 239 Iterator entries = features.entrySet().iterator(); 240 while (entries.hasNext()) { 241 Map.Entry entry = (Map.Entry) entries.next(); 242 String feature = (String) entry.getKey(); 243 boolean value = ((Boolean) entry.getValue()).booleanValue(); 244 xmlReader.setFeature0(feature, value); 245 } 246 } 247 } 248 249 public Parser getParser() throws SAXException { 250 // Xerces2 AbstractSAXParser implements SAX1 Parser 251 // assert(xmlReader instanceof Parser); 252 return (Parser) xmlReader; 253 } 254 255 /** 256 * Returns the XMLReader that is encapsulated by the implementation of 257 * this class. 258 */ 259 public XMLReader getXMLReader() { 260 return xmlReader; 261 } 262 263 public boolean isNamespaceAware() { 264 try { 265 return xmlReader.getFeature(NAMESPACES_FEATURE); 266 } |