X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fxmlquery.c;h=23235092348b8ab0cbbc77f6dd2eb9869cfb0504;hp=3dd3007a9b048ec5a5d2caf05e28f6d3bafe9076;hb=a0e27aac0589d493172c73f6660b844fc6460d7c;hpb=e637973203a49a536a12a78ec9c8af55b7669fc6 diff --git a/src/xmlquery.c b/src/xmlquery.c index 3dd3007..2323509 100644 --- a/src/xmlquery.c +++ b/src/xmlquery.c @@ -1,14 +1,13 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2006, Index Data ApS * All rights reserved. * - * $Id: xmlquery.c,v 1.5 2006-02-23 11:17:25 adam Exp $ + * $Id: xmlquery.c,v 1.9 2006-05-02 20:47:45 adam Exp $ */ -/** - * \file querytostr.c - * \brief Query / XML conversions - */ +/** \file xmlquery.c + \brief Query / XML conversions +*/ #include #include @@ -501,19 +500,7 @@ void yaz_xml2query_attribute_element(const xmlNode *ptr, char *strVal(const xmlNode *ptr_cdata, ODR odr) { - char *cdata; - int len = 0; - const xmlNode *ptr; - - for (ptr = ptr_cdata; ptr; ptr = ptr->next) - if (ptr->type == XML_TEXT_NODE) - len += xmlStrlen(ptr->content); - cdata = (char *) odr_malloc(odr, len+1); - *cdata = '\0'; - for (ptr = ptr_cdata; ptr; ptr = ptr->next) - if (ptr->type == XML_TEXT_NODE) - strcat(cdata, (const char *) ptr->content); - return cdata; + return nmem_text_node_cdata(ptr_cdata, odr->mem); } void yaz_xml2query_term(const xmlNode *ptr, @@ -787,7 +774,7 @@ static void yaz_xml2query_(const xmlNode *ptr, Z_Query **query, ODR odr, void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr, int *error_code, const char **addinfo) { - return yaz_xml2query_(xmlnodep, query, odr, error_code, addinfo); + yaz_xml2query_(xmlnodep, query, odr, error_code, addinfo); } /* HAVE_XML2 */