Re: [gdome] how to point to an element in the DOMtree?
- From: Luca Padovani <lpadovan cs unibo it>
- To: Sameer Oak <sameer oak airtightnetworks net>
- Cc: lpadovan cs unibo it
- Subject: Re: [gdome] how to point to an element in the DOMtree?
- Date: Wed, 18 May 2005 14:05:23 +0200
On Wed, 2005-05-18 at 14:39 +0530, Sameer Oak wrote:
> But, I am not being able to figure out the way how can I locate to the
> root element of the DOM tree, and Also, for that matter, some other
> element which is a child element of some element?
the gdome_doc_documentElement method does exactly this, it returns the
root element of a DOM document.
As for reaching a particular element, one has indeed the possibilities
you've listed (xpath or walking). In addition, there are a few helper
DOM methods that can be useful, in particular
getElementsByTagName
getElementsByTagNameNS
in the Document interface. These methods however can be very inefficient
if used for reaching not just one node but a whole list of nodes. In
this case I'd recommend walking the tree.
Cheers
--luca
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]