I did actually implemented the handler class. I've also saw your code from earlier post, but now it only outputs the element and nothing else. I've been fooling around with it but with no luck. I'm really new at this. Thanks for your help. Here's how my handler class look like
Code:
package com.sts.example;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.Attributes;
/**
*
*/
public class ResponseHandler extends DefaultHandler {
String builder;
String temp;
public void startDocument() throws SAXException {}
public void startElement(String uri, String name, String qName, Attributes atts){
if ("".equals(uri)){
System.out.println("Start element: " + qName);
}
temp = "";
}
public void endElement(String uri, String name, String qName){
if ("".equals(uri)){
System.out.println("End element: " + qName);
}
}
public void characters(char buf[],int offset,int len) throws SAXException {
temp="";
String temp2;
temp2 = new String(buf, offset, len).trim();
if (!temp2.equals("") || !temp2.equals(" ")){
temp = temp2;
}
else{
temp = "";
}
}
public void endDocument() throws SAXException {}
}