You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Ralph van Etten <ra...@et10.org> on 2008/06/17 18:15:58 UTC

What does nodes does DOMElement::getElementsByTagName return?

Hi,

I have a question about DOMElement::getElementsByTagName("*").
Does this return a list with all nodes below the element including the 
children of the child nodes or just the child nodes ?
I'm not sure how to interpret what it says in the documentation but I 
think it also returns the children of the child nodes. Is this correct ?

Thanks,

Ralph.


RE: What does nodes does DOMElement::getElementsByTagName return?

Posted by Jesse Pelton <js...@PKC.com>.
Neither, actually.  It returns all the elements (not necessarily all the
nodes) that are descendants of the specified element.  From the DOM
spec: "A descendant node of any node A is any node below A in a tree
model of a document, where "above" means "toward the root."  So the list
will include child elements and their children, recursively.

-----Original Message-----
From: Ralph van Etten [mailto:ralph@et10.org] 
Sent: Tuesday, June 17, 2008 12:16 PM
To: c-users@xerces.apache.org
Subject: What does nodes does DOMElement::getElementsByTagName return?

Hi,

I have a question about DOMElement::getElementsByTagName("*").
Does this return a list with all nodes below the element including the 
children of the child nodes or just the child nodes ?
I'm not sure how to interpret what it says in the documentation but I 
think it also returns the children of the child nodes. Is this correct ?

Thanks,

Ralph.