Appending DocumentType Nodes

Hello,

I'm looking for clarification on teh validity of appending
DocumentType nodes using Document.appendChild().

From consultations with peers, the Dom Lvl2 way of creating a Document
with a DocumentType is:
   dtd = domImplementation.createDocumentType( "root", null, null );
   domImplementation.createDocument( null, "root", dtd );

However should the following code work or throw a DOMException
of type WRONG_DOCUMENT_ERR:


document.appendChild(document.getImplementation().createDocumentType("root", null, null));

Thoughts?  Comments?

Thanks,

Ryan Lubke
	

Received on Friday, 26 October 2001 15:46:57 UTC