The trick when working with SAX is to remember that you have to catch things on the fly. This is completely different from the DOM approach. The methods to do this are all defined in SAX interfaces. The SUN JAXP package has some SAX examples.
To give you a feeling - the startElement method is called when SAX hits a tag that starts an element. In this fragment I set the lookForTitle variable when that happens.
//
public void startElement(
String name, AttributeList attrib)
throws SAXException
{
if( "Title".equals( name )){
lookForTitle = true ; return ;
}
.... method continues
NOW - when SAX finds Element content it calls the characters method with pointers to a buffer where the content is, but this method gets called for all content so you have to keep track of which element you are in.
public void characters( char[] buf, int start, int count ){
if( lookForTitle ){
/// process characters.....