code:    private void parseUsingSAX(InputStream is) throws IOException, ParserConfigurationException, SAXException, SAXNotRecognizedException, SAXNotSupportedException
     {
        // Invoke the SAX XML parser on the input.
        SAXParserFactory  spf = SAXParserFactory.newInstance();
  
        // Disable external entity resolving
        spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
        spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
  
        SAXParser sp = spf.newSAXParser();
        XMLReader xr = sp.getXMLReader();
  
        SAXHandler  handler = new SAXHandler();
        xr.setContentHandler(handler);
        xr.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
  
        xr.parse(new InputSource(is));
     }
  
  
  