views:

31

answers:

1

Hi folks,

I am a newbie in the Android world, having limited experience in Java from my varsity days decades ago. These days I am a pampered dev in the .NET world.

These days I am a proud owner of an HTC Desire and decided to try my hand at Android dev. Now I have struck a bit of a dilemma. I am writing an app which heavily uses XML chunks of data. I immediately notice there are two ways of doing this - I can laboriously navigate down from the root level, or (somewhat less laboriously) I can use XPath. The trouble is XPath is only supported at a minimum API level of 8 according to the docs. Ideally I would like to support down to 4 (which is 1.6 I think?)

What is the best way of doing this? Are there external libraries or packages I can use? Please remember I am a complete newbie so please correct me if I am mistaken in any of the above.

Many thanks, Dany.

+1  A: 

If you want a lightweight way to parse XML, use an XmlPullParser.

It's not as pretty or compact as a single XPath expression but it's way more efficient. This is used by the framework.

ralfoide
Thanks - I saw that in one of the examples. Will have to check it out...
DanyW