From: Adam Dickmeiss Date: Wed, 9 Jul 2008 09:39:52 +0000 (+0200) Subject: Changed naming convention for embedded records for DOM filter. X-Git-Tag: v2.0.34~46 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=26325895a68fa527a1cd26ea2ccbe80b51db44bd;p=idzebra-moved-to-github.git Changed naming convention for embedded records for DOM filter. The retrieve section uses process-meta rather than meta and the attribute for meta is called name rather than element_set_name. --- diff --git a/NEWS b/NEWS index fa04a36..8718e24 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,13 @@ Added a facility to embed metadata for records generated by the DOM XML -filter. The meta data step is triggered by a 'meta' section in the +filter. The meta data step is triggered by a 'process-meta' section in the retrieve section of the dom config, e.g. - + The meta section substitutes metadata for all elements called 'meta' in namespace http://indexdata.com/zebra-2.0 . The meta element must have -exactly one attribute, element_set_name, which specifies the special +exactly one attribute, name, which specifies the special element set name which is equivalent to the suffix to zebra:: for non-embedded special retrievals. This allows snippets, facets etc to be included. diff --git a/index/mod_dom.c b/index/mod_dom.c index 4393ded..95c8a06 100644 --- a/index/mod_dom.c +++ b/index/mod_dom.c @@ -338,7 +338,7 @@ static ZEBRA_RES parse_convert(struct filter_info *tinfo, xmlNodePtr ptr, *l = p; l = &p->next; } - else if (!XML_STRCMP(ptr->name, "meta")) + else if (!XML_STRCMP(ptr->name, "process-meta")) { struct _xmlAttr *attr; struct convert_s *p = nmem_malloc(tinfo->nmem_config, sizeof(*p)); @@ -376,13 +376,12 @@ static int process_meta(struct filter_info *tinfo, xmlDocPtr doc, xmlNodePtr nod struct _xmlAttr *attr; for (attr = node->properties; attr; attr = attr->next) { - if (attr_content(attr, "element_set_name", &element_set_name)) + if (attr_content(attr, "name", &element_set_name)) ; else { dom_log(YLOG_WARN, tinfo, node, - "bad attribute @%s, expected @element_set_name", - attr->name); + "bad attribute @%s, expected @name", attr->name); } } if (element_set_name) diff --git a/test/xslt/dcaddmeta.xsl b/test/xslt/dcaddmeta.xsl index c41a2f6..4edd20a 100644 --- a/test/xslt/dcaddmeta.xsl +++ b/test/xslt/dcaddmeta.xsl @@ -10,7 +10,7 @@ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + diff --git a/test/xslt/dom-config-col.xml b/test/xslt/dom-config-col.xml index 7b66def..d19cefe 100644 --- a/test/xslt/dom-config-col.xml +++ b/test/xslt/dom-config-col.xml @@ -10,7 +10,7 @@ - + diff --git a/test/xslt/dom-snippet.xsl b/test/xslt/dom-snippet.xsl index 6178eed..a817fbf 100644 --- a/test/xslt/dom-snippet.xsl +++ b/test/xslt/dom-snippet.xsl @@ -9,7 +9,7 @@ - + diff --git a/test/xslt/dom1.c b/test/xslt/dom1.c index d68ec7a..10c4834 100644 --- a/test/xslt/dom1.c +++ b/test/xslt/dom1.c @@ -80,7 +80,7 @@ void tst(int argc, char **argv) zh, "snippet", yaz_oid_recsyn_xml, "\n" "\n" - " " + " " "\n" " How to program a computer\n" "\n" diff --git a/test/xslt/gutenberg.xml b/test/xslt/gutenberg.xml index b2a8b4f..65736f5 100644 --- a/test/xslt/gutenberg.xml +++ b/test/xslt/gutenberg.xml @@ -12,7 +12,7 @@ - +