Re: [xml] direct Api to obtain specific child node



2008/9/19 Prashanth R <ramapra gmail com>:
Is there a direct API ( without me writing code to iterate over xmlnodePtr
objects to find a node with a specific name )

Consider this example
<top>
   <elementA></elementA>
  <elementB></elementB>
  <elementZ></elementZ>
</top>

Say I have an xmlNodePtr instance that corresponds to the element - <top>
Now is there a directway of obtaining a ElementZ
Is there an API like this

xmlNodePtr GetChildNodePtr(xmlNodePtr top, const char *childName)

that will return me a reference to element Z

Do i have to iterate thru elements to decide if there is a match ?

Have you tried using the XPath API?


-- 
Aaron Patterson
http://tenderlovemaking.com/



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