- struct conf_retrievalmap *m = nmem_malloc(nmem, sizeof(struct conf_retrievalmap));
- xmlChar *type = xmlGetProp(n, "type");
- xmlChar *charset = xmlGetProp(n, "charset");
- xmlChar *format = xmlGetProp(n, "format");
- xmlChar *stylesheet = xmlGetProp(n, "stylesheet");
- memset(m, 0, sizeof(*m));
- if (type)
- {
- if (!strcmp(type, "xslt"))
- m->type = Map_xslt;
- else
- {
- yaz_log(YLOG_WARN, "Unknown map type: %s", type);
- return 0;
- }
- }
- if (charset)
- m->charset = nmem_strdup(nmem, charset);
- if (format)
- m->format = nmem_strdup(nmem, format);
- if (stylesheet)
- {
- if (!(m->stylesheet = load_stylesheet(stylesheet)))
- return 0;
- }
- *rm = m;
- rm = &m->next;
- xmlFree(type);
- xmlFree(charset);
- xmlFree(format);
- xmlFree(stylesheet);