W3C home > Mailing lists > Public > www-dom-ts@w3.org > March 2002

Re: How should text be normalized for tests?

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 25 Mar 2002 08:52:47 -0500
To: "Michael B. Allen" <mballen@erols.com>
Cc: www-dom-ts@w3.org
Message-ID: <OF810FD615.C8EEFBA5-ON85256B87.004B17F9@pok.ibm.com>

>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.

______________________________________
Joe Kesselman  / IBM Research
Received on Monday, 25 March 2002 08:53:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:58:46 GMT