From: Adam Dickmeiss Date: Tue, 21 May 2013 14:13:41 +0000 (+0200) Subject: Show attributes in xml_context function X-Git-Tag: v1.6.31~9 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=22a1cf361ec5c4850c74cd1652dd175d833afe0e;p=pazpar2-moved-to-github.git Show attributes in xml_context function --- diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 698fb15..81f0e55 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -66,8 +66,19 @@ struct service_xslt static char *xml_context(const xmlNode *ptr, char *res, size_t len) { + xmlAttr *attr = ptr->properties; size_t off = len - 1; + res[off] = '\0'; + for (; attr; attr = attr->next) + { + size_t l = strlen((const char *) attr->name); + if (off <= l + 1) + break; + off = off - l; + memcpy(res + off, attr->name, l); + res[--off] = '@'; + } while (ptr && ptr->type == XML_ELEMENT_NODE) { size_t l = strlen((const char *) ptr->name);