From 0864c203e6cb754b126e559e22d80bf3087fcc48 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 29 Nov 2012 09:41:40 +0100 Subject: [PATCH] Warn if unknown attribute is met in syntax config --- src/yaz-proxy-config.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 4f19e06..5bd08e3 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -794,37 +794,42 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, 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; - if (!strcmp((const char *) attr->name, "backendelementset") && + 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 ", + (const char *) attr->name); + } } if (match_type) { -- 1.7.10.4