You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as an idea (because I needed that) perhaps this is useful to other people too.
I wanted to have all attributes to an element w/o name reference. I fetch the count via mxmlElementGetAttrCount (see below) and handover a pointer array with 2countsizeof(char *) to mxmlElementGetAllAttr which fills in the references to the name/value pairs.
This was added to mxml_attr.c for version 2.10
Greetings
Otto
void mxmlElementGetAllAttr(mxml_node_t *node, char **pa)
{
int i; /* Looping var */
mxml_attr_t *attr; /* New attribute */
if (!node || node->type != MXML_ELEMENT)
return;
for (i = node->value.element.num_attrs, attr = node->value.element.attrs;
i > 0;
i --, attr ++)
{
*pa++ = attr->name;
*pa++ = attr->value;
}
}
int mxmlElementGetAttrCount(mxml_node_t *node)
{
if (!node || node->type != MXML_ELEMENT)
return (-1);
return (node->value.element.num_attrs);
}
The text was updated successfully, but these errors were encountered:
Version: -feature
Original reporter: Loo
Hi,
as an idea (because I needed that) perhaps this is useful to other people too.
I wanted to have all attributes to an element w/o name reference. I fetch the count via mxmlElementGetAttrCount (see below) and handover a pointer array with 2countsizeof(char *) to mxmlElementGetAllAttr which fills in the references to the name/value pairs.
This was added to mxml_attr.c for version 2.10
Greetings
Otto
The text was updated successfully, but these errors were encountered: