]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/954.data.marc21expand880.sql
syntax: end-quote for stored procedure
[working/Evergreen.git] / Open-ILS / src / sql / Pg / 954.data.marc21expand880.sql
1 UPDATE config.xml_transform SET xslt = $$<?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4     xmlns:marc="http://www.loc.gov/MARC21/slim"
5     version="1.0">
6 <!--
7 Copyright (C) 2010  Equinox Software, Inc.
8 Galen Charlton <gmc@esilibrary.cOM.
9
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 marc21_expand_880.xsl - stylesheet used during indexing to
21                         map alternative graphical representations
22                         of MARC fields stored in 880 fields
23                         to the corresponding tag name and value.
24
25 For example, if a MARC record for a Chinese book has
26
27 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan
28 880.00 $6 245-01/$1 $a八十三年短篇小說選
29
30 this stylesheet will transform it to the equivalent of
31
32 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan
33 245.00 $6 245-01/$1 $a八十三年短篇小說選
34
35 -->
36     <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
37
38     <xsl:template match="@*|node()">
39         <xsl:copy>
40             <xsl:apply-templates select="@*|node()"/>
41         </xsl:copy>
42     </xsl:template>
43
44     <xsl:template match="//marc:datafield[@tag='880']">
45         <xsl:if test="./marc:subfield[@code='6'] and string-length(./marc:subfield[@code='6']) &gt;= 6">
46             <marc:datafield>
47                 <xsl:attribute name="tag">
48                     <xsl:value-of select="substring(./marc:subfield[@code='6'], 1, 3)" />
49                 </xsl:attribute>
50                 <xsl:attribute name="ind1">
51                     <xsl:value-of select="@ind1" />
52                 </xsl:attribute>
53                 <xsl:attribute name="ind2">
54                     <xsl:value-of select="@ind2" />
55                 </xsl:attribute>
56                 <xsl:apply-templates />
57             </marc:datafield>
58         </xsl:if>
59     </xsl:template>
60     
61 </xsl:stylesheet>$$
62 where name = 'marc21expand880';