Re: [xml] getElementsByName is available?
- From: Stefan Behnel <stefan_ml behnel de>
- To: kalyanasundaram s <s kalyanasundaram gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] getElementsByName is available?
- Date: Thu, 28 Jun 2007 09:10:58 +0200
kalyanasundaram s wrote:
I need to parse a huge xml file for a specific set of nodes. Is there
any method like getElementByName is available in libxml. I could not
find it in the document. Does it exists with some other name?
Otherwise i will have to travel in the entire tree. It is inefficient.
No it's not. It just depends on the implementation of getElementByName. :)
You can always use XPath to find the tag. However, if your XML tree is really
so big (note that XPath is pretty fast, so I'd try it first) you may consider
building an index of the tree, i.e. some kind of data structure that maps tag
names to a list of node pointers.
Note that there is also a hash map implementation in libxml2, see hash.c.
Stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]