/* This file is part of YAZ proxy
- Copyright (C) 1998-2009 Index Data
+ Copyright (C) 1998-2011 Index Data
YAZ proxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
if (t)
*limit_pdu = atoi(t);
}
- if (ptr->type == XML_ELEMENT_NODE
+ if (ptr->type == XML_ELEMENT_NODE
&& !strcmp((const char *) ptr->name, "search"))
{
const char *t = get_text(ptr);
return_limit(ptr, keepalive_limit_bw, keepalive_limit_pdu,
&dummy, &dummy);
}
- if (ptr->type == XML_ELEMENT_NODE
+ if (ptr->type == XML_ELEMENT_NODE
&& !strcmp((const char *) ptr->name, "limit"))
return_limit(ptr, limit_bw, limit_pdu, limit_req,
limit_search);
- if (ptr->type == XML_ELEMENT_NODE
+ if (ptr->type == XML_ELEMENT_NODE
&& !strcmp((const char *) ptr->name, "target-timeout"))
{
const char *t = get_text(ptr);
if (!el->attributeType)
continue;
int type = *el->attributeType;
- int *value = 0;
+ Odr_int *value = 0;
if (el->which == Z_AttributeValue_numeric && el->value.numeric)
value = el->value.numeric;
{
if (!match_list(*value, match_value))
continue;
- sprintf (addinfo_str, "%d", *value);
+ sprintf (addinfo_str, ODR_INT_PRINTF, *value);
}
else
continue;
char **backend_type,
char **backend_charset,
char **usemarcon_ini_stage1,
- char **usemarcon_ini_stage2
+ char **usemarcon_ini_stage2,
+ char **backend_elementset
)
{
if (stylesheet)
xfree (*usemarcon_ini_stage2);
*usemarcon_ini_stage2 = 0;
}
+ xfree(*backend_elementset);
+ *backend_elementset = 0;
#if YAZ_HAVE_XSLT
int syntax_has_matched = 0;
xmlNodePtr ptr;
const char *match_backend_charset = 0;
const char *match_usemarcon_ini_stage1 = 0;
const char *match_usemarcon_ini_stage2 = 0;
+ const char *match_elementset = 0;
struct _xmlAttr *attr;
for (attr = ptr->properties; attr; attr = attr->next)
{
if (!strcmp((const char *) attr->name, "type") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_type = (const char *) attr->children->content;
- if (!strcmp((const char *) attr->name, "error") &&
+ else if (!strcmp((const char *) attr->name, "error") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_error = (const char *) attr->children->content;
- if (!strcmp((const char *) attr->name, "marcxml") &&
+ else if (!strcmp((const char *) attr->name, "marcxml") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_marcxml = (const char *) attr->children->content;
- if (!strcmp((const char *) attr->name, "stylesheet") &&
+ else if (!strcmp((const char *) attr->name, "stylesheet") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_stylesheet = (const char *) attr->children->content;
- if (!strcmp((const char *) attr->name, "identifier") &&
+ else if (!strcmp((const char *) attr->name, "identifier") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_identifier = (const char *) attr->children->content;
- if (!strcmp((const char *) attr->name, "backendtype") &&
+ else if (!strcmp((const char *) attr->name, "backendtype") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_backend_type = (const char *)
attr->children->content;
- if (!strcmp((const char *) attr->name, "backendcharset") &&
+ else if (!strcmp((const char *) attr->name, "backendcharset") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_backend_charset = (const char *)
attr->children->content;
- if (!strcmp((const char *) attr->name, "usemarconstage1") &&
+ else if (!strcmp((const char *) attr->name, "usemarconstage1") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_usemarcon_ini_stage1 = (const char *)
attr->children->content;
- if (!strcmp((const char *) attr->name, "usemarconstage2") &&
+ else if (!strcmp((const char *) attr->name, "usemarconstage2") &&
attr->children && attr->children->type == XML_TEXT_NODE)
match_usemarcon_ini_stage2 = (const char *)
attr->children->content;
+ else if (!strcmp((const char *) attr->name, "backendelementset") &&
+ attr->children && attr->children->type == XML_TEXT_NODE)
+ match_elementset = (const char *) attr->children->content;
+ else
+ {
+ yaz_log(YLOG_WARN, "0 Unknown attribute %s in <syntax>",
+ (const char *) attr->name);
+ }
}
if (match_type)
{
}
else if (syntax)
{
- Odr_oid *match_oid
+ Odr_oid *match_oid
= yaz_string_to_oid_odr(yaz_oid_std(),
CLASS_RECSYN, match_type,
odr);
xfree(*backend_charset);
*backend_charset = xstrdup(match_backend_charset);
}
+ if (match_elementset)
+ {
+ xfree(*backend_elementset);
+ *backend_elementset = xstrdup(match_elementset);
+ }
if (usemarcon_ini_stage1 && match_usemarcon_ini_stage1)
{
xfree(*usemarcon_ini_stage1);
else
{
xmlNodePtr ptr2 = xmlCopyNode(ptr_explain, 1);
-
+
xmlDocPtr doc = xmlNewDoc((const xmlChar *) "1.0");
-
+
xmlDocSetRootElement(doc, ptr2);
-
+
xmlChar *buf_out;
xmlDocDumpMemory(doc, &buf_out, len);
char *content = (char*) odr_malloc(odr, *len);