I didn't use XML files for a very long time and I have forgot how to interact with complicate files. Need to retrieve the value of an Element in an XML file that is sitting too deep in that. For example:
I want to retrieve the latitude value that appears here: DirectionsResponse/route/leg/step/start_location/lat. Need to do the same for Longitude and latitude/Longitude for the end_location. "leg" contains more elements but I want just "step". Also, "step" elements are not always the same quantity, so need to check the size of the "leg" or how many "step" contains. I made some tries but all have failed! Please anybody knows how my for loop should be in order to getting correctly all "start_location" and "end_location" from all "step"?
That's cool thanks for quick reply. There is a problem however. Cause I'm working on Android API 7 and need to stick on that API, I can't use XPath stuff. There is any way to make it work on API 7 or there is an alternative way using SAX Parser?
If you're limited to using only SAX, then you won't be writing any loops anyway. Let's see what code you have so far and maybe you could ask a question about that code.
Ok, I believe is better to stick to current way, because I don't want to mess with new libs. So for example I have a file like this .. link. As you can see contains a lot of <step>. So I want to retrieve from each <step> the <start_location>/<lat>,<lng> and <end_location>/<lat>,<lng>. How I will be able to do that on API 7? For each route the <step> element vary...