Re: Using the DocumentFragment Interface

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 UTC