W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

Appending DocumentType Nodes

From: Ryan Lubke <Ryan.Lubke@Sun.COM>
Date: 26 Oct 2001 15:51:59 -0400
To: www-dom@w3c.org
Message-Id: <1004125919.1319.46.camel@treepoint.east.sun.com>

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

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

Thoughts?  Comments?


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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC