W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: The phrase: Node created by Document needs clarification

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 30 Aug 2001 12:54:54 -0400
To: www-dom@w3.org
Message-ID: <OF3A420658.0C9100B3-ON85256AB8.005C560B@pok.ibm.com>

normalize() will merge adjacent text nodes. It will _NOT_ discard
whitespace, though it may merge the whitespace with adjacent text if there
was any. (Of course, a parser normally delivers a document in normalize()d
form anyway...)

>Is the user's job to preserve whitespaces (e.g) for correct output when
>using DOM implementations?

Whitespace is officially part of the document's content, per the XML spec.
The DOM preserves it. If you filter it out of the document before building
the DOM, there's nothing we can do about it. Similarly, if your serializer
introduces additional whitespace, there's nothing we can do about that.
Either has the potential to change the document's meaning and shoudl be
done only when you _KNOW_ that the whitespace is not meaningful.

But that's really an XML processing issue, not a DOM issue.

Joe Kesselman  / IBM Research
Received on Thursday, 30 August 2001 12:55:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC