You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Morten Primdahl <mo...@it-c.dk> on 2002/04/24 01:17:19 UTC

Document.insertBefore (from Node interface)

Hi. I was curious about how one should treat the insertBefore
method of the Node interface in the Document implementation.

I don't quite have a grand overview of the entire Xerces implementation,
but in CoreDocumentImpl.java I found:

   super.insertBefore(newChild,refChild);

   // If insert succeeded, cache the kid appropriately
   if (type == Node.ELEMENT_NODE) {
       docElement = (ElementImpl)newChild;
   }

And ParentNode seems to indeed insert the child. So a document
can have multiple children? The element returned by getDocumentElement
returns the docElement, but should a such be able to have siblings?
There should only be one top level element to my understanding. What
am I missing here?

Thanks,

Morten



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org