W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: How can DOM possibly contain a document?

From: <keshlam@us.ibm.com>
Date: Fri, 24 Mar 2000 08:56:24 -0500
To: www-dom@w3.org
Message-ID: <852568AC.004C8D05.00@D51MTA03.pok.ibm.com>
> In the example given of:
>     <STRONG>Hello, <I>I'm </I>doing fine</STRONG>
> I think the confusion is in how many children the STRONG element has.
> my understanding it would have three children.

If the document is in normalized form (as delivered by a parser), that's

     Element node named "STRONG"
          +---- Text node containing "Hello, "
          +---- Element node named "I"
          |         |
          |         +---- Text node containing "I'm "
          +---- Text node containing "doing fine"

If you've been manipulating the document before you reach this point, it's
possible that one of the blocks of text may be made up of several
successive Text nodes. In that case, your code can check for and deal with
this possibility, or can use the normalize() operation to request that
adjacent text node be merged before you begin processing.

Joe Kesselman  / IBM Research
Received on Friday, 24 March 2000 08:57:08 UTC

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