I have used code from link for parsing xml it worked in versions less than android 2.3 but I am trying to get it done 4.0.3 it doesn't return any value in it at all.How solve this issue.I dont get any errors in the log but I dont get the parsed values as output.Here is the link I used as code
@SuppressWarnings("unused")
public final static Document XMLfromString(String xml) {
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
doc = db.parse(is);
} catch (ParserConfigurationException e) {
System.out.println("XML parse error: " + e.getMessage());
return null;
} catch (SAXException e) {
System.out.println("Wrong XML file structure: " + e.getMessage());
return null;
} catch (IOException e) {
System.out.println("I/O exeption: " + e.getMessage());
return null;
}
return doc;
}