W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1999

Replacing the root element

From: Ronald Bourret <rbourret@ito.tu-darmstadt.de>
Date: Fri, 23 Apr 1999 17:40:23 +0200
Message-ID: <01BE8DB0.5EA4C610@grappa.ito.tu-darmstadt.de>
To: "'DOM List'" <www-dom@w3.org>
I just tried replacing the root element with:

a) another element
b) a fragment containing one element
c) a fragment containing two elements

What I expected was that (a) and (b) would succeed and (c) would fail. 
 (Remember that when you replace a node with a fragment, the children of 
the fragment and not the fragment itself are used.)  None of the five DOM 
implementations I tried got the results I expected.  Any opinions as to 
which (if any) is right and why?

-- Ron Bourret

RESULTS:
Data Channel:
(a) DOMException: A node is used in a different document than the one that 
created it.
(b) DOMException: A node is used in a different document than the one that 
created it.
(b) DOMException: A node is used in a different document than the one that 
created it.

Docuverse:
(a) root element replaced
(b) DOMException (no message)
(c) DOMException (no message)

IBM:
(a) root element replaced
(b) root element replaced
(c) root element replaced

Oracle:
(a) root element replaced
(b) DOMException: Node of this type cannot be added
(c) DOMException: Node of this type cannot be added

Sun:
(a) root element replaced
(b) DOMException: This node isn't allowed there
(c) DOMException: This node isn't allowed there
Received on Friday, 23 April 1999 11:42:00 GMT

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