Ked pouzivas SAX parser, tak potrebujes mat vhodne implementovany Handler...
na ten tvoj pripad by to mohlo byt nieco taketo,
sprocesuje len tagy <td> a vytiahne ich obsah a hodnoty atributov title a class..
Namiesto tych system.outov si tam daj vlasntu logiku co potrebujes s datami urobit...
private static class TableHandler extends DefaultHandler {
private boolean tdNodeProcessing;
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if(qName.equals("td")) {
tdNodeProcessing = true;
int index = attributes.getIndex("class");
if(index != -1) {
System.out.println("class: " + attributes.getValue(index));
}
index = attributes.getIndex("title");
if(index != -1) {
System.out.println("title: " + attributes.getValue(index));
}
}
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if(qName.equals("td")) {
tdNodeProcessing = false;
}
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
if(tdNodeProcessing) {
System.out.println("obsah-td:" + String.valueOf(ch, start, length));
}
}
}