X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fxslt.c;fp=recctrl%2Fxslt.c;h=ab7a18e3ce2ab28909ba294bdb0573e16df71f88;hb=9eebf93dc2525854867cbc43920ea8ba4a199ab5;hp=d2cf67a4d3c5469689789ae573fef752d40541fd;hpb=3f385c9ee5fea1f18f200a598747c9b385eee9d8;p=idzebra-moved-to-github.git diff --git a/recctrl/xslt.c b/recctrl/xslt.c index d2cf67a..ab7a18e 100644 --- a/recctrl/xslt.c +++ b/recctrl/xslt.c @@ -1,4 +1,4 @@ -/* $Id: xslt.c,v 1.10 2005-06-15 15:30:05 adam Exp $ +/* $Id: xslt.c,v 1.11 2005-06-23 06:45:47 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -314,6 +314,7 @@ static void index_node(struct filter_info *tinfo, struct recExtractCtrl *ctrl, if (!strcmp(ptr->name, "index")) { char *name_str = 0; + const char *type_str = 0; const char *xpath_str = 0; struct _xmlAttr *attr; for (attr = ptr->properties; attr; attr = attr->next) @@ -324,11 +325,20 @@ static void index_node(struct filter_info *tinfo, struct recExtractCtrl *ctrl, if (!strcmp(attr->name, "xpath") && attr->children && attr->children->type == XML_TEXT_NODE) xpath_str = attr->children->content; + if (!strcmp(attr->name, "type") + && attr->children && attr->children->type == XML_TEXT_NODE) + type_str = attr->children->content; } if (name_str) { - recWord->attrStr = name_str; + int prev_type = recWord->index_type; /* save default type */ + + if (type_str && *type_str) + recWord->index_type = *type_str; /* type was given */ + recWord->index_name = name_str; index_cdata(tinfo, ctrl, ptr->children, recWord); + + recWord->index_type = prev_type; /* restore it again */ } } } @@ -348,7 +358,6 @@ static int extract_doc(struct filter_info *tinfo, struct recExtractCtrl *p, set_param_str(params, "schema", zebra_xslt_ns, tinfo->odr); (*p->init)(p, &recWord); - recWord.reg_type = 'w'; if (schema && schema->stylesheet_xsp) {