Witam.
Na początek trochę kodu:
public void characters(char[] ch, int start, int length)
throws SAXException {
String textNode = new String(ch, start, length);
strText += textNode;
switch (status) {
case KOD:
kod = textNode;
break;
case KURS:
kurs = textNode;
break;
case DATA:
data = textNode;
break;
default:
break;
}
status = NOTHING;
}
@Override
public void endDocument() throws SAXException {
stringStream += strText;
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
strText += localName;
if (localName.equalsIgnoreCase("Pozycja")) {
Kurs k = new Kurs(kod, kurs);
lista.add(k.toString());
kod = null;
kurs = null;
}
}
public void startDocument() throws SAXException {
}
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
strText += localName;
if (localName.equalsIgnoreCase("kod_waluty")) {
status = KOD;
} else if (localName.equalsIgnoreCase("kurs_sredni")) {
status = KURS;
} else if (localName.equalsIgnoreCase("data_publikacji")) {
status = DATA;
}
}
Parsuję spokojnie plik: http://kurdak.pl/2.xml
Jednak gdy parsuję plik: http://kurdak/3.xml to wywala mi nieznany token.
Bardzo proszę o pomoc.
Pozdrawiam.