/** * Creates a new instance of <code>SAXParser</code> using the currently * configured factory parameters. * @return javax.xml.parsers.SAXParser */ public SAXParser newSAXParser() throws ParserConfigurationException { SAXParser saxParserImpl; try { saxParserImpl = new SAXParserImpl(this, features, fSecureProcess); } catch (SAXException se) { // Translate to ParserConfigurationException throw new ParserConfigurationException(se.getMessage()); } return saxParserImpl; }
/** * returns the particular property requested for in the underlying * implementation of org.xml.sax.XMLReader. */ public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { if (name == null) { throw new NullPointerException(); } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return fSecureProcess; } else if (name.equals(NAMESPACES_FEATURE)) { return isNamespaceAware(); } else if (name.equals(VALIDATION_FEATURE)) { return isValidating(); } else if (name.equals(XINCLUDE_FEATURE)) { return isXIncludeAware(); } // Check for valid name by creating a dummy XMLReader to get // feature value return newSAXParserImpl().getXMLReader().getFeature(name); }
if( fSAXParser.isValidating() ) { fSAXParser.schemaLanguage = W3C_XML_SCHEMA; setFeature(XMLSCHEMA_VALIDATION_FEATURE, true);
/** * Common code for translating exceptions */ private SAXParserImpl newSAXParserImpl() throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { SAXParserImpl saxParserImpl; try { saxParserImpl = new SAXParserImpl(this, features); } catch (SAXNotSupportedException e) { throw e; } catch (SAXNotRecognizedException e) { throw e; } catch (SAXException se) { throw new ParserConfigurationException(se.getMessage()); } return saxParserImpl; }