RillaBafhix
New Member
i new to android so if m asking something stupid so m sorry for that. m working with the weather parsing in android. m using the SAX parser. now i am stuck with the content handler.with so many tutorials i got the idea for parsing the data but all of those examples were based on the XML file that does contain the attributes in the tags. for my XML file from where m retrieving data there no attributes in he tags but the child nodes. now i m stuck here an don't have any idea how can i get the values of the child node.\[code\] <data> <request> <type>City</type> <query>Peshawar, Pakistan</query> </request> <current_condition> <observation_time>01:04 PM</observation_time> <temp_C>20</temp_C> <temp_F>68</temp_F> <weatherCode>113</weatherCode> <weatherIconUrl> </weatherIconUrl>\[/code\]now i want to get the data from the "" and the "" and i am really unable to find it please help me. here is my code for the content handler class.\[code\] public class HandlingXmlStuff extends DefaultHandler {XmlDataCollected info=new XmlDataCollected();public String getInformation(){ return info.dataToString();}@Overridepublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // TODO Auto-generated method stub if(localName.equals("query")) { String city=....???; info.setCity(city); } else if(localName.equals("temp_f")) { String t=...???; int temp=Integer.parseInt(t); info.settemp(temp); } } }\[/code\]