3 INSERT INTO config.upgrade_log (version) VALUES ('0299'); -- Galen Charlton
5 insert INTO CONFIG.xml_transform(name, namespace_uri, prefix, xslt)
6 VALUES ('marc21expand880', 'http://www.loc.gov/MARC21/slim', 'marc', $$<?xml version="1.0" encoding="UTF-8"?>
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:marc="http://www.loc.gov/MARC21/slim"
12 Copyright (C) 2010 Equinox Software, Inc.
13 Galen Charlton <gmc@esilibrary.cOM.
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version 2
18 of the License, or (at your option) any later version.
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 marc21_expand_880.xsl - stylesheet used during indexing to
26 map alternative graphical representations
27 of MARC fields stored in 880 fields
28 to the corresponding tag name and value.
30 For example, if a MARC record for a Chinese book has
32 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan
33 880.00 $6 245-01/$1 $a八十三年短篇小說選
35 this stylesheet will transform it to the equivalent of
37 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan
38 245.00 $6 245-01/$1 $a八十三年短篇小說選
41 <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
43 <xsl:template match="@*|node()">
45 <xsl:apply-templates select="@*|node()"/>
49 <xsl:template match="//marc:datafield[@tag='880']">
50 <xsl:if test="./marc:subfield[@code='6'] and string-length(./marc:subfield[@code='6']) >= 6">
52 <xsl:attribute name="tag">
53 <xsl:value-of select="substring(./marc:subfield[@code='6'], 1, 3)" />
55 <xsl:attribute name="ind1">
56 <xsl:value-of select="@ind1" />
58 <xsl:attribute name="ind2">
59 <xsl:value-of select="@ind2" />
61 <xsl:apply-templates />