Hallo,
ich habe da eine JavaME Anwendung welche eine XML Datei auslesen/auswerten soll. Hier erstmal die Datei:
PHP-Code:
<?xml version="1.0" encoding="UTF-8"?>
<xls:XLS xmlns:xls="http://www.opengis.net/xls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" version="1.1" xsi:schemaLocation="http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd">
<xls:ResponseHeader xsi:type="xls:ResponseHeaderType"/>
<xls:Response xsi:type="xls:ResponseType" requestID="123456789" version="1.1" numberOfResponses="1">
<xls:GeocodeResponse xsi:type="xls:GeocodeResponseType">
<xls:GeocodeResponseList numberOfGeocodedAddresses="1">
<xls:GeocodedAddress>
<gml:Point>
<gml:pos srsName="EPSG:4326">5.29601577296342 55.4639376787194</gml:pos>
</gml:Point>
<xls:Address countryCode="de">
<xls:StreetAddress>
<xls:Street officialName="Im Ã?mminger Feld"/>
</xls:StreetAddress>
<xls:Place type="CountrySubdivision">Hessen</xls:Place>
<xls:Place type="Municipality">Ort</xls:Place>
<xls:PostalCode>12345</xls:PostalCode>
</xls:Address>
<xls:GeocodeMatchCode accuracy="0.7"/>
</xls:GeocodedAddress>
</xls:GeocodeResponseList>
</xls:GeocodeResponse>
</xls:Response>
</xls:XLS>
Und hier erstmal mein Java Code:
PHP-Code:
while(parser.getEventType() != XmlPullParser.END_DOCUMENT){
switch(parser.next()){
case XmlPullParser.START_TAG:
for (int i=0; i<parser.getAttributeCount(); i++ ){
//...
}
try{
System.out.println("Text: "+parser.nextText().toString());
}catch(Exception e){}
break;
case XmlPullParser.END_TAG:
break;
case XmlPullParser.END_DOCUMENT:
isr.close();
break;
}
}
Wichtig sind mir halt die Sachen zwischen den Tags also z.B. die Korrdiniaten (5.29601577296342 55.4639376787194). Doch genau diese Stelle überspringt der Parser, also Sie werden mir nicht in der Konsole ausgegeben... Wenn ich im Switch Case statt parser.next() --> parser.nextTag() eintrage bekomme ich folgende Fehlermeldung:
PHP-Code:
kxml.XmlPullParserException: unexpected type (position:TEXT 5.29601577296342...@1:697 in java.io.InputStreamReader@1cb37664)
Jemand ne Idee? Habe schon stundenland im Netz gesucht und auch schon andere Varianten ausprobiert...
Danke
FoWL: Unterstützungserklärung für...
Heute, 12:14 in gulli:news