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

RE: How can DOM possibly contain a document?

From: Thomas Ashe <Thomas.Ashe@Blackbaud.com>
Date: Thu, 23 Mar 2000 08:52:58 -0500
Message-ID: <05325001EB71D311A4DD00E029347C268EA613@ntpd.blackbaud.com>
To: "'Bernard Miller'" <thatsmrberns2u@yahoo.com>, www-dom@w3.org
Bernard,

The DOM in script would look something like this:

var oStrong = document.createElement('STRONG')
var oText1 = document.createTextNode('Hello, ')
var oI = document.createElement('I')
var oText2 = document.createTextNode('I\'m ')
var oText3 = document.createTextNode('doing fine')

oI.appendChild(oText2)
oStrong.appendChild(oText1)
oStrong.appendChild(oI)
oStrong.appendChild(oText3)

As you can see, the STRONG element has three childNodes, a text node, an I
node(which contains a text node), and another text node.

I think the part you are missing is that the text in the STRONG element are
nodes themselves.

Hope this helps.

Regards,

-Tom


> -----Original Message-----
> From: Bernard Miller [mailto:thatsmrberns2u@yahoo.com]
> Sent: Wednesday, March 22, 2000 8:01 PM
> To: www-dom@w3.org
> Subject: How can DOM possibly contain a document?
> 
> 
> Let's say you have a simple nested tag like:
> 
> <STRONG>Hello, <I>I'm </I>doing fine</STRONG>
> 
> I'm having a hard time understanding how one can use
> any combination of DOM functionality to reconstruct a
> document with nested tags. In my primitive
> understanding, the nested tag element is a child
> object and as far as I can tell you can query the
> parent for WHAT the child is, and in what order the
> child appears among other children, but not WHERE it
> is in the text of the parent. Please enlighten me.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
> 
Received on Thursday, 23 March 2000 08:53:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT