Re: How should text be normalized for tests?

On Mon, 25 Mar 2002 08:52:47 -0500
"Joseph Kesselman" <keshlam@us.ibm.com> wrote:

> 
> >Expat returns separate #text fragments for newlines and space
> 
> That doesn't comply with the expectations which the DOM places upon XML
> processors. See the description of Text nodes:
> 
>    "When a document is first made available via the DOM, there is only one
>    Text node for each block of text. Users may create adjacent Text nodes
>    that represent the contents of a given element without any intervening
>    markup, but should be aware that there is no way to represent the
>    separations between these nodes in XML or HTML, so they will not (in
>    general) persist between DOM editing sessions. The normalize() method on
>    Node merges any such adjacent Text objects into a single node for each
>    block of text."
> 
> Your choices would seem to be to either (a) accept that Expat is going to
> fail compliance tests which are based on the above assertion (which
> requires that your test results explain why this isn't a "first made
> available" situation), or (b) write your test driver so it calls normalize
> () before running the tests (ditto) or (c) fix Expat's DOM builder.

Ok. I must have missed the part you cite here. I'm learning all sorts of
new things about my implementation (read deficiencies) from running the
test suite. I'll have to fix my builder (has nothing to do with expat)
but for now I will just normalize() the tree after it's loaded.

Thanks,
Mike

-- 
May The Source be with you.

Received on Tuesday, 26 March 2002 04:01:09 UTC