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.
<retrieve name="myelementset">
<xslt stylesheet="my-usual.xsl"/>
- <meta/>
+ <process-meta/>
</retrieve>
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.
*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));
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)
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:copy-of select="*"/>
- <z:meta element_set_name="snippet"/>
+ <z:meta name="snippet"/>
</srw_dc:dc>
</xsl:template>
</retrieve>
<retrieve name="snippet">
<xslt stylesheet="dom-snippet.xsl"/>
- <meta/>
+ <process-meta/>
</retrieve>
<input syntax="xml">
<xmlreader level="1"/>
<xsl:template match="/">
<root>
- <z:meta element_set_name="snippet"/>
+ <z:meta name="snippet"/>
<xsl:apply-templates/>
</root>
</xsl:template>
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\" element_set_name=\"snippet\">"
+ " <z:meta xmlns:z=\"http://indexdata.com/zebra-2.0\" name=\"snippet\">"
"<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"
<retrieve name="dcsnippets">
<xslt stylesheet="dcaddmeta.xsl"/>
- <meta/>
+ <process-meta/>
</retrieve>
<retrieve name="index">