Android, XML parsing similar to E4X?

400 views Asked by At

I am working on a project in Android now that involves parsing XML from a local file.

I have done XML work extensiely in flex and have become used to the power and flexibility of E4X and it's capabilities. I wonder now if I can do something similar in android or will I be forced to parse the XML manually?

Thanks

2

There are 2 answers

1
CommonsWare On BEST ANSWER

Quoting @Andreas_D:

E4X is a language extension, XML is treated like a primitive. E4X is not just for parsing XML, it's using XML as real types.

This can't be simulated or done with a Java 'framework', it would require a language extension for Java.

And, since Android does not have JAXB, you don't have that, either.

You have your choice of DOM, SAX, and the XmlPullParser, plus any third-party Java libraries you can find that have been ported to Android and fit whatever size constraints you may have.

1
Tejas C On

check this out-

Working with XML on Android