Replacing the root element

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 UTC