From 1722bbb1db5ba2b1cf096388cf3206863ae0a203 Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Wed, 24 May 2006 12:56:56 +0000 Subject: [PATCH] corrected logical error in finding indexation stylesheet --- recctrl/alvis.c | 20 +++++++++++++------- recctrl/xslt.c | 12 ++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/recctrl/alvis.c b/recctrl/alvis.c index 7e9aa76..01db970 100644 --- a/recctrl/alvis.c +++ b/recctrl/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.13 2006-05-24 08:23:01 marc Exp $ +/* $Id: alvis.c,v 1.14 2006-05-24 12:56:56 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -208,6 +208,11 @@ static ZEBRA_RES create_schemas(struct filter_info *tinfo, const char *fname) attr_content(attr, "default", &schema->default_schema); attr_content(attr, "snippet", &schema->include_snippet); } + /*yaz_log(YLOG_LOG, "XSLT add %s %s %s", + schema->name, schema->identifier, schema->stylesheet); */ + + /* find requested schema */ + if (schema->stylesheet) schema->stylesheet_xsp = xsltParseStylesheetFile( @@ -237,19 +242,20 @@ static struct filter_schema *lookup_schema(struct filter_info *tinfo, const char *est) { struct filter_schema *schema; + for (schema = tinfo->schemas; schema; schema = schema->next) - { + { /* find requested schema */ if (est) - { + { if (schema->identifier && !strcmp(schema->identifier, est)) - return schema; + return schema; + if (schema->name && !strcmp(schema->name, est)) return schema; - } - + } /* or return default schema if defined */ - if (schema->default_schema) + else if (schema->default_schema) return schema; } diff --git a/recctrl/xslt.c b/recctrl/xslt.c index bdea2e7..6544b37 100644 --- a/recctrl/xslt.c +++ b/recctrl/xslt.c @@ -1,4 +1,4 @@ -/* $Id: xslt.c,v 1.23 2006-05-24 08:23:01 marc Exp $ +/* $Id: xslt.c,v 1.24 2006-05-24 12:56:56 marc Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -275,15 +275,15 @@ static struct filter_xslt_schema *lookup_schema(struct filter_xslt_info *tinfo, { /* find requested schema */ if (est) - { + { if (schema->identifier && !strcmp(schema->identifier, est)) - return schema; + return schema; + if (schema->name && !strcmp(schema->name, est)) return schema; - } - + } /* or return default schema if defined */ - if (schema->default_schema) + else if (schema->default_schema) return schema; } -- 1.7.10.4