Code example for SAXParserFactory

Methods: setNamespaceAware, setValidating

0
  /** 
   * Default constructor. 
   */ 
  public Jaxp11XMLReaderCreator() { 
    factory = SAXParserFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(false);
  } 
 
  public XMLReader createXMLReader() throws SAXException {
    try { 
      return factory.newSAXParser().getXMLReader();
    } 
    catch (ParserConfigurationException e) {
      throw new SAXException(e);
    } 
  } 
}