xmlChar *id = 0;
assert(xml_node);
+
+ if (strcmp((const char *) xml_node->name, "icu_chain"))
+ {
+ yaz_log(YLOG_WARN, "Wrapper element <%s> deprecated", xml_node->name);
+ yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. only", xml_node->name);
+ xml_node = xml_node->children;
+ while (xml_node && xml_node->type != XML_ELEMENT_NODE)
+ xml_node = xml_node->next;
+ }
+ if (!xml_node)
+ {
+ yaz_log(YLOG_FATAL, "Missing icu_chain element");
+ return -1;
+ }
pct = pp2_charset_create_xml(xml_node);
if (!pct)
return -1;
|| !strcmp((const char *) n->name, "facet"))
{
- yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
- yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
- return 0;
+ if (!service->charsets)
+ service->charsets = pp2_charset_fact_create();
+ if (pp2_charset_fact_define(service->charsets, n,
+ (const char *) n->name))
+ {
+ yaz_log(YLOG_FATAL, "ICU chain definition error");
+ return 0;
+ }
}
else if (!strcmp((const char *) n->name, (const char *) "metadata"))
{
|| !strcmp((const char *) n->name, "mergekey")
|| !strcmp((const char *) n->name, "facet"))
{
- yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name);
- yaz_log(YLOG_LOG, "Use <icu_chain id=\"%s\">.. instead", n->name);
- return 0;
+ if (!server->charsets)
+ server->charsets = pp2_charset_fact_create();
+ if (pp2_charset_fact_define(server->charsets, n,
+ (const char *) n->name))
+ {
+ yaz_log(YLOG_FATAL, "ICU chain definition error");
+ return 0;
+ }
}
else if (!strcmp((const char *) n->name, "service"))
{
<transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
<casemap rule="l"/>
</icu_chain>
-
- <icu_chain id="mergekey" locale="en">
- <tokenize rule="l"/>
- <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
- <casemap rule="l"/>
- </icu_chain>
+
+ <mergekey><!-- the deprecated format -->
+ <icu_chain locale="en">
+ <tokenize rule="l"/>
+ <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
+ <casemap rule="l"/>
+ </icu_chain>
+ </mergekey>
<icu_chain id="facet" locale="en">
<transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>