-/* $Id: xslt.c,v 1.9 2005-06-07 13:10:52 adam Exp $
+/* $Id: xslt.c,v 1.10 2005-06-15 15:30:05 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
return 0;
}
-static void index_field(struct filter_info *tinfo, struct recExtractCtrl *ctrl,
+static void index_cdata(struct filter_info *tinfo, struct recExtractCtrl *ctrl,
xmlNodePtr ptr, RecWord *recWord)
{
for(; ptr; ptr = ptr->next)
{
- index_field(tinfo, ctrl, ptr->children, recWord);
+ index_cdata(tinfo, ctrl, ptr->children, recWord);
if (ptr->type != XML_TEXT_NODE)
continue;
recWord->term_buf = ptr->content;
continue;
if (!strcmp(ptr->name, "index"))
{
- char *field_str = 0;
+ char *name_str = 0;
const char *xpath_str = 0;
struct _xmlAttr *attr;
for (attr = ptr->properties; attr; attr = attr->next)
{
- if (!strcmp(attr->name, "field")
+ if (!strcmp(attr->name, "name")
&& attr->children && attr->children->type == XML_TEXT_NODE)
- field_str = attr->children->content;
+ name_str = attr->children->content;
if (!strcmp(attr->name, "xpath")
&& attr->children && attr->children->type == XML_TEXT_NODE)
xpath_str = attr->children->content;
}
- if (field_str)
+ if (name_str)
{
- recWord->attrStr = field_str;
- index_field(tinfo, ctrl, ptr->children, recWord);
+ recWord->attrStr = name_str;
+ index_cdata(tinfo, ctrl, ptr->children, recWord);
}
}
}
xmlns:m="http://www.loc.gov/MARC21/slim"
xmlns:z="http://indexdata.dk/zebra/xslt/1"
version="1.0">
- <!-- $Id: index.xsl,v 1.2 2005-06-07 13:10:52 adam Exp $ -->
+ <!-- $Id: index.xsl,v 1.3 2005-06-15 15:30:05 adam Exp $ -->
<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
<xsl:template match="/m:record/m:controlfield[@tag=001]">
- <z:index field="control">
+ <z:index name="control">
<xsl:apply-templates match="."/>
</z:index>
</xsl:template>
<xsl:template match="/m:record/m:datafield[@tag=245]">
- <z:index field="title">
+ <z:index name="title">
<xsl:apply-templates match="."/>
</z:index>
</xsl:template>