X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsru_facet.c;h=6802b15c3ba6e9f19df0d5439d7d473633125849;hp=126fb4107269737057886ee1f8a1fe76711e6926;hb=5350317640042c3507172d28d14279595eb7a49f;hpb=7557692f01c3021013c8e9d690e6ab13ea41f21e diff --git a/src/sru_facet.c b/src/sru_facet.c index 126fb41..6802b15 100644 --- a/src/sru_facet.c +++ b/src/sru_facet.c @@ -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 = yaz_use_attribute_create(o, + index_name); if (p_terms) { xmlNode *p;