Re: Implementing Document.createElement, etc.

Yes, Alan, you've read it correctly.

>My current (mis)understanding is that when an element is created using
>Document.createElement that it is not yet part of the document hierarchy.

True. It has an ownerDocument (the Document whose factory you used to
produce it), but has no parent or siblings; you've created an "orphan"
node. It has no parent until you insert or append it to another node.

>these newly created nodes can node <sic> be found by any of the methods
used
>to traverse the document tree

I presume you meant "can not be found" -- which is entirely correct.

>a Document object that is used to create an Attribute object with
>Document.createAttribute() would not return that Attribute

Also correct. It isn't an attribute of the Document -- in fact, Documents
can't have Attributes -- and it isn't an attribute of any Element until you
assign it to one.

______________________________________
Joe Kesselman  / IBM Research
Unless stated otherwise, all opinions are solely those of the author.

Received on Thursday, 8 October 1998 11:27:51 UTC