Re: [xml] API to get # of child Nodes



On Wed, Oct 29, 2008 at 11:38:29AM -0700, Prashant R wrote:
Is there a direct way  ( API or otherwise)(other than iterating over child
nodes and incrementing a counter ) to  obtain the number of element nodes
under a given xmlNodePtr variable  ?

  no, you need to iterate. Since in general it really depends on the
kind of nodes used (comments would not count for the user for example)
the APi would be mostly useless. Only the application knows what it's
interested in and the XML layer has the mandate to report everything.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]