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

Re: Using the DocumentFragment Interface

From: Oliver Becker <obecker@informatik.hu-berlin.de>
Date: Fri, 9 Apr 1999 08:52:44 +0200 (MET DST)
Message-Id: <199904090652.IAA18006@mail.informatik.hu-berlin.de>
To: www-dom@w3.org, byrnes@prl.research.philips.com
Hi Nigel,

> I have a requirement to find out how many times an Element of a
> particular name  occurs in a subtree of document below a Node n. The
> approach which I believe I should take is:
> 
> - create a subtree whose root is at n
> - employ the getElementsByTagName(name) method to generate an
> appropriate NodeList

I don't really understand why you want to create a subtree.
The Element interface contains the getElementsByTagName method which
"returns a NodeList of all descendant elements with a given tag name ..."
That is what you want, isn't it?
So where is the problem?

Regards,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@informatik.hu-berlin.de             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
Received on Friday, 9 April 1999 02:52:51 GMT

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