<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:z="http://indexdata.dk/zebra/xslt/1"
- xmlns:marc="http://www.loc.gov/MARC21/slim"
+<!--
+ Copyright (C) 1995-2013
+ Index Data ApS
+
+This file is part of the Zebra server.
+
+Zebra 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
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Zebra; see the file LICENSE.zebra. If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:z="http://indexdata.com/zebra-2.0"
+ xmlns:marc="http://www.loc.gov/MARC21/slim"
version="1.0">
- <!-- <xsl:include href="MARC21slimUtils.xsl"/> -->
<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
<!-- disable all default text node output -->
<!-- match on marcxml record -->
- <xsl:template match="marc:record">
+ <xsl:template match="marc:record">
<xsl:variable name="leader" select="marc:leader"/>
+ <xsl:variable name="leader5" select="substring($leader,6,1)"/>
+ <xsl:variable name="type">
+ <xsl:choose>
+ <xsl:when test="$leader5='d'">delete</xsl:when>
+ <xsl:otherwise>update</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
- <xsl:variable name="controlField001"
+ <xsl:variable name="controlField001"
select="normalize-space(marc:controlfield[@tag='001'])"/>
- <xsl:variable name="controlField008"
+ <xsl:variable name="controlField008"
select="normalize-space(marc:controlfield[@tag='008'])"/>
<xsl:variable name="typeOf008">
<xsl:choose>
<xsl:when test="$leader7='a' or $leader7='c' or $leader7='d'
or $leader7='m'">BK</xsl:when>
- <xsl:when test="$leader7='b' or $leader7='i'
+ <xsl:when test="$leader7='b' or $leader7='i'
or $leader7='s'">SE</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="$leader6='p'">MM</xsl:when>
<xsl:when test="$leader6='m'">CF</xsl:when>
<xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
- <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o'
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o'
or $leader6='r'">VM</xsl:when>
- <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i'
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i'
or $leader6='j'">MU</xsl:when>
</xsl:choose>
</xsl:variable>
- <z:record id="{$controlField001}" type="update">
+ <z:record z:id="{$controlField001}" type="{$type}">
+
+
<!-- <xsl:attribute name="id"></xsl:attribute> -->
<!-- <xsl:attribute name="type">update</xsl:attribute> -->
<!-- <xsl:attribute name="rank"></xsl:attribute> -->
+
<xsl:call-template name="bib1_rules"/>
</z:record>
</xsl:template>
<!-- att 54 Code-language -->
<!-- att 55 Code-geographic -->
<!-- att 56 Code-institution -->
- <!-- att 57 Name-and-title -->
+ <!-- att 57 Name-and-title -->
<!-- att 58 Name-geographic -->
<!-- att 59 Place-publication -->
<!-- att 60 CODEN -->
-->
<xsl:template name="Abstract">
<xsl:for-each select="marc:datafield[@tag='520']">
- <z:index name="Abstract" type="w">
+ <z:index name="Abstract:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
</xsl:template>
-
+
<!--
Any 1016 The record is selected if there
exists a Use attribute that the
| marc:datafield[@tag='800']
| marc:datafield[@tag='810']
| marc:datafield[@tag='811']">
- <z:index name="Author" type="w">
+ <z:index name="Author:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='100']">
- <z:index name="Author" type="p">
+ <z:index name="Author:p">
<xsl:value-of select="marc:subfield[@code='a']"/>
<xsl:text> </xsl:text>
<xsl:value-of select="marc:subfield[@code='d']"/>
<xsl:template name="Author-title">
<xsl:if test="marc:datafield[@tag='100']
and marc:datafield[@tag='245']">
- <z:index name="Author-title" type="p">
- <xsl:value-of
+ <z:index name="Author-title:p">
+ <xsl:value-of
select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
<xsl:text> </xsl:text>
- <xsl:value-of
+ <xsl:value-of
select="marc:datafield[@tag='100']/marc:subfield[@code='d']"/>
<xsl:text> </xsl:text>
- <xsl:value-of
+ <xsl:value-of
select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
</z:index>
</xsl:if>
-->
<xsl:template name="Author-name-corporate">
<xsl:for-each select="marc:datafield[@tag='110']">
- <z:index name="Author-name-corporate" type="w">
+ <z:index name="Author-name-corporate:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
-->
<xsl:template name="Author-name-conference">
<xsl:for-each select="marc:datafield[@tag='111']">
- <z:index name="Author-name-conference" type="w">
+ <z:index name="Author-name-conference:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
<xsl:template name="Author-name-personal">
<xsl:for-each select="marc:datafield[@tag='100']">
<xsl:for-each select="marc:subfield[@code='a']">
- <z:index name="Author-name-personal" type="w">
+ <z:index name="Author-name-personal:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='100']">
- <z:index name="Author-name-personal" type="p">
+ <z:index name="Author-name-personal:p">
<xsl:value-of select="marc:subfield[@code='a']"/>
<xsl:text> </xsl:text>
<xsl:value-of select="marc:subfield[@code='d']"/>
-->
<xsl:template name="ISBN">
<xsl:for-each select="marc:datafield[@tag='020']/marc:subfield[@code='a']">
- <z:index name="ISBN" type="n">
+ <z:index name="ISBN:n">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
-->
<xsl:template name="ISSN">
<xsl:for-each select="marc:datafield[@tag='022']">
- <z:index name="ISSN" type="n">
+ <z:index name="ISSN:n">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
|marc:datafield[@tag='655']
|marc:datafield[@tag='656']
|marc:datafield[@tag='657']">
- <z:index name="Subject-heading" type="w">
+ <z:index name="Subject-heading:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
|marc:datafield[@tag='650']
|marc:datafield[@tag='651']
|marc:datafield[@tag='653']">
- <z:index name="Subject-heading" type="w">
+ <z:index name="Subject-heading:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>
-->
<xsl:template name="Title">
<xsl:for-each select="marc:datafield[@tag='245']/marc:subfield[@code='a']">
- <z:index name="Title" type="w">
+ <z:index name="Title:w">
<xsl:value-of select="."/>
</z:index>
</xsl:for-each>