[xml] Need a API that iterates through Attributes on a givne node



All,

I am using version 2-2.6.4 of the libxml2 library and am looking for an API that would allow me to iterate 
through all the attributes of a given reader node.  I'm hoping the iterator will return a structure with both 
an attribute name and its value.  

Currently, I use something like

attrib = xmlTextReaderGetAttribute (reader, (xmlChar *)"push-id");

to get a specific attribute however, this becomes clumsy and repetitive when all I want is a list of all the 
attribute names and values.

I noticed APIs like xmlTextReaderAttributeCount (reader) and 
xmlTextReaderGetAttributeNo (reader, attrNo) which together can get me the value of all the attributes in the 
reader node, but I don't get the name of attributes.

Is there such an API that I can use to get the name and value of every attribute in a given reader node 
(without having to first provide the name of the attribute)?

Thanx,

Mark Jones
614-367-4576

Just do the right thing - Lafayette Scales




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