Updated to new identifiers (again). Make SRW DC stylesheet.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 23 Feb 2004 12:55:02 +0000 (12:55 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 23 Feb 2004 12:55:02 +0000 (12:55 +0000)
etc/MARC21slim2SRWDC.xsl [new file with mode: 0644]
etc/Makefile.am
etc/config.xml
etc/voyager.xml

diff --git a/etc/MARC21slim2SRWDC.xsl b/etc/MARC21slim2SRWDC.xsl
new file mode 100644 (file)
index 0000000..093068c
--- /dev/null
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" 
+       xmlns:marc="http://www.loc.gov/MARC21/slim" 
+       xmlns:srw_dc="info:srw/schema/1/dc-schema" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xmlns="http://purl.org/dc/elements/1.1/" 
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+       exclude-result-prefixes="dc">
+       <xsl:import href="MARC21slimUtils.xsl"/>
+       <xsl:output method="xml" indent="yes"/>
+<!-- modification log 
+       NT 01/04:  added collection level element
+       and removed attributes
+
+-->    
+       <xsl:template match="/">
+                <srw_dc:dc xsi:schemaLocation="http://www.loc.gov/z3950/agency/zing/srw/dc-schema.xsd">
+                       <xsl:apply-templates select="marc:record"/>
+                </srw_dc:dc>                                   
+       </xsl:template>
+
+       <xsl:template match="marc:record">
+               <xsl:variable name="leader" select="marc:leader"/>
+               <xsl:variable name="leader6" select="substring($leader,7,1)"/>
+               <xsl:variable name="leader7" select="substring($leader,8,1)"/>
+               <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
+
+                       <xsl:for-each select="marc:datafield[@tag=245]">
+                               <title>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abfghk</xsl:with-param>
+                                       </xsl:call-template>
+                               </title>
+                       </xsl:for-each>
+       
+                       <xsl:for-each select="marc:datafield[@tag=100]|marc:datafield[@tag=110]|marc:datafield[@tag=111]|marc:datafield[@tag=700]|marc:datafield[@tag=710]|marc:datafield[@tag=711]|marc:datafield[@tag=720]">
+                               <creator>
+                                       <xsl:value-of select="normalize-space(.)"/>
+                               </creator>
+                       </xsl:for-each>
+
+                       <type>          
+                               <xsl:if test="$leader7='c'">
+                                       <!-- nt fix 1/04 -->
+                                       <!--<xsl:attribute name="collection">yes</xsl:attribute>-->
+                                       <xsl:text>collection</xsl:text>
+                               </xsl:if>
+
+                               <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
+                                       <!-- nt fix 1/04 -->
+                                       <!--<xsl:attribute name="manuscript">yes</xsl:attribute> -->
+                                       <xsl:text>manuscript</xsl:text>
+                               </xsl:if>
+
+                               <xsl:choose>
+                                       <xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
+                                       <xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
+                                       <xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
+                                       <xsl:when test="$leader6='i' or $leader6='j'">sound recording</xsl:when>
+                                       <xsl:when test="$leader6='k'">still image</xsl:when>
+                                       <xsl:when test="$leader6='g'">moving image</xsl:when>
+                                       <xsl:when test="$leader6='r'">three dimensional object</xsl:when>
+                                       <xsl:when test="$leader6='m'">software, multimedia</xsl:when>
+                                       <xsl:when test="$leader6='p'">mixed material</xsl:when>
+                               </xsl:choose>
+                       </type>
+
+                       <xsl:for-each select="marc:datafield[@tag=655]">
+                               <type>
+                                       <xsl:value-of select="normalize-space(.)"/>
+                               </type>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=260]">
+                               <publisher>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">ab</xsl:with-param>
+                                       </xsl:call-template>
+                               </publisher>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='c']">
+                               <date>
+                                       <xsl:value-of select="."/>
+                               </date>                         
+                       </xsl:for-each>
+
+                       <language>
+                               <xsl:value-of select="substring($controlField008,36,3)"/>
+                       </language>
+
+                       <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q']">
+                               <format>
+                                       <xsl:value-of select="."/>
+                               </format>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=520]">
+                               <description>
+                                       <!-- nt fix 01/04 -->
+                                       <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
+                               </description>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=521]">
+                               <description>
+                                       <xsl:value-of select="marc:subfield[@code='a']"/>
+                               </description>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[500&lt;@tag][@tag&lt;=599][not(@tag=506 or @tag=530 or @tag=540 or @tag=546)]">
+                               <description>
+                                       <xsl:value-of select="marc:subfield[@code='a']"/>
+                               </description>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=600]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=610]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=611]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+               
+                       <xsl:for-each select="marc:datafield[@tag=630]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=650]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=653]">
+                               <subject>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdq</xsl:with-param>
+                                       </xsl:call-template>
+                               </subject>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=752]">
+                               <coverage>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcd</xsl:with-param>
+                                       </xsl:call-template>
+                               </coverage>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=530]">
+                       <!-- nt 01/04 attribute fix -->
+                               <relation>
+                                       <!--<xsl:attribute name="type">original</xsl:attribute>-->
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">abcdu</xsl:with-param>
+                                       </xsl:call-template>
+                               </relation>     
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]|marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=770]|marc:datafield[@tag=772]|marc:datafield[@tag=773]|marc:datafield[@tag=774]|marc:datafield[@tag=775]|marc:datafield[@tag=776]|marc:datafield[@tag=777]|marc:datafield[@tag=780]|marc:datafield[@tag=785]|marc:datafield[@tag=786]|marc:datafield[@tag=787]">
+                               <relation>
+                                       <xsl:call-template name="subfieldSelect">
+                                               <xsl:with-param name="codes">ot</xsl:with-param>
+                                       </xsl:call-template>
+                               </relation>     
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=856]">
+                               <identifier>
+                                       <xsl:value-of select="marc:subfield[@code='u']"/>
+                               </identifier>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=506]">
+                               <rights>
+                                       <xsl:value-of select="marc:subfield[@code='a']"/>
+                               </rights>
+                       </xsl:for-each>
+
+                       <xsl:for-each select="marc:datafield[@tag=540]">
+                               <rights>
+                                       <xsl:value-of select="marc:subfield[@code='a']"/>
+                               </rights>
+                       </xsl:for-each>         
+       </xsl:template>
+</xsl:stylesheet>
index 02ee939..e2b7c58 100644 (file)
@@ -1,6 +1,7 @@
 
 EXTRA_DIST = config.xml voyager.xml yaz-proxy.sh pqf.properties \
  MARC21slim2DC.xsl \
