Code example for SAXParserFactory

Methods: newSAXParser, setFeature, setNamespaceAware, setValidating

0
			return null; 
 
		SAXParserFactory factory = a.getSAXParserFactory();
		if (factory == null)
			throw new SAXException("Unable to acquire sax parser"); //$NON-NLS-1$
		factory.setNamespaceAware(true);
		factory.setValidating(false);
		try { 
			factory.setFeature(
					"http://xml.org/sax/features/string-interning", true); //$NON-NLS-1$ 
		} catch (SAXException se) {
			// some parsers may not support string interning 
		} 
		SAXParser theParser = factory.newSAXParser();
		if (theParser == null) {
			throw new SAXException("Unable to create sax parser"); //$NON-NLS-1$
		} 
		xmlReader = theParser.getXMLReader();
		return theParser;
	}