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



you could try something like

xmlTextReaderMoveToFirstAttribute(reader);
while(xmlTextReaderRead(reader))
{
        name = xmlTextReaderName(reader);
        value = xmlTextReaderValue(reader);
}
xmlTextReaderMoveToElement(reader);

Servus -- Alfred

-----UrsprÃngliche Nachricht-----
Von: xml-bounces gnome org [mailto:xml-bounces gnome org]Im 
Auftrag von
Jones, Mark A (Mark)
Gesendet: Mittwoch, 27. Oktober 2004 14:33
An: 'Danilo Segan'; Jones, Mark A (Mark)
Cc: 'xml gnome org'
Betreff: RE: [xml] Need a API that iterates through Attributes on a
givne node


All,

Thanx for your helpful suggestions.  I will experiment later.

I still remain hopeful that a higher level API would emerge 
such that one would not have to be concerned with the tree 
implementation.  Just like an API exists to provide the value 
of an attribute for a given attribute number, I think one 
should exist that gives the name and value for a given 
attribute number.  This makes for a cleaner interface between 
the library and the application.

Why don't I write it?  Firstly, it pays to make sure that it 
does not already exists.  Secondly, as with most of, time is 
too precious and costly.

Again, thanx,

M. Jones

-----Original Message-----
From: Danilo Segan [mailto:dsegan gmx net]
Sent: Tuesday, October 26, 2004 2:38 PM
To: Jones, Mark A (Mark)
Cc: xml gnome org
Subject: Re: [xml] Need a API that iterates through Attributes on a
givne node


Today at 19:58, Danilo Åegan wrote:

At least that's how Python bindings and xmlNode.properties (or
.get_properties()) seem to work.  So, I may be wrong, but even C
implementation of properties seems to indicate this is the case.

Actually, this implementation does the following:

    if (cur->type == XML_ELEMENT_NODE)
        res = cur->properties;
    else
        res = NULL;

So, this is probably what you're after.

Cheers,
Danilo
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml



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