Replace z:meta node with embedded record instead of adding it.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 9 Jul 2008 09:47:16 +0000 (11:47 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 9 Jul 2008 09:47:16 +0000 (11:47 +0200)
index/mod_dom.c
test/xslt/dom1.c

index 95c8a06..ad97171 100644 (file)
@@ -399,11 +399,11 @@ static int process_meta(struct filter_info *tinfo, xmlDocPtr doc, xmlNodePtr nod
                 if (ret == 0)
                 {
                     xmlDocPtr sub_doc = 
-                        xmlParseMemory(    wrbuf_buf(result), wrbuf_len(result));
+                        xmlParseMemory(wrbuf_buf(result), wrbuf_len(result));
                     if (sub_doc)
                     {
                         xmlNodePtr t = xmlDocGetRootElement(sub_doc);
-                        xmlAddChild(node, xmlCopyNode(t, 1));
+                        xmlReplaceNode(node, xmlCopyNode(t, 1));
                         xmlFreeDoc(sub_doc);
                     }
                 }
index 10c4834..957b83a 100644 (file)
@@ -80,10 +80,9 @@ void tst(int argc, char **argv)
                      zh, "snippet", yaz_oid_recsyn_xml,
                      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                      "<root>\n"
-                     "  <z:meta xmlns:z=\"http://indexdata.com/zebra-2.0\" name=\"snippet\">"
-                     "<record xmlns=\"http://www.indexdata.com/zebra/\">\n"
+                     "  <record xmlns=\"http://www.indexdata.com/zebra/\">\n"
                      "  <snippet name=\"title\" type=\"w\">How to program a <s>computer</s></snippet>\n"
-                     "</record></z:meta>\n"
+                     "</record>\n"
                      "  <title>How to program a computer</title>\n"
                      "</root>\n"),
                  ZEBRA_OK);