W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2004

Re: Why is DOMDocument derived from DOMNode ??

From: Philippe Le Hegaret <plh@w3.org>
Date: Fri, 19 Mar 2004 11:25:39 -0500
To: Jaspreet Singh <Jasingh@quark.co.in>
Cc: WWW DOM <www-dom@w3.org>
Message-Id: <1079713539.15531.34.camel@chacal>

On Fri, 2004-03-19 at 11:16, Jaspreet Singh wrote:
> Hi All
> 
> A DOMDocument is just a container. So why is it derived from DOMNode?

DOMNode is also a container, with children, etc.

> For invoking DOMNode functions we should get the DocumentElement from
> the Document and then invoke the functions we need.
> 
> I am trying to implement the DOMDocument interface and I'm quite
> puzzled as to what should be the impl for getFirstChild, etc.

getFirstChild would return the document element, or a processing
instruction if any, etc. Have a look at section 1.1.1 regarding the
possible children of a Document node, or appendix C.1.1 on how to map
the Infoset to a Document node.

Philippe
Received on Friday, 19 March 2004 11:25:40 GMT

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