|
Le 14/3/16 08:47, monty a écrit :
> To handle character data (the "b" in "<a>b</a>"), use characters:. But know it's sent multiple times for an element if its character data is separated by other markup like '<a>b<c/>d</a>' (the new comment explains this).
>
> SAX parsing usually ends up needing a stack to track elements and their character data and is tedious but more efficient than DOM.
Oh yes :)
>
> You can't use XPath without DOM, but there's XMLParserStAX, a newer alternative to XMLPullParser that supports building partial DOM trees. Like XMLPullParser, it treats the document as a stream of event (StAX) objects you can "pull" from using a stream protocol (next, peek, atEnd, and others), but it also has messages like nextNode to construct a DOM tree out of the next event(s). You can use XPath on that.
Thanks I will continue my little experiment with Films and OPAX so that
I get the feel.
After I would like to see how I can build importers based on visitors on
top of dom.
Stef
>
>
|