+ MARC21slim2SRWDC.xsl \
  MARC21slim2MODS.xsl \
  MARC21slim2MODS3.xsl \
  MARC21slim2RDFDC.xsl \
index 99afbe6..8a736ee 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.10 2004-02-12 20:35:06 adam Exp $ -->
+<!-- $Id: config.xml,v 1.11 2004-02-23 12:55:02 adam Exp $ -->
 <proxy>
   <target name="bagel">
     <url>indexdata.dk</url>
     <attribute type="1" value="*" error="114"/>
     <syntax type="usmarc"/>
     <syntax type="grs1"/>
-    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2DC.xsl"
-      identifier="http://www.loc.gov/zing/srw/dcschema/v1.0/"
+    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2SRWDC.xsl"
+      identifier="info:srw/schema/1/dc-v1.1"
        >
       <name>dc</name>
     </syntax>
     <syntax type="xml" marcxml="1"
-      identifier="http://www.loc.gov/marcxml/"
+      identifier="info:srw/schema/1/marcxml-v1.1"
       >
       <name>marcxml</name>
     </syntax>
@@ -54,8 +54,8 @@
       >
       <name>mods</name>
     </syntax>
-    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2MODS.xsl"
-      identifier="http://www.loc.gov/mods/v3"
+    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2MODS3.xsl"
+      identifier="info:srw/schema/1/mods-v3.0"
       >
       <name>mods3</name>
     </syntax>
index 648834c..5676269 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id: voyager.xml,v 1.11 2004-02-12 20:35:07 adam Exp $ -->
+<!-- $Id: voyager.xml,v 1.12 2004-02-23 12:55:02 adam Exp $ -->
 <proxy>
   <!-- define default target and name it voyager -->
   <target default="1" name="voyager">
     <syntax type="none"/>
     
     <syntax type="xml" marcxml="1"
-      identifier="http://www.loc.gov/marcxml/"
+      identifier="info:srw/schema/1/marcxml-v1.1"
       >
       <title>MARCXML</title>
       <name>marcxml</name>
     </syntax>
-    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2DC.xsl"
-      identifier="http://www.loc.gov/zing/srw/dcschema/v1.0/"
+    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2SRWDC.xsl"
+      identifier="info:srw/schema/1/dc-v1.1"
       >
       <title>Dublin Core</title>
       <name>dc</name>
@@ -79,7 +79,7 @@
       <name>mods</name>
     </syntax>
     <syntax type="xml" marcxml="1" stylesheet="MARC21slim2MODS3.xsl"
-      identifier="http://www.loc.gov/mods/v3"
+      identifier="info:srw/schema/1/mods-v3.0"
       >
       <title>MODS v3</title>
       <name>mods3</name>
       </indexInfo>
 
       <schemaInfo>
-       <schema identifier="http://www.loc.gov/marcxml/"
+       <schema identifier="info:srw/schema/1/marcxml-v1.1"
          sort="false" name="marcxml">
          <title>MARCXML</title>
        </schema>
        
-       <schema identifier="http://www.loc.gov/zing/srw/dcschema/v1.0"
+       <schema identifier="info:srw/schema/1/dc-v1.1"
          sort="false" name="dc">
          <title>Dublin Core</title>
        </schema>
        
-       <schema identifier="http://www.loc.gov/mods/v3"
+       <schema identifier="info:srw/schema/1/mods-v3.0"
          sort="false" name="mods">
          <title>MODS</title>
        </schema>