Code example for XMLReader

Methods: setContentHandler, setDTDHandler, setErrorHandler, setProperty

0
   * this as a listener with the same effect. 
   * */ 
  public void setXMLReader(XMLReader eventsource)
  { 
    fXMLReader=eventsource;
    eventsource.setContentHandler(this);
    eventsource.setDTDHandler(this);
    eventsource.setErrorHandler(this); // to report fatal errors in filtering mode
 
    // Not supported by all SAX2 filters: 
    try  
    { 
      eventsource.
        setProperty("http://xml.org/sax/properties/lexical-handler",
                    this);
    } 
    catch(SAXNotRecognizedException e)
    { 
      // Nothing we can do about it 
    } 
    catch(SAXNotSupportedException e)