Code example for XMLReader

Methods: setFeaturesetProperty

	private final SAXParser createParser(SAXParserFactory parserFactory) throws ParserConfigurationException, SAXException, SAXNotRecognizedException, SAXNotSupportedException {
		// Initialize the parser. 
		final SAXParser parser = parserFactory.newSAXParser();
		final XMLReader reader = parser.getXMLReader();
		reader.setProperty("", this); //$NON-NLS-1$
		// disable DTD validation (bug 63625) 
		try { 
			//	be sure validation is "off" or the feature to ignore DTD's will not apply 
			reader.setFeature("", false); //$NON-NLS-1$
			reader.setFeature("", false); //$NON-NLS-1$
		} catch (final SAXNotRecognizedException e) {
			// not a big deal if the parser does not recognize the features 
		} catch (final SAXNotSupportedException e) {
			// not a big deal if the parser does not support the features 
		return parser;
	 * (non-Javadoc)