-3

I have an app for the iPhone and now I want to use it on Android. The problem is: I can't work with the given XML-File.

Here's a link to the XML-File

Normally I would go through every node, but this won't work here since it seems like a key-value xml-file that also contains arrays.

How can I achieve it in Android/Java now that I can read this data.

Denim Datta
  • 3,740
  • 3
  • 27
  • 53
loomie
  • 606
  • 3
  • 10
  • 21
  • 6
    I don't see why you can't work with it. It's normal XML, use XPath or some XML parser. – Sotirios Delimanolis Sep 11 '13 at 13:49
  • 3
    duplicate of [Apple pList form of XML can I parse it through Android Java?](http://stackoverflow.com/questions/3904418/apple-plist-form-of-xml-can-i-parse-it-through-android-java) and http://stackoverflow.com/questions/11632320/how-to-get-the-values-from-plist-in-android and http://stackoverflow.com/questions/7484163/how-to-parse-plist-file-in-java and http://stackoverflow.com/questions/2451170/java-plist-xml-parsing and othes. You might also consider using a search engine to search for `java xml plist parser` to find other libraries for this. – CommonsWare Sep 11 '13 at 13:50
  • @SotiriosDelimanolis - The problem is that this plist has an array inside an array - Scores. I don't know how to handle this. I can handle simple plist files when they are normally ordered, but I have problems reading them out when they got a string inside an array inside a string inside an array – loomie Sep 11 '13 at 15:27

1 Answers1

1

This type of XML file is called plist in iOS and OS X - short for property list. The easiest way to deal with it is by using XMLWise library. It's open source and is hosted on code.google.com - here is the link.

It has a simple method for reading in the entire file and parsing it into a HashMap, something like this:

String xmlData = ...;
HashMap<?, ?> hashMap = (HashMap<?, ?>) Plist.objectFromXml(xmlData);
Aleks G
  • 56,435
  • 29
  • 168
  • 265