+
+ while (root && root->type != XML_ELEMENT_NODE)
+ root = root->next;
+ if (!root)
+ set.value = value ? value : valuea;
+ else
+ { /* xml document content for this setting */
+ xmlDoc *doc = xmlNewDoc(BAD_CAST "1.0");
+ if (!doc)
+ {
+ if (set.name)
+ yaz_log(YLOG_WARN, "bad XML content for setting "
+ "name=%s", set.name);
+ else
+ yaz_log(YLOG_WARN, "bad XML content for setting");
+ ret_val = -1;
+ }
+ else
+ {
+ int len_out;
+ xmlDocSetRootElement(doc, xmlCopyNode(root, 1));
+ xmlDocDumpMemory(doc, &buf_out, &len_out);
+ /* xmlDocDumpMemory 0-terminates */
+ set.value = (const char *) buf_out;
+ xmlFreeDoc(doc);
+ }
+ }