-1

I am trying to get info out of an XML file in android studio. So far I have followed the steps described in this link:

http://www.sitepoint.com/learning-to-parse-xml-data-in-your-android-app/

The XML data i'm searching is in this form

<parks>
<product _id="3" _uuid="F7BB884C-6B89-450B-AEC1-FF0664C37B87" _position="3" _address="http://data.cityofchicago.org/resource/y7qa-tvqx/3">
<park>ABBOTT (ROBERT)</park>
<park_number>259</park_number>
<facility_name>SPRAY FEATURE</facility_name>
<facility_type>OUTDOOR</facility_type>
<x_coordinate>1178475.8803999999</x_coordinate>
<y_coordinate>1841904.3723200001</y_coordinate>
<location latitude="41.721488999999998" longitude="-87.621871999999996" needs_recoding="false"/>
</product>
</parks>   

I can get all the info out of it except the location which is not like the others with an opening and closing tag. How would identify that tag based on the code in the example link? I'm trying to get that part into a Location variable. I know I could just create a attitude and longitude tag but the dataset is quite large

J05236
  • 3
  • 1
  • first learn what is XML ... then learn what is the name of this part: `latitude="41.721488999999998"` of xml's tag ... then ask google about how to get it from pull parser ... i'm pretty sure that you will find similar question asked here already ... all of this should take less time then writing the question(I'm pretty sure already asked) here – Selvin Nov 13 '14 at 23:34
  • http://bit.ly/1urfsoU *Was that so hard* – Selvin Nov 13 '14 at 23:42
  • OK, you are right, I should have looked into XML a little further. I appreciate the help anyway though. – J05236 Nov 14 '14 at 14:08

1 Answers1

0

Basically, if you follow Selvin's link and select the first result you find the answer from stackoverflow again.

How I get Attribute using by XMLPull parser

Community
  • 1
  • 1
AbuJaFaR
  • 58
  • 2
  • 7