I have the folowing XML SAX Handler:
private class GetXML_Handler extends DefaultHandler { int x = 0; public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { Log.i("DataHandler", "Start of XML element"); int y = 0; if (qName.equals("polygon")) { locations.add(x, new ArrayList<location>()); String coordinates = attributes.getValue("coordinates"); String[] parts = coordinates.split(","); System.out.println("Cyklus zacaty"); locations.get(x).add(y, new location(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]))); for(int i = 2; i <= parts.length; i = i + 2){ y++; double Latitude = Double.parseDouble(parts[i].substring(2)); double Longitude = Double.parseDouble(parts[i+1]); locations.get(x).add(y, new location(Latitude, Longitude)); } System.out.println("cyklus skonceny"); x++; } } } However "cyklus zacaty" never gets printed. It prints okay if I move it before String[] parts = coordinates.split(",") . Those strings are rly big (like 350 GPS coordinates) so is it possible that java simply cant handle it and it stops (with no exception).
Also my "Start of XML element" gets printed only 5 times (till first coordinates) but if I remove this split method it prints 28 times (number of my XML elements). I am sure that my XML handler works correctly (its just something about those Strings).
Structure of XML is like this:
<?xml version="1.0" encoding="UTF-8"?> <oblasti> <oblast> <nazovOblasti>VT</nazovOblasti> <polygon> <coordinates> 132456,4658789,0 56487,4864684 </coordinates> </polygon> .... Any suggestions?
Thanks in forward