W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

adding DocumentFragment to a Node

From: Deke Smith <deke@tallent.com>
Date: Tue, 3 Nov 98 15:26:12 -0600
To: "DOM List" <www-dom@w3.org>
Message-ID: <1302015725-11881211@tallent.com>
I have an implementation question about inserting a DocumentFragment Node 
into another Node.

My apologies if this has been discussed before.

I do not know what to return as the value for the methods which insert 
Nodes when the Node being added is a DocumentFragment. The 
DocumentFragment is not added into the Node, its content is. That content 
can be multiple Nodes at the "root" level of the DocumentFragment.

The return value should be the Node added. Since, after being inserted 
into another Node the DocumentFragment no longer exists, what is 

From the description of Node.insertBefore in the DOM spec:

"If newChild is a DocumentFragment object, the entire contents of the 
fragment are moved into the child list of this node."

and later:

"Return Values
     The node being inserted."



Deke Smith
Tallent Communications Group, Brentwood TN
deke@tallent.com, 615-661-9878
" The best way to predict the future is to invent it. " 
       - Alan Kay 
Received on Tuesday, 3 November 1998 16:26:18 UTC

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