[xml] multiple Attribute values?
- From: Gregor Zeitlinger <zeitling informatik hu-berlin de>
- To: <xml gnome org>
- Subject: [xml] multiple Attribute values?
- Date: Sun, 11 Aug 2002 22:48:21 +0200 (CEST)
Hi,
I just came accross the following piece of code in a project, which
attemps to retreive multiple values of a single attribute. Is this
possible?
The code uses libxml 1.8.6
Since val has a next member, you could think this is possible.
void FileLoader::copyAttributes (Node *node, ::xmlNodePtr libxmlNode)
{
::xmlAttrPtr libProp = libxmlNode->properties;
while (libProp != NULL)
{
::xmlNodePtr libVal = libProp->val;
// Attribute mit erstem Value
Attribute* att = node->appendAttribute (Attribute::CData,
libProp->name,
libVal->content);
libVal = libVal->next;
// restliche Values
//this is an error! there cannot be more than one attribute value
while (libVal != NULL)
{
AttributeValue* val = att->appendValue (libVal->content);
delete val;
libVal = libVal->next;
}
delete att;
libProp = libProp->next;
}
}
--
Gregor Zeitlinger
gregor zeitlinger de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]