I'm builind an application which shows a map with the google api. Using the user input address, I query the API for directions to a destination. The API returns me a XML response which I parse to build my directions objects and show informations to the user.
Everything works but some of my xpath.evaluate()
use do not work as I expect. For example this response :
When I use :
NodeList legList = (NodeList) xpath.evaluate("//route/leg",
response, XPathConstants.NODE);
Even //leg
should do the job right?
When I do a legList.getLength(), it gives me 23 but there are only two leg in the response. Do you know why this strange behavior is happening? I read about XML Namespace but I still don't know what to do, should I specidfy a namespace even if the answer doesn't contain any, and if yes, why do I have to?