I would like to parse an xml file. I am trying to locate the error, but i can not find it. Could you help me, pls?xml:\[code\] <data> <id>1</id> <name>x y</name> <age>16</age> <phone>06/30 123-4567</phone> <address>Veszprem Valami ut 10.</address></data><data> <id>2</id> <name>p q</name> <age>18</age> <phone>06/70 987-6543</phone> <address>Budapest Ulloi ut 21.</address></data>\[/code\]XMLParser class:\[code\]package com.example.xmlproba;import java.util.jar.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler;import android.util.Log;public class XMLParser extends DefaultHandler { boolean xmlStartLine = false; boolean id = false; boolean data = http://stackoverflow.com/questions/13733741/false; boolean maintag = false; boolean age = false; boolean name = false; boolean phone = false; boolean address = false; Data currentData; DataContainer dataContainer; public XMLParser(DataContainer dataContainer){ this.dataContainer=dataContainer; Log.d("FUNC","XMLPARSER()"); Data d = new Data(); } public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { Log.d("START","START"); if (qName.equalsIgnoreCase("MAINTAG")) { Log.d("Maintagfound","mtf"); } else if (qName.equalsIgnoreCase("DATA")) { //create new data object currentData = http://stackoverflow.com/questions/13733741/new Data(); Log.d("NEWDATA","NEWDATA"); } else if (qName.equalsIgnoreCase("ID")) { id = true; Log.d("id","id"); } else if (qName.equalsIgnoreCase("NAME")) { name = true; Log.d("name","name"); } else if (qName.equalsIgnoreCase("AGE")) { age = true; } else if (qName.equalsIgnoreCase("PHONE")) { phone = true; } else if (qName.equalsIgnoreCase("ADDRESS")) { address = true; } else { } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { Log.d("END","END"); if (qName.equalsIgnoreCase("DATA")) { //todo at the end of a data node //dataContainer.addDataToList(currentData); //dataContainer.dataList.add(currentData); } } @Override public void characters(char[] ch, int start, int length) throws SAXException { Log.d("CHARS","CHARS"); if (id) { String s = new String(ch, start, length); currentData.setId(Integer.parseInt(s)); Log.d("IDIDID",s); id = false; } else if (name) { String s = new String(ch, start, length); Log.d("NAME1",s); currentData.setName(s); Log.d("NAME2",currentData.getName()); name = false; } else if (age) { String s = new String(ch, start, length); currentData.setAge(Integer.parseInt(s)); age = false; } else if (phone) { String s = new String(ch, start, length); currentData.setPhone(s); phone = false; } else if (address) { String s = new String(ch, start, length); currentData.setAdress(s); address = false; } else { } }}\[/code\]And the parsing part of my activity:\[code\]private void readXML() { // TODO Auto-generated method stub Log.d("FUNC","READXML"); try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); XMLParser xp = new XMLParser(dataContainer); xr.setContentHandler(xp); InputStream is = getResources().openRawResource( R.raw.data); xr.parse(new InputSource(is)); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block Log.d("PARSERCONFEX","PARSERCONFEX"); e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block Log.d("SAXEX","SAXEX"); e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block Log.d("IOEX","IOEX"); e.printStackTrace(); }}\[/code\]From the log.d() i can see that only the log from constructor, the "CHARS" and "END" logs are created.