문제

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

도움이 되었습니까?

해결책

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.

다른 팁

check this out-

Working with XML on Android

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top