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
Hi 

DOM Level 2 specification  for DocumentFragment says that 
(see:http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-B63ED1A3
<snip>
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.
</snip>

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

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


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 ?

Cheers,
Arun.

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT