Dear All,
1. I am currently trying to parse simple-structured xml
documents using Android SDK DOM Parser API. e.g :
<document>
<docid>"Document1"</docid>
<feature>"Feature1"</feature>
</document>
and so on. not much nesting of elements, a neat, flat document structure. I
download these docs from a web server, but i do not have the schema
definitions yet. For the time being, i can proceed assuming well-defined
documents.
2. I started off as :
BufferedInputStream lBufInputStream = new
BufferedInputStream(new FileInputStream(lPath));
DocumentBuilderFactory lDocBuildFactory =
DocumentBuilderFactory.newInstance();
lDocBuilder = lDocBuildFactory.newDocumentBuilder();
lDocBuilder.parse(lBufInputStream);
Document lXMLDoc = lDocBuilder.newDocument();
if(null != lXMLDoc)
{
NodeList lNodeList = lXMLDoc.getElementsByTagName(new
String("docid")); // the tag is "docid"
if(null != lNodeList)
{
//now, lNodeList contains the doc element with
tag <docid>
//I need to retrieve the value "Document1"
present in this element.
// what API calls should i make?
//similarily with the <feature> element
}
}
Any help would be greatly appreciated...
Thank and Regards,
Ajay
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en