From 22a1cf361ec5c4850c74cd1652dd175d833afe0e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 21 May 2013 16:13:41 +0200 Subject: [PATCH] Show attributes in xml_context function --- src/pazpar2_config.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- 1.7.10.4