I have created an xml file and stored in my sdcard.I am using DOM parser to retrieve it.My xml file is like.I have used a simple xml file for demo.It is:
<?xml version="1.0"?>
<root>
<staff>
<word>1</word>
<meaning>one</meaning>
</staff>
<staff>
<word>2</word>
<meaning>two</meaning>
</staff>
</root>
In my activity i have an autocompletetextview.In it when i enter 1 which is given in word it should show the value “one” which is given in its meaning.Is it possible to do this and how?
Get node list by using
getElementsByTagName("staff")get child nodes
getChildNodes()Now get nodename
getNodeName()and node valuegetNodeValue()See this below code: