W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

Empty DocumentFragment when appended to DocumentType node throw DOMException or not ?

From: Arun Yadav <Arun.Yadav@sun.com>
Date: Wed, 3 Apr 2002 08:29:59 +0000 (Asia/Calcutta)
Message-Id: <200204030830.g338U0F13262@blr-root.India.Sun.COM>
To: www-dom@w3.org
Cc: elitani@ca.ibm.com, arun.yadav@sun.com

DOM Level 2 specification  for DocumentFragment says that 
When a DocumentFragment is inserted into a Document (or indeed any other Node that may take children) the children of the 
DocumentFragment and not the DocumentFragment itself are inserted into the Node.
  the DocumentFragment acts as the parent of these nodes so that the user can use the standard methods from the Node interface, such as 
insertBefore and appendChild.

and http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-412266927):
    Interface DocumentType 
     The DOM Level 2 doesn't support editing DocumentType nodes.

that means appending any child node to DocmentType Node throws the DOMException "NO_MODIFICATION_ALLOWED_ERR : Raised if node is 

Now,My Question is 

If  Empty DocumentFragment Node is appended to DocumentType Node , Should parser throw the DOM Exception "NO_MODIFICATIO_ALLOWED_ERR" ?

My reading to DOM Spec. says  _No_, parser should not throw the exception because when we  append the DocumentFragment Node to any other 
Node, children of Documnet Fragment are appended. So, When Empty DocumentFragment Node is appended, no attempt is made to add any node 
to DocumentType and DocumentType remain  unmodified. Xerces2 is not throwing exception in this case. 

What's ur opinion ? Do I mis-understand anything,  Please Clarify ?


Sun Microsystem Inc.
Received on Wednesday, 3 April 2002 08:56:13 UTC

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