Hello I just wrote a little pieve of code to start reading xml
attributes in. I have managed to read in attribute values, however I
would like to be able to get the name of the attribute as well.

Can someone point me to an example? Or provide a suggestion ...

My code is below ...

Cheers,

Jim

int     numattrs = xmlTextReaderAttributeCount(reader);

if( (numattrs%2)!=0 ) 
{
        printf("Error: every attr should have a value!\n");
}
                        
for(int j=0; j < numattrs; j+=1)
{
        const xmlChar * attrname;
        
        /*HERE IS WHERE I NEED THE NAME :-) */
        attrname= "name";//xmlTextReaderGetAttributeNo(reader, j);

        const xmlChar * attrval;
        attrval=xmlTextReaderGetAttributeNo(reader,j);                  
        printf(" %s = %s ", attrname, attrval);
}

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to