{
xmlChar *text = xmlNodeGetContent(node);
size_t text_len = strlen((const char *)text);
-
+
/* if there is no text, we do not need to proceed */
if (text_len)
{
+ /* keep seqno base so that all text will have
+ identical seqno's for multiple fields , e.g
+ <z:index name="title:w any:w title:p">.. */
+
+ zint seqno_base = recword->seqno;
+ zint seqno_max = recword->seqno;
+
+
const char *look = index_p;
const char *bval;
const char *eval;
/* actually indexing the text given */
+ recword->seqno = seqno_base;
recword->index_name = (const char *)index;
if (*type)
recword->index_type = (const char *) type;
(extctr->tokenAdd)(recword);
+ if (seqno_max < recword->seqno)
+ seqno_max = recword->seqno;
+
/* eat whitespaces */
if (*look && ' ' == *look)
{
look++;
}
}
+ recword->seqno = seqno_max;
}
xmlFree(text);
}
<xsl:template match="/*">
<z:record>
- <z:index name="any:w">
<xsl:apply-templates/>
- </z:index>
<xsl:call-template name="special-indexes"/>
</xsl:template>
<xsl:template match="/*/*[namespace-uri() = 'http://purl.org/dc/elements/1.1/']">
- <z:index name="{local-name()}:w">
+ <z:index name="any:w {local-name()}:w">
<xsl:value-of select="."/>
</z:index>
</xsl:template>
YAZ_CHECK(tl_query(zh, "@attr 1=title b", 1));
zh = index_some(zs, "dom.gutenberg.xml", "gutenberg-sample.xml");
- YAZ_CHECK(tl_query(zh, "selected", 1));
+ YAZ_CHECK(tl_query(zh, "oscar", 1));
YAZ_CHECK_EQ(tl_fetch_first_compare(
zh, "zebra::snippet", yaz_oid_recsyn_xml,
"<record xmlns=\"http://www.indexdata.com/zebra/\">\n"
- " <snippet name=\"any\" type=\"w\">etext/1338\n"
- " Project Gutenberg\n"
- " <s>Selected</s> Prose of Oscar Wilde</snippet>\n"
+ " <snippet name=\"any\" type=\"w\">"
+ "Selected Prose of <s>Oscar</s> Wilde"
+ "</snippet>\n"
+ " <snippet name=\"any\" type=\"w\">"
+ "Wilde, <s>Oscar</s>, 1854-1900"
+ "</snippet>\n"
"</record>"),
ZEBRA_OK);