Я испытываю затруднения для нахождения способа извлечь список всех свойств узла, не зная то, чем их называют.
Я извлекаю единственное известное использование свойств:
xmlGetProp(cur, (const xmlChar*)"nodename")
Но как получить список всех свойств с помощью libxml2?
С уважением, marius
Просто прокрутите список свойств узла, например:
xmlNodePtr Node = ...;
for(xmlAttrPtr attr = Node->properties; NULL != attr; attr = attr->next)
{
... do something with attr ...
... the name of the attribute is in attr->name ...
}
Interesting, does not appear to be a method that does this (though oddly there is xmlFreePropList function), but the xmlNode structure has a pointer to a list of the properties (attributes) of the node. You can probably get a pointer to that structure.