Pages

Wednesday, 23 May 2012

Intializing Sax parser

sax parsing initialization
// create the factory
SAXParserFactory factory = SAXParserFactory.newInstance();
// create a parser
SAXParser parser = factory.newSAXParser();
// create the reader (scanner)(
XMLReader xmlreader = parser.getXMLReader);
// instantiate our handler
CarDetailsHandler handler = CarDetailsHandler.getInstance();
// assign our handler
xmlreader.setContentHandler(handler);
// get our data through the url class

 InputSource is = new InputSource(url);
// perform the synchronous parse
xmlreader.parse(is);

No comments:

Post a Comment