How did you create your DocumentFragment? From the existing nodes (b1 and
b3)? If so, then I would expect according to the same snippet from the spec
you have below, that the DocumentFragment you created from those nodes is
not a copy of them, rather a reference. If you insert the DocumentFragment
as a child of another node, then the elements you referenced would move to
that new location.
If you created a DocumentFragment from scratch and made copies of 'b1' and
'b3', then I agree that this seems like an odd behavior.
--------------
Brion Swanson - West Group / Rochester, NY
mailto:[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 6:47 AM
To: [EMAIL PROTECTED]
Subject: DocumentFragment (bug?)
Does anyone have a rational explanation why when I replace a node's child
with a DocumentFragment, the later is emptied, or is it a bug?
For example if I have :
<a>
<b>
<b1/>
<b2/>
<b3/>
</b>
<c>
<c1/>
</c>
</a>
and I create a document fragment that contains b1 and b2, and then call
c.replaceChild( docFrag, c1), I get
<a>
<b>
<b2/>
</b>
<c>
<b1/>
<b3/>
</c>
</a>
which is correct. But I would expect the document fragment to still contain
b1 and b2, which it doesn't with Xerces 1.4.3.
Reading the DOM level 2 doc, I can't see a reasonable explanation either,
also it says "various operation --such as inserting nodes as children of
another node-- result in all the node of the docfrag being MOVED to the
child list of the node". But I would understand that as being moved from
<b> to <c>. After all, if I remove the children of a DocumentFragment, they
are not removed from their owner node are they?
Thanks for any answer.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]