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

Re: How can DOM possibly contain a document?

From: Darren Clark <dclark@opentable.com>
Date: Thu, 23 Mar 2000 12:43:30 -0800
Message-ID: <005701bf9508$755e8930$0e01000a@opentable.com>
To: <www-dom@w3.org>
----- Original Message -----
From: <keshlam@us.ibm.com>
To: "Bernard Miller" <thatsmrberns2u@yahoo.com>
Cc: <www-dom@w3.org>
Sent: Wednesday, March 22, 2000 9:02 PM
Subject: Re: How can DOM possibly contain a document?


>
> I'm not sure what question you're asking here.  If you know what the type
> of the node is, then you know where its children appear -- for example,
if
> you have an Element node, you know that you have to retrieve its name and
> its attributes to generate and print the start-tag, then print out its
> children (they appear in document order, so this is easy), then print the
> end-tag. Doing this recursively is pretty trivial; doing it nonrecursively
> is a trifle harder but more efficient.
>
> If that doesn't answer your question, I think I need a more specific
> example so I can see what's confusing you...
>

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.  From
my understanding it would have three children.

1. A text node containing "Hello, "
2. An element node with name "I" with a child text node of "I'm "
3. A text node containing "doing fine"

I believe the question was based on the assumption that there are two
children.

1. A text node containing "Hello, doing fine".
2. An element node with name "I" with a child text node of "I'm ".

If that is the case then the point of not being able to identify the
location of the embedded node within the children of STRONG.

********************************************
Darren Clark
Product Architect
415-551-1510 ext. 228
OpenTable.com, Inc.
Restaurant Reservations. Right this way.
http://www.opentable.com
********************************************
Received on Thursday, 23 March 2000 15:43:49 GMT

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