+ struct record_metadata_attr **attrp = &rec_md->attributes;
+
+ for (; attr; attr = attr->next)
+ {
+ if (attr->children && attr->children->content)
+ {
+ if (strcmp((const char *) attr->name, "type"))
+ { /* skip the "type" attribute.. Its value is already part of
+ the element in output (md-%s) and so repeating it here
+ is redundant */
+ *attrp = nmem_malloc(nmem, sizeof(**attrp));
+ (*attrp)->name =
+ nmem_strdup(nmem, (const char *) attr->name);
+ (*attrp)->value =
+ nmem_strdup(nmem, (const char *) attr->children->content);
+ attrp = &(*attrp)->next;
+ }
+ }
+ }
+ *attrp = 0;
+