Sample XML:
<Books>
<Book id="1" Name="C#">
<URL>http://localhost/download/M1.xml</URL>
</Book>
<Book id="2" Name="Oracle">
<URL>http://localhost/download/M2.xml</URL>
</Book>
<Book id="3" Name="Archius">
<URL>http://localhost/download/M3.xml</URL>
<URL>http://localhost/download/M4.xml</URL>
</Book>
</Books>
I have to fetch only the book name attribute and use it for display .However say for example ,I have got the list of Books ie(C#,Oracle,Archius) ,passing this value to a method should return me an array of URL nodes value within it.
The idea is to display the book names in a list and then on user selection , corresponding URL needs to be fetched.
Was able to get the loop for traversing the nodes
NodeList nodeList = document.getDocumentElement().getElementsByTagName ("Book");
for (int i = 0; i < nodeList.getLength(); i++) {...
SO, a) Display the BookNames b) Get the corresponding URL's for the particular book if I pass the Bookname