Re: insertBefore within a Document ?

Pat,

>I am getting into troubles with the methods insertBefore, appendChild, ...
>within a Document. If i append a node of type DOCUMENT_TYPE in a Document,
>this node have to be at least after the XMLDecl and before the ElementRoot.
Do
>i have to force the place/index of this Node if i say
>Document.insertBefore(DTDNode, XMLDECLNode) or throws a DOMException ?


This is another grey area in the DOM spec.  Some implementations will force
you to insert at appropriate position and some will not care.  You should
protect yourself by inserting DocumentType into appropriate location.  Note
that there is also nothing about XMLDecl node.

Best,

Don Park
Docuverse

Received on Friday, 16 October 1998 16:53:29 UTC