From a130d7f7619fda29468cb4a1bfdbef955d4eab4d Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Sun, 7 Jan 2007 15:55:02 +0000 Subject: [PATCH] Added output of XML config dom tree to SRU explain. Still need to merge zeerex_explain and sru_z3950 filter into one filter. --- src/sru_util.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sru_util.cpp b/src/sru_util.cpp index e116592..48e02b3 100644 --- a/src/sru_util.cpp +++ b/src/sru_util.cpp @@ -1,4 +1,4 @@ -/* $Id: sru_util.cpp,v 1.5 2007-01-07 00:41:18 marc Exp $ +/* $Id: sru_util.cpp,v 1.6 2007-01-07 15:55:02 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -158,7 +158,15 @@ bool mp_util::build_sru_explain(metaproxy_1::Package &package, "\n"); } else { - explain_xml = ""; + // make new XML DOC with given explain node + xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0"); + xmlDocSetRootElement(doc, (xmlNode*)explain); + + xmlChar *xmlbuff; + int xmlbuffsz; + xmlDocDumpFormatMemory(doc, &xmlbuff, &xmlbuffsz, 1); + + explain_xml.assign((const char*)xmlbuff, 0, xmlbuffsz); } -- 1.7.10.4