I want to make an app that fetches XML documents from the web that need to be interpreted and rendered, for example:
<doc>
<entity type="person">You</entity> can also look at <ref to="A">A</ref> or <ref to="B">B</ref>.
</doc>
The documents have a pretty complex DTD and a structure that is not static and likely contains thousands of tags.
Let's say I want the ref
elements to be rendered as clickable elements and for the time being ignore the other tags (just show them as ordinary text).
Should I scan the file with an XmlPullParser
, create an internal data structure out of the document and create TextViews
for all text sequences and make ref
tags clickable TextViews
? (This is the method described in the Android dev resource 'Parsing XML Data'.)
Or is it better, performance and UX wise, to convert the document to HTML and use a WebView
? Or do some other parsing trick, like use SimpleXML instead of XmlPullParser
to deserialize the XML?