Search in XML File with XPath in Android

I'm developping an application on android!

Well I have a little conflict now, I want to execute an XPath query but I didn't arrive to solve this problem.

This an example of XML filethat I use:

<?xml version="1.0"?>
  <book id="bk101">
   <author>Gambardella, Matthew</author>
 <title>XML Developer's Guide</title>
 <description>An in-depth look at creating applications 
  with XML.</description>

<book id="bk102">
 <author>Ralls, Kim</author>
 <title>Midnight Rain</title>
 <description>A former architect battles corporate zombies, 
  an evil sorceress.</description>

<book id="bk103">
 <author>Corets, Eva</author>
 <title>Maeve Ascendant</title>
 <description>After the collapse of a nanotechnology 
  society in England.</description>

How can I do??

Thanks in advance!!


Look at this example:

import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class GuestList {
  public static void main(String[] args) throws Exception {
    XPathFactory factory = XPathFactory.newInstance();
    XPath xPath = factory.newXPath();
    NodeList shows = (NodeList) xPath.evaluate("/schedule/show", new InputSource(new FileReader(
        "tds.xml")), XPathConstants.NODESET);
    for (int i = 0; i < shows.getLength(); i++) {
      Element show = (Element) shows.item(i);
      String guestName = xPath.evaluate("guest/name", show);
      String guestCredit = xPath.evaluate("guest/credit", show);
      System.out.println(show.getAttribute("weekday") + ", " + show.getAttribute("date") + " - "
          + guestName + " (" + guestCredit + ")");

The rest of examples are here :

Need Your Help

How to populate UITableView from the bottom upwards?

ios objective-c iphone uitableview ios8

is it possible to reverse the order of a tableView. I have searched a lot for a solution but all the results have not quite been a solution to what I am trying to achieve. They all suggest scrollin...