According to DOM Level 2, you can not actually insert or remove the root
element of a Document; it must be created at the same time as the Document
node (see the DOMImplementation.createDocument method). This is tied into
the fact that in some DOMs, both the DTD/schema and the namespaced name of
the root element may actually change which classes are instantiated by this
factory.

(Note that DOM Level 1 had no createDocument method -- everyone was using
their own custom APIs for the purpose.)



DOM Level 3 is currently planning to allow implementations to relax this
requirement, by allowing a Document to be created without a root element.
In this special case, it will be permissible to create and insert a root
element... but you may not get the same DOM implementation classes that you
would have if you'd done it all as a single createDocument operation.

(Note that null was made an explicitly permitted argument value in
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/core.html#Level-2-Core-DOM-createDocument)


______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to