[Expat-discuss] Text data handler
Thomás Inskip
tinskip at widevine.com
Fri May 21 16:50:06 EDT 2004
Yep. That was it. A misunderstanding of what constitutes a
"document". I got around the problem by priming the parser with a fake
document start tag. Not a pretty fix, but after that it did what I
expected it to.
Thanks for your help.
On May 21, 2004, at 4:29 PM, Thomás Inskip wrote:
> It turns out the problem is very different, and I had made an invalid
> assumption. There are two "outermost" xml elements being parsed, one
> after the other. The first one contains no element data (only
> attributes), but the second one does. So I am dealing with something
> that looks like:
>
> <a>
> <b attribute="value"></b>
> </a>
> <c>
> <d>some text</d>
> </c>
>
> But without the linefeeds. I had assumed that the problem was that my
> text callback handler was the problem because I already knew that my
> element start and end handlers were being called (for "a" and its
> sub-elements).
>
> The manual says something about needing a separate parser for each
> "document". What is the exact definition of a document? Is a
> document a data stream, or is the above two separate documents because
> there are two top-level elements (one defined by element a, and the
> other one by element d)? Perhaps Expat was not meant to do what I am
> asking it to do.
More information about the Expat-discuss
mailing list