Uso il seguente codice per analizzare il file XML.Analisi stringa XML in Android?
DocumentBuilderFactory factory;
DocumentBuilder builder;
InputStream is;
Document dom;
try {
factory = DocumentBuilderFactory.newInstance();
is = new FileInputStream(strFileName);
builder = factory.newDocumentBuilder();
dom = builder.parse(is);
}
catch(Exception e){}
Invece del file XML esiste un modo per analizzare la stringa.
String xml="<?xml version="1.0"?> <name> Application</name> <demo> Demo </demo> </xml>";
Che cosa si sta cercando di fare è molto chiaro. Se hai già una stringa - perché avresti bisogno di un parser XML? – Ofir