X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsru_facet.c;h=7821f6641a2a8c55a038dfdcb88fbf2dc1c31a30;hp=714d8e909b390db799f9a3b094ac70051d4c2496;hb=01e36a11adc97a240cc595f89280c8a619770251;hpb=ec0d220ff7a4d9b8aeaa5ce3ffcfc57a6b845287 diff --git a/src/sru_facet.c b/src/sru_facet.c index 714d8e9..7821f66 100644 --- a/src/sru_facet.c +++ b/src/sru_facet.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** @@ -259,32 +259,8 @@ void yaz_sru_facet_response(ODR o, Z_FacetList **facetList, xmlNodePtr n) p_terms = p2; } if (index_name) - { - Z_AttributeList *al = - (Z_AttributeList*) odr_malloc(o, sizeof(*al)); - Z_ComplexAttribute *ca = - (Z_ComplexAttribute *) odr_malloc(o, sizeof(*ca)); - Z_AttributeElement *ae = - (Z_AttributeElement *) odr_malloc(o, sizeof(*ae)); - al->num_attributes = 1; - al->attributes = (Z_AttributeElement **) - odr_malloc(o, sizeof(*al->attributes)); - al->attributes[0] = ae; - ae->attributeSet = 0; - ae->attributeType = odr_intdup(o, 1); - ae->which = Z_AttributeValue_complex; - ae->value.complex = ca; - ca->num_semanticAction = 0; - ca->semanticAction = 0; - ca->num_list = 1; - ca->list = (Z_StringOrNumeric **) - odr_malloc(o, sizeof(*ca->list)); - ca->list[0] = (Z_StringOrNumeric *) - odr_malloc(o, sizeof(**ca->list)); - ca->list[0]->which = Z_StringOrNumeric_string; - ca->list[0]->u.string = index_name; - ff->attributes = al; - } + ff->attributes = + zget_AttributeList_use_string(o, index_name); if (p_terms) { xmlNode *p;