Following code shows how to create and initialize a SAXParser object.

Java Code:
try {             
SAXParser saxParser = new SAXParser();
saxParser.setContentHandler(saxTree);
saxParser.parse(new InputSource(new FileInputStream(file)));
}catch(Exception ex)
{ex.printTrace();}