[xml] ID attribute in xml



Using libxml, I am creating the DOM tree from a parsed XML file. What
i need is to get the pointer to some NODE in the tree from an ID
attribute asigned in the XML file.

Do i have to create the hash table of attributes on my own or is it
created by the following calls, or in any other way?
..
  xmlDocPtr doc;
  xmlNodePtr cur;
...
   /*
    * build an XML tree from a the file;
    */
   doc = xmlParseFile(filename);
   cur = xmlDocGetRootElement(doc);
....

here is the structure of xmlDocPtr

typedef xmlDoc *xmlDocPtr;
struct _xmlDoc {
.
.
   void           *ids;        /* Hash table for ID attributes if any */
   void           *refs;       /* Hash table for IDREFs attributes if any */
.
.

};

thanks,
Kedar



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