This is the code which I was using for android 2.3 . and it use to work properly.
But don no why it doesn’t seem to work in android 3.0
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try
{
try
{
while(this.xml.available()>0)
Log.e("content", ""+this.xml.read());
}
catch (Exception e) {
// TODO: handle exception
Log.e("error", "while reading the file");
}
this.xml.reset();
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = builder.parse(this.xml);
Element root = dom.getDocumentElement();
Log.d(TAG, "have root?"+dom.getLocalName());;
Log.d(TAG, "have root?"+dom.getInputEncoding());;
Log.d(TAG, "have root?"+dom.getNodeValue());;
}
catch (Exception e)
{
Log.e(TAG, e.getMessage(), e);
}
//Log.d(TAG, "Exit: parse");
return stores;
}
The innner while displays the file contents in numbers.
But when I get the dom.* I get null why is it so ?
Any suggetions ?
seems the way the element are accessed are a bit different now.
For others check out the new ways of writing it.
Thanks