diff options
author | Slávek Banko <[email protected]> | 2013-06-24 02:08:15 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-07-04 02:44:37 +0200 |
commit | 998f21e02a725cd553d7c278819f67cd81295af4 (patch) | |
tree | 4bd158018e9302c31367b00c01cd2b41eb228414 /xslt | |
download | kbibtex-998f21e02a725cd553d7c278819f67cd81295af4.tar.gz kbibtex-998f21e02a725cd553d7c278819f67cd81295af4.zip |
Initial import
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/MARC21slim2MODS3.xsl | 2795 | ||||
-rw-r--r-- | xslt/MARC21slimUtils.xsl | 82 | ||||
-rw-r--r-- | xslt/Makefile.am | 2 | ||||
-rw-r--r-- | xslt/Makefile.in | 589 | ||||
-rw-r--r-- | xslt/UNIMARC2MODS3.xsl | 2920 | ||||
-rw-r--r-- | xslt/html.xsl | 144 |
6 files changed, 6532 insertions, 0 deletions
diff --git a/xslt/MARC21slim2MODS3.xsl b/xslt/MARC21slim2MODS3.xsl new file mode 100644 index 0000000..fe78601 --- /dev/null +++ b/xslt/MARC21slim2MODS3.xsl @@ -0,0 +1,2795 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink marc"> + <xsl:include href="MARC21slimUtils.xsl"/> + <xsl:output method="xml" indent="yes" encoding="UTF-8"/> + + <!-- +Revision 1.11 datafield 028 fixed attribute placement 2006/12/07 ntra +Revision 1.10 subfield $h in 245 suppressed from mods:title 2006/03/23 ntra + +Revision 1.9 subfield $y was added to field 242 2004/09/02 10:57 jrad + +Revision 1.8 Subject chopPunctuation expanded and attribute fixes 2004/08/12 jrad + +Revision 1.7 2004/03/25 08:29 jrad + +Revision 1.6 various validation fixes 2004/02/20 ntra + +Revision 1.5 2003/10/02 16:18:58 ntra +MODS2 to MODS3 updates, language unstacking and +de-duping, chopPunctuation expanded + +Revision 1.3 2003/04/03 00:07:19 ntra +Revision 1.3 Additional Changes not related to MODS Version 2.0 by ntra + +Revision 1.2 2003/03/24 19:37:42 ckeith +Added Log Comment + +--> + <xsl:template match="/"> + <xsl:choose> + <xsl:when test="marc:collection"> + <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"> + <xsl:for-each select="marc:collection/marc:record"> + <mods version="3.0"> + <xsl:call-template name="marcRecord"/> + </mods> + </xsl:for-each> + </modsCollection> + </xsl:when> + <xsl:otherwise> + <mods version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"> + <xsl:for-each select="marc:record"> + <xsl:call-template name="marcRecord"/> + </xsl:for-each> + </mods> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="marcRecord"> + <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:variable name="typeOf008"> + <xsl:choose> + <xsl:when test="$leader6='a'"> + <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' or $leader7='s'">SE</xsl:when> + </xsl:choose> + </xsl:when> + <xsl:when test="$leader6='t'">BK</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' or $leader6='r'">VM</xsl:when> + <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when> + </xsl:choose> + </xsl:variable> + + <xsl:for-each select="marc:datafield[@tag=245]"> + <titleInfo> + <xsl:variable name="title"> + <xsl:choose> + <xsl:when test="marc:subfield[@code='b']"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">b</xsl:with-param> + <xsl:with-param name="beforeCodes">afgk</xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abfgk</xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="titleChop"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="$title"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="@ind2>0"> + <nonSort> + <xsl:value-of select="substring($titleChop,1,@ind2)"/> + </nonSort> + <title> + <xsl:value-of select="substring($titleChop,@ind2+1)"/> + </title> + </xsl:when> + <xsl:otherwise> + <title> + <xsl:value-of select="$titleChop"/> + </title> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="marc:subfield[@code='b']"> + <subTitle> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">b</xsl:with-param> + <xsl:with-param name="anyCodes">b</xsl:with-param> + <xsl:with-param name="afterCodes">afgk</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </subTitle> + </xsl:if> + <xsl:call-template name="part"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=210]"> + <titleInfo type="abbreviated"> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">a</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="subtitle"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=242]"> + <titleInfo type="translated"> + <!--09/01/04 Added subfield $y--> + <xsl:for-each select="marc:subfield[@code='y']"> + <xsl:attribute name="lang"> + <xsl:value-of select="text()"/> + </xsl:attribute> + </xsl:for-each> + <title> + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <!-- 1/04 removed $h, b --> + <xsl:with-param name="codes">a</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + + + <!-- 1/04 fix --> + <xsl:call-template name="subtitle"/> + <xsl:call-template name="part"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=246]"> + <titleInfo type="alternative"> + <xsl:for-each select="marc:subfield[@code='i']"> + <xsl:attribute name="displayLabel"> + <xsl:value-of select="text()"/> + </xsl:attribute> + </xsl:for-each> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <!-- 1/04 removed $h, $b --> + <xsl:with-param name="codes">af</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="subtitle"/> + <xsl:call-template name="part"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> + <titleInfo type="uniform"> + <title> + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))"> + <xsl:value-of select="text()"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=740][@ind2!=2]"> + <titleInfo type="alternative"> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ah</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=100]"> + <name type="personal"> + <xsl:call-template name="nameABCDQ"/> + <xsl:call-template name="affiliation"/> + <role> + <roleTerm authority="marcrelator" type="text">creator</roleTerm> + </role> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=110]"> + <name type="corporate"> + <xsl:call-template name="nameABCDN"/> + <role> + <roleTerm authority="marcrelator" type="text">creator</roleTerm> + </role> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=111]"> + <name type="conference"> + <xsl:call-template name="nameACDEQ"/> + <role> + <roleTerm authority="marcrelator" type="text">creator</roleTerm> + </role> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=700][not(marc:subfield[@code='t'])]"> + <name type="personal"> + <xsl:call-template name="nameABCDQ"/> + <xsl:call-template name="affiliation"/> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=710][not(marc:subfield[@code='t'])]"> + <name type="corporate"> + <xsl:call-template name="nameABCDN"/> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=711][not(marc:subfield[@code='t'])]"> + <name type="conference"> + <xsl:call-template name="nameACDEQ"/> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=720][not(marc:subfield[@code='t'])]"> + <name> + <xsl:if test="@ind1=1"> + <xsl:attribute name="type"> + <xsl:text>personal</xsl:text> + </xsl:attribute> + </xsl:if> + <namePart> + <xsl:value-of select="marc:subfield[@code='a']"/> + </namePart> + <xsl:call-template name="role"/> + </name> + </xsl:for-each> + + <typeOfResource> + <xsl:if test="$leader7='c'"> + <xsl:attribute name="collection">yes</xsl:attribute> + </xsl:if> + <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'"> + <xsl:attribute name="manuscript">yes</xsl:attribute> + </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'">sound recording-nonmusical</xsl:when> + <xsl:when test="$leader6='j'">sound recording-musical</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> + </typeOfResource> + + <xsl:if test="substring($controlField008,26,1)='d'"> + <genre authority="marc">globe</genre> + </xsl:if> + + <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']"> + <genre authority="marc">remote sensing image</genre> + </xsl:if> + + <xsl:if test="$typeOf008='MP'"> + <xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']"> + <genre authority="marc">map</genre> + </xsl:when> + <xsl:when test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']"> + <genre authority="marc">atlas</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:if test="$typeOf008='SE'"> + <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-21='d'"> + <genre authority="marc">database</genre> + </xsl:when> + <xsl:when test="$controlField008-21='l'"> + <genre authority="marc">loose-leaf</genre> + </xsl:when> + <xsl:when test="$controlField008-21='m'"> + <genre authority="marc">series</genre> + </xsl:when> + <xsl:when test="$controlField008-21='n'"> + <genre authority="marc">newspaper</genre> + </xsl:when> + <xsl:when test="$controlField008-21='p'"> + <genre authority="marc">periodical</genre> + </xsl:when> + <xsl:when test="$controlField008-21='w'"> + <genre authority="marc">web site</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:if test="$typeOf008='BK' or $typeOf008='SE'"> + <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/> + <xsl:choose> + <xsl:when test="contains($controlField008-24,'a')"> + <genre authority="marc">abstract or summary</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'b')"> + <genre authority="marc">bibliography</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'c')"> + <genre authority="marc">catalog</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'d')"> + <genre authority="marc">dictionary</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'e')"> + <genre authority="marc">encyclopedia</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'f')"> + <genre authority="marc">handbook</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'g')"> + <genre authority="marc">legal article</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'i')"> + <genre authority="marc">index</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'k')"> + <genre authority="marc">discography</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'l')"> + <genre authority="marc">legislation</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'m')"> + <genre authority="marc">theses</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'n')"> + <genre authority="marc">survey of literature</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'o')"> + <genre authority="marc">review</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'p')"> + <genre authority="marc">programmed text</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'q')"> + <genre authority="marc">filmography</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'r')"> + <genre authority="marc">directory</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'s')"> + <genre authority="marc">statistics</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'t')"> + <genre authority="marc">technical report</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'v')"> + <genre authority="marc">legal case and case notes</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'w')"> + <genre authority="marc">law report or digest</genre> + </xsl:when> + <xsl:when test="contains($controlField008-24,'z')"> + <genre authority="marc">treaty</genre> + </xsl:when> + </xsl:choose> + <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-29='1'"> + <genre authority="marc">conference publication</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:if test="$typeOf008='CF'"> + <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-26='a'"> + <genre authority="marc">numeric data</genre> + </xsl:when> + <xsl:when test="$controlField008-26='e'"> + <genre authority="marc">database</genre> + </xsl:when> + <xsl:when test="$controlField008-26='f'"> + <genre authority="marc">font</genre> + </xsl:when> + <xsl:when test="$controlField008-26='g'"> + <genre authority="marc">game</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:if test="$typeOf008='BK'"> + <xsl:if test="substring($controlField008,25,1)='j'"> + <genre authority="marc">patent</genre> + </xsl:if> + <xsl:if test="substring($controlField008,31,1)='1'"> + <genre authority="marc">festschrift</genre> + </xsl:if> + + <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/> + <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'"> + <genre authority="marc">biography</genre> + </xsl:if> + + <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-33='e'"> + <genre authority="marc">essay</genre> + </xsl:when> + <xsl:when test="$controlField008-33='d'"> + <genre authority="marc">drama</genre> + </xsl:when> + <xsl:when test="$controlField008-33='c'"> + <genre authority="marc">comic strip</genre> + </xsl:when> + <xsl:when test="$controlField008-33='l'"> + <genre authority="marc">fiction</genre> + </xsl:when> + <xsl:when test="$controlField008-33='h'"> + <genre authority="marc">humor, satire</genre> + </xsl:when> + <xsl:when test="$controlField008-33='i'"> + <genre authority="marc">letter</genre> + </xsl:when> + <xsl:when test="$controlField008-33='f'"> + <genre authority="marc">novel</genre> + </xsl:when> + <xsl:when test="$controlField008-33='j'"> + <genre authority="marc">short story</genre> + </xsl:when> + <xsl:when test="$controlField008-33='s'"> + <genre authority="marc">speech</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:if test="$typeOf008='MU'"> + <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/> + <xsl:if test="contains($controlField008-30-31,'b')"> + <genre authority="marc">biography</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'c')"> + <genre authority="marc">conference publication</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'d')"> + <genre authority="marc">drama</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'e')"> + <genre authority="marc">essay</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'f')"> + <genre authority="marc">fiction</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'o')"> + <genre authority="marc">folktale</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'h')"> + <genre authority="marc">history</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'k')"> + <genre authority="marc">humor, satire</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'m')"> + <genre authority="marc">memoir</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'p')"> + <genre authority="marc">poetry</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'r')"> + <genre authority="marc">rehearsal</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'g')"> + <genre authority="marc">reporting</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'s')"> + <genre authority="marc">sound</genre> + </xsl:if> + <xsl:if test="contains($controlField008-30-31,'l')"> + <genre authority="marc">speech</genre> + </xsl:if> + </xsl:if> + + <xsl:if test="$typeOf008='VM'"> + <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/> + <xsl:choose> + <xsl:when test="$controlField008-33='a'"> + <genre authority="marc">art original</genre> + </xsl:when> + <xsl:when test="$controlField008-33='b'"> + <genre authority="marc">kit</genre> + </xsl:when> + <xsl:when test="$controlField008-33='c'"> + <genre authority="marc">art reproduction</genre> + </xsl:when> + <xsl:when test="$controlField008-33='d'"> + <genre authority="marc">diorama</genre> + </xsl:when> + <xsl:when test="$controlField008-33='f'"> + <genre authority="marc">filmstrip</genre> + </xsl:when> + <xsl:when test="$controlField008-33='g'"> + <genre authority="marc">legal article</genre> + </xsl:when> + <xsl:when test="$controlField008-33='i'"> + <genre authority="marc">picture</genre> + </xsl:when> + <xsl:when test="$controlField008-33='k'"> + <genre authority="marc">graphic</genre> + </xsl:when> + <xsl:when test="$controlField008-33='l'"> + <genre authority="marc">technical drawing</genre> + </xsl:when> + <xsl:when test="$controlField008-33='m'"> + <genre authority="marc">motion picture</genre> + </xsl:when> + <xsl:when test="$controlField008-33='n'"> + <genre authority="marc">chart</genre> + </xsl:when> + <xsl:when test="$controlField008-33='o'"> + <genre authority="marc">flash card</genre> + </xsl:when> + <xsl:when test="$controlField008-33='p'"> + <genre authority="marc">microscope slide</genre> + </xsl:when> + <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']"> + <genre authority="marc">model</genre> + </xsl:when> + <xsl:when test="$controlField008-33='r'"> + <genre authority="marc">realia</genre> + </xsl:when> + <xsl:when test="$controlField008-33='s'"> + <genre authority="marc">slide</genre> + </xsl:when> + <xsl:when test="$controlField008-33='t'"> + <genre authority="marc">transparency</genre> + </xsl:when> + <xsl:when test="$controlField008-33='v'"> + <genre authority="marc">videorecording</genre> + </xsl:when> + <xsl:when test="$controlField008-33='w'"> + <genre authority="marc">toy</genre> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=655]"> + <genre authority="marc"> + <xsl:attribute name="authority"> + <xsl:value-of select="marc:subfield[@code='2']"/> + </xsl:attribute> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abvxyz</xsl:with-param> + <xsl:with-param name="delimeter">-</xsl:with-param> + </xsl:call-template> + </genre> + </xsl:for-each> + + <originInfo> + <xsl:variable name="MARCpublicationCode" select="normalize-space(substring($controlField008,16,3))"/> + + <xsl:if test="translate($MARCpublicationCode,'|','')"> + <place> + <placeTerm> + <xsl:attribute name="type">code</xsl:attribute> + <xsl:attribute name="authority">marccountry</xsl:attribute> + <xsl:value-of select="$MARCpublicationCode"/> + </placeTerm> + </place> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=044]/marc:subfield[@code='c']"> + <place> + <placeTerm> + <xsl:attribute name="type">code</xsl:attribute> + <xsl:attribute name="authority">iso3166</xsl:attribute> + <xsl:value-of select="."/> + </placeTerm> + </place> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='a']"> + <place> + <placeTerm> + <xsl:attribute name="type">text</xsl:attribute> + <xsl:call-template name="chopPunctuationFront"> + <xsl:with-param name="chopString"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </placeTerm> + </place> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']"> + <dateValid point="start"> + <xsl:value-of select="."/> + </dateValid> + </xsl:for-each> + <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']"> + <dateValid point="end"> + <xsl:value-of select="."/> + </dateValid> + </xsl:for-each> + <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']"> + <dateModified> + <xsl:value-of select="."/> + </dateModified> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='b' or @code='c' or @code='g']"> + <xsl:choose> + <xsl:when test="@code='b'"> + <publisher> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + <xsl:with-param name="punctuation"> + <xsl:text>:,;/ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </publisher> + </xsl:when> + <xsl:when test="@code='c'"> + <dateIssued> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </dateIssued> + </xsl:when> + <xsl:when test="@code='g'"> + <dateCreated> + <xsl:value-of select="."/> + </dateCreated> + </xsl:when> + </xsl:choose> + </xsl:for-each> + + <xsl:variable name="dataField260c"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="marc:datafield[@tag=260]/marc:subfield[@code='c']"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="controlField008-7-10" select="normalize-space(substring($controlField008, 8, 4))"/> + <xsl:variable name="controlField008-11-14" select="normalize-space(substring($controlField008, 12, 4))"/> + <xsl:variable name="controlField008-6" select="normalize-space(substring($controlField008, 7, 1))"/> + + <xsl:if test="$controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='t' or $controlField008-6='s'"> + <xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)"> + <dateIssued encoding="marc"> + <xsl:value-of select="$controlField008-7-10"/> + </dateIssued> + </xsl:if> + </xsl:if> + + <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'"> + <xsl:if test="$controlField008-7-10"> + <dateIssued encoding="marc" point="start"> + <xsl:value-of select="$controlField008-7-10"/> + </dateIssued> + </xsl:if> + </xsl:if> + + <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'"> + <xsl:if test="$controlField008-11-14"> + <dateIssued encoding="marc" point="end"> + <xsl:value-of select="$controlField008-11-14"/> + </dateIssued> + </xsl:if> + </xsl:if> + + <xsl:if test="$controlField008-6='q'"> + <xsl:if test="$controlField008-7-10"> + <dateIssued encoding="marc" point="start" qualifier="questionable"> + <xsl:value-of select="$controlField008-7-10"/> + </dateIssued> + </xsl:if> + </xsl:if> + + <xsl:if test="$controlField008-6='q'"> + <xsl:if test="$controlField008-11-14"> + <dateIssued encoding="marc" point="end" qualifier="questionable"> + <xsl:value-of select="$controlField008-11-14"/> + </dateIssued> + </xsl:if> + </xsl:if> + + <xsl:if test="$controlField008-6='t'"> + <xsl:if test="$controlField008-11-14"> + <copyrightDate encoding="marc"> + <xsl:value-of select="$controlField008-11-14"/> + </copyrightDate> + </xsl:if> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']"> + <dateCaptured encoding="iso8601"> + <xsl:value-of select="."/> + </dateCaptured> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]"> + <dateCaptured encoding="iso8601" point="start"> + <xsl:value-of select="."/> + </dateCaptured> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]"> + <dateCaptured encoding="iso8601" point="end"> + <xsl:value-of select="."/> + </dateCaptured> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=250]/marc:subfield[@code='a']"> + <edition> + <xsl:value-of select="."/> + </edition> + </xsl:for-each> + + <xsl:for-each select="marc:leader"> + <issuance> + <xsl:choose> + <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">monographic</xsl:when> + <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">continuing</xsl:when> + </xsl:choose> + </issuance> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=310]|marc:datafield[@tag=321]"> + <frequency> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </frequency> + </xsl:for-each> + </originInfo> + <xsl:variable name="controlField008-35-37" select="normalize-space(translate(substring($controlField008,36,3),'|#',''))"/> + <xsl:if test="$controlField008-35-37"> + <language> + <languageTerm authority="iso639-2b" type="code"> + <xsl:value-of select="substring($controlField008,36,3)"/> + </languageTerm> + </language> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=041]"> + + <!-- <xsl:variable name="langCodes"> + <xsl:copy-of select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/> + </xsl:variable> + --> + <xsl:variable name="langCodes" select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/> + + <xsl:choose> + <xsl:when test="marc:subfield[@code='2']='rfc3066'"> + <!-- not stacked but could be repeated --> + <xsl:call-template name="rfcLanguages"> + <xsl:with-param name="nodeNum"> + <xsl:value-of select="1"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:text></xsl:text> + </xsl:with-param> + <xsl:with-param name="controlField008-35-37"> + <xsl:value-of select="$controlField008-35-37"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <!-- iso --> + <xsl:variable name="allLanguages"> + <xsl:copy-of select="$langCodes"/> + </xsl:variable> + <xsl:variable name="currentLanguage"> + <xsl:value-of select="substring($allLanguages,1,3)"/> + </xsl:variable> + <xsl:call-template name="isoLanguage"> + <xsl:with-param name="currentLanguage"> + <xsl:value-of select="substring($allLanguages,1,3)"/> + </xsl:with-param> + <xsl:with-param name="remainingLanguages"> + <xsl:value-of select="substring($allLanguages,4,string-length($allLanguages)-3)"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:if test="$controlField008-35-37"> + <xsl:value-of select="$controlField008-35-37"/> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + + <xsl:variable name="physicalDescription"> + <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a' or substring(.,12,1)='b']"> + <digitalOrigin>reformatted digital</digitalOrigin> + </xsl:if> + + <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/> + <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/> + + <xsl:variable name="check008-23"> + <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='SE' or $typeOf008='MM'"> + <xsl:value-of select="true()"/> + </xsl:if> + </xsl:variable> + + <xsl:variable name="check008-29"> + <xsl:if test="$typeOf008='MP' or $typeOf008='VM'"> + <xsl:value-of select="true()"/> + </xsl:if> + </xsl:variable> + + <xsl:choose> + <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')"> + <form authority="marcform">braille</form> + </xsl:when> + <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='SE') and ($controlField008-23=' ' or $controlField008='r'))"> + <form authority="marcform">print</form> + </xsl:when> + <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')"> + <form authority="marcform">electronic</form> + </xsl:when> + <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')"> + <form authority="marcform">microfiche</form> + </xsl:when> + <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')"> + <form authority="marcform">microfilm</form> + </xsl:when> + </xsl:choose> + <!-- 1/04 fix --> + <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + + <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']"> + <form authority="gmd"> + <xsl:call-template name="chopBrackets"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"/> + </xsl:with-param> + </xsl:call-template> + </form> + </xsl:if> + <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']"> + <form> + <xsl:value-of select="."/> + </form> + </xsl:for-each> + + <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']"> + <xsl:choose> + <xsl:when test="substring(text(),14,1)='a'"> + <reformattingQuality>access</reformattingQuality> + </xsl:when> + <xsl:when test="substring(text(),14,1)='p'"> + <reformattingQuality>preservation</reformattingQuality> + </xsl:when> + <xsl:when test="substring(text(),14,1)='r'"> + <reformattingQuality>replacement</reformattingQuality> + </xsl:when> + </xsl:choose> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]"> + <internetMediaType> + <xsl:value-of select="."/> + </internetMediaType> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=300]"> + <extent> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abce</xsl:with-param> + </xsl:call-template> + </extent> + </xsl:for-each> + </xsl:variable> + + <xsl:if test="string-length(normalize-space($physicalDescription))"> + <physicalDescription> + <xsl:copy-of select="$physicalDescription"/> + </physicalDescription> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=520]"> + <abstract> + <xsl:call-template name="uri"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </abstract> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=505]"> + <tableOfContents> + <xsl:call-template name="uri"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">agrt</xsl:with-param> + </xsl:call-template> + </tableOfContents> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=521]"> + <targetAudience> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </targetAudience> + </xsl:for-each> + + <xsl:if test="$typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM'"> + <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/> + <xsl:choose> + <!-- 01/04 fix --> + <xsl:when test="$controlField008-22='d'"> + <targetAudience authority="marctarget">adolescent</targetAudience> + </xsl:when> + <xsl:when test="$controlField008-22='e'"> + <targetAudience authority="marctarget">adult</targetAudience> + </xsl:when> + <xsl:when test="$controlField008-22='g'"> + <targetAudience authority="marctarget">general</targetAudience> + </xsl:when> + <xsl:when test="$controlField008-22='b' or $controlField008-22='c' or $controlField008-22='j'"> + <targetAudience authority="marctarget">juvenile</targetAudience> + </xsl:when> + <xsl:when test="$controlField008-22='a'"> + <targetAudience authority="marctarget">preschool</targetAudience> + </xsl:when> + <xsl:when test="$controlField008-22='f'"> + <targetAudience authority="marctarget">specialized</targetAudience> + </xsl:when> + </xsl:choose> + </xsl:if> + + <xsl:for-each select="marc:datafield[@tag=245]/marc:subfield[@code='c']"> + <note type="statement of responsibility"> + <xsl:value-of select="."/> + </note> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=500]"> + <note> + <xsl:value-of select="marc:subfield[@code='a']"/> + <xsl:call-template name="uri"/> + </note> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=511]"> + <note type="performers"> + <xsl:call-template name="uri"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </note> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=518]"> + <note type="venue"> + <xsl:call-template name="uri"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </note> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=501 or @tag=502 or @tag=504 or @tag=506 or @tag=507 or @tag=508 or @tag=513 or @tag=514 or @tag=515 or @tag=516 or @tag=522 or @tag=524 or @tag=525 or @tag=526 or @tag=530 or @tag=533 or @tag=534 or @tag=535 or @tag=536 or @tag=538 or @tag=540 or @tag=541 or @tag=544 or @tag=545 or @tag=546 or @tag=547 or @tag=550 or @tag=552 or @tag=555 or @tag=556 or @tag=561 or @tag=562 or @tag=565 or @tag=567 or @tag=580 or @tag=581 or @tag=583 or @tag=584 or @tag=585 or @tag=586]"> + <note> + <xsl:call-template name="uri"/> + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']"> + <xsl:value-of select="."/> + <xsl:text> </xsl:text> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </note> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=034][marc:subfield[@code='d' or @code='e' or @code='f' or @code='g']]"> + <subject> + <cartographics> + <coordinates> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">defg</xsl:with-param> + </xsl:call-template> + </coordinates> + </cartographics> + </subject> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=043]"> + <subject> + <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']"> + <geographicCode> + <xsl:attribute name="authority"> + <xsl:if test="@code='a'"> + <xsl:text>marcgac</xsl:text> + </xsl:if> + <xsl:if test="@code='b'"> + <xsl:value-of select="following-sibling::marc:subfield[@code=2]"/> + </xsl:if> + <xsl:if test="@code='c'"> + <xsl:text>iso3166</xsl:text> + </xsl:if> + </xsl:attribute> + <xsl:value-of select="self::marc:subfield"/> + </geographicCode> + </xsl:for-each> + </subject> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=255]"> + <subject> + <cartographics> + <xsl:for-each select="marc:subfield[@code='c']"> + <coordinates> + <xsl:value-of select="."/> + </coordinates> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='a']"> + <scale> + <xsl:value-of select="."/> + </scale> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <projection> + <xsl:value-of select="."/> + </projection> + </xsl:for-each> + </cartographics> + </subject> + </xsl:for-each> + + <xsl:apply-templates select="marc:datafield[653 >= @tag and @tag >= 600]"/> + + <xsl:apply-templates select="marc:datafield[@tag=656]"/> + + <xsl:for-each select="marc:datafield[@tag=752]"> + <subject> + <hierarchicalGeographic> + <xsl:for-each select="marc:subfield[@code='a']"> + <country> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </country> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <state> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </state> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='c']"> + <county> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </county> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='d']"> + <city> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </city> + </xsl:for-each> + </hierarchicalGeographic> + </subject> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=045][marc:subfield[@code='b']]"> + <subject> + + <xsl:choose> + + <xsl:when test="@ind1=2"> + + <temporal encoding="iso8601" point="start"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:subfield[@code='b'][1]"/> + </xsl:with-param> + </xsl:call-template> + </temporal> + <temporal encoding="iso8601" point="end"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + + + <xsl:value-of select="marc:subfield[@code='b'][2]"/> + </xsl:with-param> + </xsl:call-template> + </temporal> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="marc:subfield[@code='b']"> + <temporal encoding="iso8601"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </temporal> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </subject> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=050]"> + <xsl:for-each select="marc:subfield[@code='b']"> + <classification authority="lcc"> + <xsl:value-of select="preceding-sibling::marc:subfield[@code='a'][1]"/> + <xsl:text> </xsl:text> + <xsl:value-of select="text()"/> + </classification> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='a'][not(following-sibling::marc:subfield[@code='b'])]"> + <classification authority="lcc"> + <xsl:value-of select="text()"/> + </classification> + </xsl:for-each> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=082]"> + <classification authority="ddc"> + <xsl:if test="marc:subfield[@code='2']"> + <xsl:attribute name="edition"> + <xsl:value-of select="marc:subfield[@code='2']"/> + </xsl:attribute> + </xsl:if> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=080]"> + <classification authority="udc"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abx</xsl:with-param> + </xsl:call-template> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=060]"> + <classification authority="nlm"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=086][@ind1=0]"> + <classification authority="sudocs"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=086][@ind1=1]"> + <classification authority="candoc"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=086]"> + <classification> + <xsl:attribute name="authority"> + <xsl:value-of select="marc:subfield[@code='2']"/> + </xsl:attribute> + <xsl:value-of select="marc:subfield[@code='a']"/> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=084]"> + <classification> + <xsl:attribute name="authority"> + <xsl:value-of select="marc:subfield[@code='2']"/> + </xsl:attribute> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </classification> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=440]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=510]"> + <relatedItem type="isReferencedBy"> + <note> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcx3</xsl:with-param> + </xsl:call-template> + </note> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=534]"> + <relatedItem type="original"> + <xsl:call-template name="relatedTitle"/> + <xsl:call-template name="relatedName"/> + <xsl:if test="marc:subfield[@code='b' or @code='c']"> + <originInfo> + <xsl:for-each select="marc:subfield[@code='c']"> + <publisher> + <xsl:value-of select="."/> + </publisher> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <edition> + <xsl:value-of select="."/> + </edition> + </xsl:for-each> + </originInfo> + </xsl:if> + <xsl:call-template name="relatedIdentifierISSN"/> + <xsl:for-each select="marc:subfield[@code='z']"> + <identifier type="isbn"> + <xsl:value-of select="."/> + </identifier> + </xsl:for-each> + <xsl:call-template name="relatedNote"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='t']]"> + <relatedItem> + <xsl:call-template name="constituentOrRelatedType"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + <name type="personal"> + <namePart> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">aq</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">g</xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="termsOfAddress"/> + <xsl:call-template name="nameDate"/> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="relatedForm"/> + <xsl:call-template name="relatedIdentifierISSN"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=710][marc:subfield[@code='t']]"> + <relatedItem> + <xsl:call-template name="constituentOrRelatedType"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="relatedPartNumName"/> + </titleInfo> + <name type="corporate"> + <xsl:for-each select="marc:subfield[@code='a']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:variable name="tempNamePart"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">c</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">dgn</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:if test="normalize-space($tempNamePart)"> + <namePart> + <xsl:value-of select="$tempNamePart"/> + </namePart> + </xsl:if> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="relatedForm"/> + <xsl:call-template name="relatedIdentifierISSN"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=711][marc:subfield[@code='t']]"> + <relatedItem> + <xsl:call-template name="constituentOrRelatedType"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="relatedPartNumName"/> + </titleInfo> + <name type="conference"> + <namePart> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">aqdc</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">gn</xsl:with-param> + </xsl:call-template> + </namePart> + </name> + <xsl:call-template name="relatedForm"/> + <xsl:call-template name="relatedIdentifierISSN"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=730][@ind2=2]"> + <relatedItem> + <xsl:call-template name="constituentOrRelatedType"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + <xsl:call-template name="relatedForm"/> + <xsl:call-template name="relatedIdentifierISSN"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=740][@ind2=2]"> + <relatedItem> + <xsl:call-template name="constituentOrRelatedType"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + <xsl:call-template name="relatedForm"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]"> + <relatedItem type="series"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=777]|marc:datafield[@tag=787]"> + <relatedItem> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=775]"> + <relatedItem type="otherVersion"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=770]|marc:datafield[@tag=774]"> + <relatedItem type="constituent"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=772]|marc:datafield[@tag=773]"> + <relatedItem type="host"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=776]"> + <relatedItem type="otherFormat"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=780]"> + <relatedItem type="preceding"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=785]"> + <relatedItem type="succeeding"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=786]"> + <relatedItem type="original"> + <xsl:call-template name="relatedItem76X-78X"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=800]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + <name type="personal"> + <namePart> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">aq</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="termsOfAddress"/> + <xsl:call-template name="nameDate"/> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="relatedForm"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=810]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="relatedPartNumName"/> + </titleInfo> + <name type="corporate"> + <xsl:for-each select="marc:subfield[@code='a']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <namePart> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">c</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">dgn</xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="relatedForm"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=811]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="relatedPartNumName"/> + </titleInfo> + <name type="conference"> + <namePart> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">aqdc</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="beforeCodes">gn</xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="relatedForm"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=830]"> + <relatedItem type="series"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:call-template name="part"/> + </titleInfo> + <xsl:call-template name="relatedForm"/> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=856][@ind2=2]/marc:subfield[@code='q']"> + <relatedItem> + <internetMediaType> + <xsl:value-of select="."/> + </internetMediaType> + </relatedItem> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=020]"> + <identifier type="isbn"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=024][@ind1=0]"> + <identifier type="isrc"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=024][@ind1=2]"> + <identifier type="ismn"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=022]"> + <identifier type="issn"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=010]"> + <identifier type="lccn"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=028]"> + <identifier> + <xsl:attribute name="type"> + <xsl:choose> + <xsl:when test="@ind1=0">issue number</xsl:when> + <xsl:when test="@ind1=1">matrix number</xsl:when> + <xsl:when test="@ind1=2">music plate</xsl:when> + <xsl:when test="@ind1=3">music publisher</xsl:when> + <xsl:when test="@ind1=4">videorecording identifier</xsl:when> + </xsl:choose> + </xsl:attribute> + <xsl:call-template name="isInvalid"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes"> + <xsl:choose> + <xsl:when test="@ind1=0">ba</xsl:when> + <xsl:otherwise>ab</xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=024][@ind1='4']"> + <identifier type="sici"> + <xsl:call-template name="isInvalid"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=037]"> + <identifier type="stock number"> + <xsl:call-template name="isInvalid"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + </identifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]"> + <identifier> + <xsl:attribute name="type"> + <xsl:choose> + <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:doi') or starts-with(marc:subfield[@code='u'],'doi')">doi</xsl:when> + <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov')">hdl</xsl:when> + <xsl:otherwise>uri</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:choose> + <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov') "> + <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="marc:subfield[@code='u']"/> + </xsl:otherwise> + </xsl:choose> + </identifier> + <xsl:if test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl')"> + <identifier type="hdl"> + <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']"> + <xsl:attribute name="displayLabel"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">y3z</xsl:with-param> + </xsl:call-template> + </xsl:attribute> + </xsl:if> + <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/> + </identifier> + </xsl:if> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=024][@ind1=1]"> + <identifier type="upc"> + <xsl:call-template name="isInvalid"/> + <xsl:value-of select="marc:subfield[@code='a']"/> + </identifier> + </xsl:for-each> + <!-- 1/04 fix added $y --> + <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]"> + <location> + <url> + <xsl:if test="marc:subfield[@code='y' or @code='3']"> + <xsl:attribute name="displayLabel"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">y3</xsl:with-param> + </xsl:call-template> + </xsl:attribute> + </xsl:if> + <xsl:value-of select="marc:subfield[@code='u']"/> + </url> + </location> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=852]"> + <location> + <physicalLocation> + <xsl:call-template name="displayLabel"/> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abje</xsl:with-param> + </xsl:call-template> + </physicalLocation> + </location> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=506]"> + <accessCondition type="restrictionOnAccess"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcd35</xsl:with-param> + </xsl:call-template> + </accessCondition> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=540]"> + <accessCondition type="useAndReproduction"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcde35</xsl:with-param> + </xsl:call-template> + </accessCondition> + </xsl:for-each> + + <recordInfo> + <xsl:for-each select="marc:datafield[@tag=040]"> + <recordContentSource authority="marcorg"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </recordContentSource> + </xsl:for-each> + + <xsl:for-each select="marc:controlfield[@tag=008]"> + <recordCreationDate encoding="marc"> + <xsl:value-of select="substring(.,1,6)"/> + </recordCreationDate> + </xsl:for-each> + + <xsl:for-each select="marc:controlfield[@tag=005]"> + <recordChangeDate encoding="iso8601"> + <xsl:value-of select="."/> + </recordChangeDate> + </xsl:for-each> + + <xsl:for-each select="marc:controlfield[@tag=001]"> + <recordIdentifier> + <xsl:if test="../marc:controlfield[@tag=003]"> + <xsl:attribute name="source"> + <xsl:value-of select="../marc:controlfield[@tag=003]"/> + </xsl:attribute> + </xsl:if> + <xsl:value-of select="."/> + </recordIdentifier> + </xsl:for-each> + + <xsl:for-each select="marc:datafield[@tag=040]/marc:subfield[@code='b']"> + <languageOfCataloging> + <languageTerm authority="iso639-2b" type="code"> + <xsl:value-of select="."/> + </languageTerm> + </languageOfCataloging> + </xsl:for-each> + </recordInfo> + </xsl:template> + + <xsl:template name="displayForm"> + <xsl:for-each select="marc:subfield[@code='c']"> + <displayForm> + <xsl:value-of select="."/> + </displayForm> + </xsl:for-each> + </xsl:template> + + <xsl:template name="affiliation"> + <xsl:for-each select="marc:subfield[@code='u']"> + <affiliation> + <xsl:value-of select="."/> + </affiliation> + </xsl:for-each> + </xsl:template> + + <xsl:template name="uri"> + <xsl:for-each select="marc:subfield[@code='u']"> + <xsl:attribute name="xlink:href"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + </xsl:template> + + <xsl:template name="role"> + <xsl:for-each select="marc:subfield[@code='e']"> + <role> + <roleTerm type="text"> + <xsl:value-of select="."/> + </roleTerm> + </role> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='4']"> + <role> + <roleTerm authority="marcrelator" type="code"> + <xsl:value-of select="."/> + </roleTerm> + </role> + </xsl:for-each> + </xsl:template> + + <xsl:template name="part"> + <xsl:variable name="partNumber"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">n</xsl:with-param> + <xsl:with-param name="anyCodes">n</xsl:with-param> + <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="partName"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">p</xsl:with-param> + <xsl:with-param name="anyCodes">p</xsl:with-param> + <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:if test="string-length(normalize-space($partNumber))"> + <partNumber> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="$partNumber"/> + </xsl:call-template> + </partNumber> + </xsl:if> + <xsl:if test="string-length(normalize-space($partName))"> + <partName> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="$partName"/> + </xsl:call-template> + </partName> + </xsl:if> + </xsl:template> + + <xsl:template name="relatedPart"> + <xsl:if test="@tag=773"> + <xsl:for-each select="marc:subfield[@code='g']"> + <part> + <text> + <xsl:value-of select="."/> + </text> + </part> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='q']"> + <part> + <xsl:call-template name="parsePart"/> + </part> + </xsl:for-each> + </xsl:if> + </xsl:template> + + <xsl:template name="relatedPartNumName"> + <xsl:variable name="partNumber"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">g</xsl:with-param> + <xsl:with-param name="anyCodes">g</xsl:with-param> + <xsl:with-param name="afterCodes">pst</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="partName"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="axis">p</xsl:with-param> + <xsl:with-param name="anyCodes">p</xsl:with-param> + <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:if test="string-length(normalize-space($partNumber))"> + <partNumber> + <xsl:value-of select="$partNumber"/> + </partNumber> + </xsl:if> + <xsl:if test="string-length(normalize-space($partName))"> + <partName> + <xsl:value-of select="$partName"/> + </partName> + </xsl:if> + </xsl:template> + + <xsl:template name="relatedName"> + <xsl:for-each select="marc:subfield[@code='a']"> + <name> + <namePart> + <xsl:value-of select="."/> + </namePart> + </name> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedForm"> + <xsl:for-each select="marc:subfield[@code='h']"> + <physicalDescription> + <form> + <xsl:value-of select="."/> + </form> + </physicalDescription> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedExtent"> + <xsl:for-each select="marc:subfield[@code='h']"> + <physicalDescription> + <extent> + <xsl:value-of select="."/> + </extent> + </physicalDescription> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedNote"> + <xsl:for-each select="marc:subfield[@code='n']"> + <note> + <xsl:value-of select="."/> + </note> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedSubject"> + <xsl:for-each select="marc:subfield[@code='j']"> + <subject> + <temporal encoding="iso8601"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </temporal> + </subject> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedIdentifierISSN"> + <xsl:for-each select="marc:subfield[@code='x']"> + <identifier type="issn"> + <xsl:value-of select="."/> + </identifier> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedIdentifierLocal"> + <xsl:for-each select="marc:subfield[@code='w']"> + <identifier type="local"> + <xsl:value-of select="."/> + </identifier> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedIdentifier"> + <xsl:for-each select="marc:subfield[@code='o']"> + <identifier> + <xsl:value-of select="."/> + </identifier> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedItem76X-78X"> + <xsl:call-template name="displayLabel"/> + <xsl:call-template name="relatedTitle76X-78X"/> + <xsl:call-template name="relatedName"/> + <xsl:call-template name="relatedOriginInfo"/> + <xsl:call-template name="relatedLanguage"/> + <xsl:call-template name="relatedExtent"/> + <xsl:call-template name="relatedNote"/> + <xsl:call-template name="relatedSubject"/> + <xsl:call-template name="relatedIdentifier"/> + <xsl:call-template name="relatedIdentifierISSN"/> + <xsl:call-template name="relatedIdentifierLocal"/> + <xsl:call-template name="relatedPart"/> + </xsl:template> + + <xsl:template name="subjectGeographicZ"> + <geographic> + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </geographic> + </xsl:template> + + <xsl:template name="subjectTemporalY"> + <temporal> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </temporal> + </xsl:template> + + <xsl:template name="subjectTopic"> + <topic> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </topic> + </xsl:template> + + <xsl:template name="nameABCDN"> + <xsl:for-each select="marc:subfield[@code='a']"> + <namePart> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </namePart> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']"> + <namePart> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">cdn</xsl:with-param> + </xsl:call-template> + </namePart> + </xsl:if> + </xsl:template> + + <xsl:template name="nameABCDQ"> + <namePart> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">aq</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="punctuation"> + <xsl:text>:,;/ </xsl:text> + </xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="termsOfAddress"/> + <xsl:call-template name="nameDate"/> + </xsl:template> + + <xsl:template name="nameACDEQ"> + <namePart> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">acdeq</xsl:with-param> + </xsl:call-template> + </namePart> + </xsl:template> + + <xsl:template name="constituentOrRelatedType"> + <xsl:if test="@ind2=2"> + <xsl:attribute name="type">constituent</xsl:attribute> + </xsl:if> + </xsl:template> + + <xsl:template name="relatedTitle"> + <xsl:for-each select="marc:subfield[@code='t']"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </title> + </titleInfo> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedTitle76X-78X"> + <xsl:for-each select="marc:subfield[@code='t']"> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']"> + <xsl:call-template name="relatedPartNumName"/> + </xsl:if> + </titleInfo> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='p']"> + <titleInfo type="abbreviated"> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']"> + <xsl:call-template name="relatedPartNumName"/> + </xsl:if> + </titleInfo> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='s']"> + <titleInfo type="uniform"> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </title> + <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']"> + <xsl:call-template name="relatedPartNumName"/> + </xsl:if> + </titleInfo> + </xsl:for-each> + </xsl:template> + + <xsl:template name="relatedOriginInfo"> + <xsl:if test="marc:subfield[@code='b' or @code='d'] or marc:subfield[@code='f']"> + <originInfo> + <xsl:if test="@tag=775"> + <xsl:for-each select="marc:subfield[@code='f']"> + <place> + <placeTerm> + <xsl:attribute name="type">code</xsl:attribute> + <xsl:attribute name="authority">marcgac</xsl:attribute> + <xsl:value-of select="."/> + </placeTerm> + </place> + </xsl:for-each> + </xsl:if> + <xsl:for-each select="marc:subfield[@code='d']"> + <publisher> + <xsl:value-of select="."/> + </publisher> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <edition> + <xsl:value-of select="."/> + </edition> + </xsl:for-each> + </originInfo> + </xsl:if> + </xsl:template> + + <xsl:template name="relatedLanguage"> + <xsl:for-each select="marc:subfield[@code='e']"> + <xsl:call-template name="getLanguage"> + <xsl:with-param name="langString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </xsl:for-each> + </xsl:template> + <xsl:template name="nameDate"> + <xsl:for-each select="marc:subfield[@code='d']"> + <namePart type="date"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </namePart> + </xsl:for-each> + </xsl:template> + + <xsl:template name="subjectAuthority"> + + <xsl:if test="@ind2!=4"> + <xsl:if test="@ind2!=' '"> + <xsl:if test="@ind2!=8"> + <xsl:if test="@ind2!=9"> + <xsl:attribute name="authority"> + <xsl:choose> + + <xsl:when test="@ind2=0">lcsh</xsl:when> + <xsl:when test="@ind2=1">lcshac</xsl:when> + <xsl:when test="@ind2=2">mesh</xsl:when> + <!-- 1/04 fix --> + <xsl:when test="@ind2=3">nal</xsl:when> + <xsl:when test="@ind2=5">csh</xsl:when> + <xsl:when test="@ind2=6">rvm</xsl:when> + <xsl:when test="@ind2=7"> + <xsl:value-of select="marc:subfield[@code='2']"/> + </xsl:when> + </xsl:choose> + </xsl:attribute> + </xsl:if> + </xsl:if> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template name="subjectAnyOrder"> + <xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']"> + <xsl:choose> + <xsl:when test="@code='v'"> + <xsl:call-template name="subjectTopic"/> + </xsl:when> + <xsl:when test="@code='x'"> + <xsl:call-template name="subjectTopic"/> + </xsl:when> + <xsl:when test="@code='y'"> + <xsl:call-template name="subjectTemporalY"/> + </xsl:when> + <xsl:when test="@code='z'"> + <xsl:call-template name="subjectGeographicZ"/> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:template> + + <xsl:template name="specialSubfieldSelect"> + <xsl:param name="anyCodes"/> + <xsl:param name="axis"/> + <xsl:param name="beforeCodes"/> + <xsl:param name="afterCodes"/> + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])"> + <xsl:value-of select="text()"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=600]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <name type="personal"> + <xsl:call-template name="termsOfAddress"/> + <namePart> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">aq</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:call-template name="nameDate"/> + <xsl:call-template name="affiliation"/> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=610]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <name type="corporate"> + <xsl:for-each select="marc:subfield[@code='a']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:for-each select="marc:subfield[@code='b']"> + <namePart> + <xsl:value-of select="."/> + </namePart> + </xsl:for-each> + <xsl:if test="marc:subfield[@code='c' or @code='d' or @code='n' or @code='p']"> + <namePart> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">cdnp</xsl:with-param> + </xsl:call-template> + </namePart> + </xsl:if> + <xsl:call-template name="role"/> + </name> + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=611]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <name type="conference"> + <namePart> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcdeqnp</xsl:with-param> + </xsl:call-template> + </namePart> + <xsl:for-each select="marc:subfield[@code='4']"> + <role> + <roleTerm authority="marcrelator" type="code"> + <xsl:value-of select="."/> + </roleTerm> + </role> + </xsl:for-each> + </name> + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=630]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <titleInfo> + <title> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfhklor</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="part"/> + </title> + </titleInfo> + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=650]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <topic> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abcd</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </topic> + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=651]"> + <subject> + <xsl:call-template name="subjectAuthority"/> + <xsl:for-each select="marc:subfield[@code='a']"> + + <geographic> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="."/> + </xsl:call-template> + </geographic> + </xsl:for-each> + + <xsl:call-template name="subjectAnyOrder"/> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=653]"> + <subject> + <xsl:for-each select="marc:subfield[@code='a']"> + <topic> + <xsl:value-of select="."/> + </topic> + </xsl:for-each> + </subject> + </xsl:template> + + <xsl:template match="marc:datafield[@tag=656]"> + <subject> + <xsl:if test="marc:subfield[@code=2]"> + <xsl:attribute name="authority"> + <xsl:value-of select="marc:subfield[@code=2]"/> + </xsl:attribute> + </xsl:if> + <occupation> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </xsl:with-param> + </xsl:call-template> + </occupation> + </subject> + </xsl:template> + + <xsl:template name="termsOfAddress"> + <xsl:if test="marc:subfield[@code='b' or @code='c']"> + <namePart type="termsOfAddress"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">bc</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + </namePart> + </xsl:if> + </xsl:template> + + <xsl:template name="displayLabel"> + <xsl:if test="marc:subfield[@code='i']"> + <xsl:attribute name="displayLabel"> + <xsl:value-of select="marc:subfield[@code='i']"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="marc:subfield[@code='3']"> + <xsl:attribute name="displayLabel"> + <xsl:value-of select="marc:subfield[@code='3']"/> + </xsl:attribute> + </xsl:if> + </xsl:template> + + <xsl:template name="isInvalid"> + <xsl:if test="marc:subfield[@code='z']"> + <xsl:attribute name="invalid">yes</xsl:attribute> + </xsl:if> + </xsl:template> + + <xsl:template name="subtitle"> + <xsl:if test="marc:subfield[@code='b']"> + <subTitle> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:subfield[@code='b']"/> + + <!--<xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">b</xsl:with-param> + </xsl:call-template>--> + </xsl:with-param> + </xsl:call-template> + </subTitle> + </xsl:if> + </xsl:template> + + <xsl:template name="script"> + <xsl:param name="scriptCode"/> + <xsl:attribute name="script"> + <xsl:choose> + <xsl:when test="$scriptCode='(3'">Arabic</xsl:when> + <xsl:when test="$scriptCode='(B'">Latin</xsl:when> + <xsl:when test="$scriptCode='$1'">Chinese, Japanese, Korean</xsl:when> + <xsl:when test="$scriptCode='(N'">Cyrillic</xsl:when> + <xsl:when test="$scriptCode='(2'">Hebrew</xsl:when> + <xsl:when test="$scriptCode='(S'">Greek</xsl:when> + </xsl:choose> + </xsl:attribute> + </xsl:template> + + <xsl:template name="parsePart"> + <!-- assumes 773$q= 1:2:3<4 + with up to 3 levels and one optional start page + --> + <xsl:variable name="level1"> + <xsl:choose> + <xsl:when test="contains(text(),':')"> + <!-- 1:2 --> + <xsl:value-of select="substring-before(text(),':')"/> + </xsl:when> + <xsl:when test="not(contains(text(),':'))"> + <!-- 1 or 1<3 --> + <xsl:if test="contains(text(),'<')"> + <!-- 1<3 --> + <xsl:value-of select="substring-before(text(),'<')"/> + </xsl:if> + <xsl:if test="not(contains(text(),'<'))"> + <!-- 1 --> + <xsl:value-of select="text()"/> + </xsl:if> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:variable name="sici2"> + <xsl:choose> + <xsl:when test="starts-with(substring-after(text(),$level1),':')"> + <xsl:value-of select="substring(substring-after(text(),$level1),2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-after(text(),$level1)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="level2"> + <xsl:choose> + <xsl:when test="contains($sici2,':')"> + <!-- 2:3<4 --> + <xsl:value-of select="substring-before($sici2,':')"/> + </xsl:when> + <xsl:when test="contains($sici2,'<')"> + <!-- 1: 2<4 --> + <xsl:value-of select="substring-before($sici2,'<')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$sici2"/> + <!-- 1:2 --> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="sici3"> + <xsl:choose> + <xsl:when test="starts-with(substring-after($sici2,$level2),':')"> + <xsl:value-of select="substring(substring-after($sici2,$level2),2)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-after($sici2,$level2)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="level3"> + <xsl:choose> + <xsl:when test="contains($sici3,'<')"> + <!-- 2<4 --> + <xsl:value-of select="substring-before($sici3,'<')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$sici3"/> + <!-- 3 --> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="page"> + <xsl:if test="contains(text(),'<')"> + <xsl:value-of select="substring-after(text(),'<')"/> + </xsl:if> + </xsl:variable> + <xsl:if test="$level1"> + <detail level="1"> + <number> + <xsl:value-of select="$level1"/> + </number> + </detail> + </xsl:if> + <xsl:if test="$level2"> + <detail level="2"> + <number> + <xsl:value-of select="$level2"/> + </number> + </detail> + </xsl:if> + <xsl:if test="$level3"> + <detail level="3"> + <number> + <xsl:value-of select="$level3"/> + </number> + </detail> + </xsl:if> + <xsl:if test="$page"> + <extent unit="page"> + <start> + <xsl:value-of select="$page"/> + </start> + </extent> + </xsl:if> + </xsl:template> + + <xsl:template name="getLanguage"> + <xsl:param name="langString"/> + <xsl:param name="controlField008-35-37"/> + <xsl:variable name="length" select="string-length($langString)"/> + <xsl:choose> + <xsl:when test="$length=0"/> + <xsl:when test="$controlField008-35-37=substring($langString,1,3)"> + <xsl:call-template name="getLanguage"> + <xsl:with-param name="langString" select="substring($langString,4,$length)"/> + <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <language> + <languageTerm authority="iso639-2b" type="code"> + <xsl:value-of select="substring($langString,1,3)"/> + </languageTerm> + </language> + <xsl:call-template name="getLanguage"> + <xsl:with-param name="langString" select="substring($langString,4,$length)"/> + <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="isoLanguage"> + <xsl:param name="currentLanguage"/> + <xsl:param name="usedLanguages"/> + <xsl:param name="remainingLanguages"/> + <xsl:choose> + <xsl:when test="string-length($currentLanguage)=0"/> + <xsl:when test="not(contains($usedLanguages, $currentLanguage))"> + <language> + <languageTerm authority="iso639-2b" type="code"> + <xsl:value-of select="$currentLanguage"/> + </languageTerm> + </language> + <xsl:call-template name="isoLanguage"> + <xsl:with-param name="currentLanguage"> + <xsl:value-of select="substring($remainingLanguages,1,3)"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/> + </xsl:with-param> + <xsl:with-param name="remainingLanguages"> + <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="isoLanguage"> + <xsl:with-param name="currentLanguage"> + <xsl:value-of select="substring($remainingLanguages,1,3)"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/> + </xsl:with-param> + <xsl:with-param name="remainingLanguages"> + <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="chopBrackets"> + <xsl:param name="chopString"/> + <xsl:variable name="string"> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString" select="$chopString"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="substring($string, 1,1)='['"> + <xsl:value-of select="substring($string,2, string-length($string)-2)"/> + </xsl:if> + <xsl:if test="substring($string, 1,1)!='['"> + <xsl:value-of select="$string"/> + </xsl:if> + </xsl:template> + + <xsl:template name="rfcLanguages"> + <xsl:param name="nodeNum"/> + <xsl:param name="usedLanguages"/> + <xsl:param name="controlField008-35-37"/> + <!-- ??? xalan --> + + <xsl:variable name="currentLanguage" select="marc:subfield[position()=$nodeNum]/text()"/> + <xsl:choose> + <xsl:when test="not($currentLanguage)"/> + <xsl:when test="$currentLanguage!=$controlField008-35-37 and $currentLanguage!='rfc3066'"> + <xsl:if test="not(contains($usedLanguages,$currentLanguage))"> + <language> + <languageTerm authority="rfc3066" type="code"> + <xsl:value-of select="$currentLanguage"/> + </languageTerm> + </language> + </xsl:if> + <xsl:call-template name="rfcLanguages"> + <!-- ??? xalan --> + <xsl:with-param name="nodeNum"> + <xsl:value-of select="$nodeNum+1"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:value-of select="concat($usedLanguages,'|',$currentLanguage)"/> + </xsl:with-param> + <xsl:with-param name="controlField008-35-37"> + <xsl:value-of select="$controlField008-35-37"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="rfcLanguages"> + <xsl:with-param name="nodeNum"> + <xsl:value-of select="$nodeNum+1"/> + </xsl:with-param> + <xsl:with-param name="usedLanguages"> + <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/> + </xsl:with-param> + <xsl:with-param name="controlField008-35-37"> + <xsl:value-of select="$controlField008-35-37"/> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved. +<metaInformation> +<scenarios ><scenario default="no" name="Apr 02 Test" userelativepaths="yes" externalpreview="no" url="file:///n:/jackie/test_files/v3.xml" htmlbaseurl="" outputurl="file:///n:/temp/x.xml" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="yes" name="v3Test1" userelativepaths="yes" externalpreview="yes" url="MARCTest2.xml" htmlbaseurl="" outputurl="file:///n:/jackie/test_files/modsv3Converted.xml" processortype="internal" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="file:///n:/ckeith/DESKTOP/test.xml" htmlbaseurl="" outputurl="" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="no" name="Test" userelativepaths="yes" externalpreview="no" url="file:///n:/jackie/MARCXML/marcxmlfile.xml" htmlbaseurl="" outputurl="" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag> +</metaInformation> +--> + diff --git a/xslt/MARC21slimUtils.xsl b/xslt/MARC21slimUtils.xsl new file mode 100644 index 0000000..b85a257 --- /dev/null +++ b/xslt/MARC21slimUtils.xsl @@ -0,0 +1,82 @@ +<?xml version='1.0'?>
+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- This file is in the public domain. -->
+
+<!-- 8/19/04: ntra added "marc:" prefix to datafield element -->
+ <xsl:template name="datafield">
+ <xsl:param name="tag"/>
+ <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
+ <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
+ <xsl:param name="subfields"/>
+ <xsl:element name="marc:datafield">
+ <xsl:attribute name="tag">
+ <xsl:value-of select="$tag"/>
+ </xsl:attribute>
+ <xsl:attribute name="ind1">
+ <xsl:value-of select="$ind1"/>
+ </xsl:attribute>
+ <xsl:attribute name="ind2">
+ <xsl:value-of select="$ind2"/>
+ </xsl:attribute>
+ <xsl:copy-of select="$subfields"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="subfieldSelect">
+ <xsl:param name="codes"/>
+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="contains($codes, @code)">
+ <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
+ </xsl:template>
+
+ <xsl:template name="buildSpaces">
+ <xsl:param name="spaces"/>
+ <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
+ <xsl:if test="$spaces>0">
+ <xsl:value-of select="$char"/>
+ <xsl:call-template name="buildSpaces">
+ <xsl:with-param name="spaces" select="$spaces - 1"/>
+ <xsl:with-param name="char" select="$char"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="chopPunctuation">
+ <xsl:param name="chopString"/>
+ <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param>
+ <xsl:variable name="length" select="string-length($chopString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+ <xsl:with-param name="punctuation" select="$punctuation"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not($chopString)"/>
+ <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="chopPunctuationFront">
+ <xsl:param name="chopString"/>
+ <xsl:variable name="length" select="string-length($chopString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="contains('.:,;/[ ', substring($chopString,1,1))">
+ <xsl:call-template name="chopPunctuationFront">
+ <xsl:with-param name="chopString" select="substring($chopString,2,$length - 1)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not($chopString)"/>
+ <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/xslt/Makefile.am b/xslt/Makefile.am new file mode 100644 index 0000000..4fec92b --- /dev/null +++ b/xslt/Makefile.am @@ -0,0 +1,2 @@ +kbibtex_xslt_DATA = html.xsl MARC21slim2MODS3.xsl MARC21slimUtils.xsl UNIMARC2MODS3.xsl +kbibtex_xsltdir = $(kde_datadir)/kbibtexpart/xslt diff --git a/xslt/Makefile.in b/xslt/Makefile.in new file mode 100644 index 0000000..f1bc492 --- /dev/null +++ b/xslt/Makefile.in @@ -0,0 +1,589 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# KDE tags expanded automatically by am_edit - $Revision: 483858 $ +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = xslt +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(kbibtex_xsltdir)" +kbibtex_xsltDATA_INSTALL = $(INSTALL_DATA) +DATA = $(kbibtex_xslt_DATA) +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 1 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ARTSCCONFIG = @ARTSCCONFIG@ +AUTOCONF = @AUTOCONF@ +AUTODIRS = @AUTODIRS@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DCOPIDL = @DCOPIDL@ +DCOPIDL2CPP = @DCOPIDL2CPP@ +DCOPIDLNG = @DCOPIDLNG@ +DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FRAMEWORK_COREAUDIO = @FRAMEWORK_COREAUDIO@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KCFG_DEPENDENCIES = @KCFG_DEPENDENCIES@ +KCONFIG_COMPILER = @KCONFIG_COMPILER@ +KDECONFIG = @KDECONFIG@ +KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@ +KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@ +KDE_INCLUDES = @KDE_INCLUDES@ +KDE_LDFLAGS = @KDE_LDFLAGS@ +KDE_MT_LDFLAGS = @KDE_MT_LDFLAGS@ +KDE_MT_LIBS = @KDE_MT_LIBS@ +KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_RPATH = @KDE_RPATH@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_USE_FPIE = @KDE_USE_FPIE@ +KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@ +KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@ +KDE_USE_PIE = @KDE_USE_PIE@ +KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@ +LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@ +LIBCOMPAT = @LIBCOMPAT@ +LIBCRYPT = @LIBCRYPT@ +LIBDL = @LIBDL@ +LIBJPEG = @LIBJPEG@ +LIBOBJS = @LIBOBJS@ +LIBPNG = @LIBPNG@ +LIBPTHREAD = @LIBPTHREAD@ +LIBRESOLV = @LIBRESOLV@ +LIBS = @LIBS@ +LIBSM = @LIBSM@ +LIBSOCKET = @LIBSOCKET@ +LIBTOOL = @LIBTOOL@ +LIBUCB = @LIBUCB@ +LIBUTIL = @LIBUTIL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIBXSLT_CFLAGS = @LIBXSLT_CFLAGS@ +LIBXSLT_LIBS = @LIBXSLT_LIBS@ +LIBYAZ_CFLAGS = @LIBYAZ_CFLAGS@ +LIBYAZ_LIBS = @LIBYAZ_LIBS@ +LIBYAZ_RPATH = @LIBYAZ_RPATH@ +LIBZ = @LIBZ@ +LIB_KAB = @LIB_KAB@ +LIB_KABC = @LIB_KABC@ +LIB_KDECORE = @LIB_KDECORE@ +LIB_KDED = @LIB_KDED@ +LIB_KDEPIM = @LIB_KDEPIM@ +LIB_KDEPRINT = @LIB_KDEPRINT@ +LIB_KDEUI = @LIB_KDEUI@ +LIB_KDNSSD = @LIB_KDNSSD@ +LIB_KFILE = @LIB_KFILE@ +LIB_KFM = @LIB_KFM@ +LIB_KHTML = @LIB_KHTML@ +LIB_KIMPROXY = @LIB_KIMPROXY@ +LIB_KIO = @LIB_KIO@ +LIB_KJS = @LIB_KJS@ +LIB_KNEWSTUFF = @LIB_KNEWSTUFF@ +LIB_KPARTS = @LIB_KPARTS@ +LIB_KSPELL = @LIB_KSPELL@ +LIB_KSYCOCA = @LIB_KSYCOCA@ +LIB_KUNITTEST = @LIB_KUNITTEST@ +LIB_KUTILS = @LIB_KUTILS@ +LIB_POLL = @LIB_POLL@ +LIB_QPE = @LIB_QPE@ +LIB_QT = @LIB_QT@ +LIB_SMB = @LIB_SMB@ +LIB_X11 = @LIB_X11@ +LIB_XEXT = @LIB_XEXT@ +LIB_XRENDER = @LIB_XRENDER@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKEKDEWIDGETS = @MAKEKDEWIDGETS@ +MCOPIDL = @MCOPIDL@ +MEINPROC = @MEINPROC@ +MOC = @MOC@ +MSGFMT = @MSGFMT@ +NOOPT_CFLAGS = @NOOPT_CFLAGS@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +QTE_NORTTI = @QTE_NORTTI@ +QT_INCLUDES = @QT_INCLUDES@ +QT_LDFLAGS = @QT_LDFLAGS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +UIC = @UIC@ +UIC_TR = @UIC_TR@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +USE_THREADS = @USE_THREADS@ +VERSION = @VERSION@ +WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@ +XGETTEXT = @XGETTEXT@ +XMKMF = @XMKMF@ +XMLLINT = @XMLLINT@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_INCLUDES = @X_INCLUDES@ +X_LDFLAGS = @X_LDFLAGS@ +X_PRE_LIBS = @X_PRE_LIBS@ +X_RPATH = @X_RPATH@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +include_ARTS_FALSE = @include_ARTS_FALSE@ +include_ARTS_TRUE = @include_ARTS_TRUE@ +include_x11_FALSE = @include_x11_FALSE@ +include_x11_TRUE = @include_x11_TRUE@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +kde_appsdir = @kde_appsdir@ +kde_bindir = @kde_bindir@ +kde_confdir = @kde_confdir@ +kde_datadir = @kde_datadir@ +kde_htmldir = @kde_htmldir@ +kde_icondir = @kde_icondir@ +kde_includes = @kde_includes@ +kde_kcfgdir = @kde_kcfgdir@ +kde_libraries = @kde_libraries@ +kde_libs_htmldir = @kde_libs_htmldir@ +kde_libs_prefix = @kde_libs_prefix@ +kde_locale = @kde_locale@ +kde_mimedir = @kde_mimedir@ +kde_moduledir = @kde_moduledir@ +kde_qtver = @kde_qtver@ +kde_servicesdir = @kde_servicesdir@ +kde_servicetypesdir = @kde_servicetypesdir@ +kde_sounddir = @kde_sounddir@ +kde_styledir = @kde_styledir@ +kde_templatesdir = @kde_templatesdir@ +kde_wallpaperdir = @kde_wallpaperdir@ +kde_widgetdir = @kde_widgetdir@ +kdeinitdir = @kdeinitdir@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +qt_includes = @qt_includes@ +qt_libraries = @qt_libraries@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@ +unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@ +x_includes = @x_includes@ +x_libraries = @x_libraries@ +xdg_appsdir = @xdg_appsdir@ +xdg_directorydir = @xdg_directorydir@ +xdg_menudir = @xdg_menudir@ +kbibtex_xslt_DATA = html.xsl MARC21slim2MODS3.xsl MARC21slimUtils.xsl UNIMARC2MODS3.xsl +kbibtex_xsltdir = $(kde_datadir)/kbibtexpart/xslt +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +#>- @for dep in $?; do \ +#>- case '$(am__configure_deps)' in \ +#>- *$$dep*) \ +#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ +#>- && exit 0; \ +#>- exit 1;; \ +#>- esac; \ +#>- done; \ +#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xslt/Makefile'; \ +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu xslt/Makefile +#>+ 12 + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xslt/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu xslt/Makefile + cd $(top_srcdir) && perl admin/am_edit xslt/Makefile.in +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-kbibtex_xsltDATA: $(kbibtex_xslt_DATA) + @$(NORMAL_INSTALL) + test -z "$(kbibtex_xsltdir)" || $(mkdir_p) "$(DESTDIR)$(kbibtex_xsltdir)" + @list='$(kbibtex_xslt_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(kbibtex_xsltDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(kbibtex_xsltdir)/$$f'"; \ + $(kbibtex_xsltDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(kbibtex_xsltdir)/$$f"; \ + done + +uninstall-kbibtex_xsltDATA: + @$(NORMAL_UNINSTALL) + @list='$(kbibtex_xslt_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(kbibtex_xsltdir)/$$f'"; \ + rm -f "$(DESTDIR)$(kbibtex_xsltdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(kbibtex_xsltdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +#>- clean-am: clean-generic clean-libtool mostlyclean-am +#>+ 1 +clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-kbibtex_xsltDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-kbibtex_xsltDATA + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-kbibtex_xsltDATA \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-kbibtex_xsltDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +KDE_DIST=MARC21slim2MODS3.xsl Makefile.in UNIMARC2MODS3.xsl html.xsl MARC21slimUtils.xsl Makefile.am + +#>+ 2 +docs-am: + +#>+ 15 +force-reedit: + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xslt/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu xslt/Makefile + cd $(top_srcdir) && perl admin/am_edit xslt/Makefile.in + + +#>+ 21 +clean-bcheck: + rm -f *.bchecktest.cc *.bchecktest.cc.class a.out + +bcheck: bcheck-am + +bcheck-am: + @for i in ; do \ + if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \ + echo "int main() {return 0;}" > $$i.bchecktest.cc ; \ + echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \ + echo "$$i"; \ + if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \ + rm -f $$i.bchecktest.cc; exit 1; \ + fi ; \ + echo "" >> $$i.bchecktest.cc.class; \ + perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \ + rm -f a.out; \ + fi ; \ + done + + +#>+ 3 +final: + $(MAKE) all-am + +#>+ 3 +final-install: + $(MAKE) install-am + +#>+ 3 +no-final: + $(MAKE) all-am + +#>+ 3 +no-final-install: + $(MAKE) install-am + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo + +#>+ 3 +nmcheck: +nmcheck-am: nmcheck diff --git a/xslt/UNIMARC2MODS3.xsl b/xslt/UNIMARC2MODS3.xsl new file mode 100644 index 0000000..af008cb --- /dev/null +++ b/xslt/UNIMARC2MODS3.xsl @@ -0,0 +1,2920 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink marc">
+ <xsl:include href="MARC21slimUtils.xsl"/>
+ <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
+
+<!-- This file is in the public domain. -->
+
+<!--
+
+Revised version of MARC21slim2MODS3.xsl from Library of Congress
+with input from Yves Pratter's version of UNIMARC2MODS.xsl
+
+-->
+ <xsl:template match="/">
+ <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-1.xsd">
+ <xsl:for-each select=".//marc:record">
+ <mods version="3.1">
+ <xsl:call-template name="marcRecord"/>
+ </mods>
+ </xsl:for-each>
+ </modsCollection>
+ </xsl:template>
+
+ <xsl:template name="marcRecord">
+ <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:variable name="typeOf008">
+ <xsl:choose>
+ <xsl:when test="$leader6='a'">
+ <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' or $leader7='s'">SE</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$leader6='t'">BK</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' or $leader6='r'">VM</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- MARC21 tag 245 - TITLE STATEMENT -->
+ <xsl:for-each select="marc:datafield[@tag=200]">
+ <titleInfo>
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='e']">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">e</xsl:with-param>
+ <xsl:with-param name="beforeCodes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ae</xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="$title"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:when test="contains($title,'ˆ') and contains($title,'‰')">
+ <nonSort>
+ <xsl:value-of select="substring(substring-before($title,'‰'),2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring-after($title,'‰')"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop"/>
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="marc:subfield[@code='e']">
+ <subTitle>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">e</xsl:with-param>
+ <xsl:with-param name="anyCodes">e</xsl:with-param>
+ <xsl:with-param name="afterCodes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </subTitle>
+ </xsl:if>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </xsl:for-each>
+
+ <!-- MARC21 - ABBREVIATED TITLE / tag 210 ab -->
+ <xsl:for-each select="marc:datafield[@tag=531]">
+ <titleInfo type="abbreviated">
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="subtitle"/>
+ </titleInfo>
+ </xsl:for-each>
+
+ <!-- MARC21 - translated title / 242 -->
+ <xsl:for-each select="marc:datafield[@tag=541]">
+ <titleInfo type="translated">
+ <!-- 541/z is 242/y -->
+ <xsl:for-each select="marc:subfield[@code='z']">
+ <xsl:attribute name="lang">
+ <xsl:value-of select="text()"/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <title>
+
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ </title>
+
+
+ <!-- 1/04 fix -->
+ <xsl:call-template name="subtitle"/>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </xsl:for-each>
+
+ <!-- MARC21 - Expanded title / 246 -->
+ <xsl:for-each select="marc:datafield[@tag=532]|marc:datafield[@tag=540]">
+ <titleInfo type="alternative">
+ <xsl:for-each select="marc:subfield[@code='i']">
+ <xsl:attribute name="displayLabel">
+ <xsl:value-of select="text()"/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <!-- 1/04 removed $h, $b -->
+ <xsl:with-param name="codes">af</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="subtitle"/>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </xsl:for-each>
+
+ <!-- MARC21 - Expanded title / 130, 240, 730i2 -->
+ <xsl:for-each select="marc:datafield[@tag=500]">
+ <titleInfo type="uniform">
+ <title>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="(contains('anklmrtuv',@code) and (not(../marc:subfield[@code='h' or @code='s' or @code='i']) or (following-sibling::marc:subfield[@code='h' or @code='s' or @code='i'])))">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </xsl:for-each>
+
+ <!--
+ <xsl:for-each select="marc:datafield[@tag=740][@ind2!=2]">
+ <titleInfo type="alternative">
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ah</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 - creator / 100 -->
+ <xsl:for-each select="marc:datafield[@tag=700]">
+ <name type="personal">
+ <xsl:call-template name="nameABCDFG"/>
+ <xsl:call-template name="affiliation"/>
+ <role>
+ <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+ </role>
+ <xsl:call-template name="role"/>
+ </name>
+ </xsl:for-each>
+
+ <!-- MARC21 - creator / 110 and 111 -->
+ <xsl:for-each select="marc:datafield[@tag=710]">
+ <name>
+ <xsl:if test="@ind1=0">
+ <xsl:attribute name="type">
+ <xsl:text>corporate</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ind1=1">
+ <xsl:attribute name="type">
+ <xsl:text>conference</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="nameABCDEF"/>
+ <role>
+ <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+ </role>
+ <xsl:call-template name="role"/>
+ </name>
+ </xsl:for-each>
+
+ <!-- MARC21 - creator / 700 -->
+ <xsl:for-each select="marc:datafield[@tag=701 or @tag=702]">
+ <name type="personal">
+ <xsl:call-template name="nameABCDFG"/>
+ <xsl:call-template name="affiliation"/>
+ <xsl:call-template name="role"/>
+ </name>
+ </xsl:for-each>
+
+ <!-- MARC21 - creator / 710 and 711 -->
+ <xsl:for-each select="marc:datafield[@tag=711 or @tag=712]">
+ <name>
+ <xsl:if test="@ind1=0">
+ <xsl:attribute name="type">
+ <xsl:text>corporate</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ind1=1">
+ <xsl:attribute name="type">
+ <xsl:text>conference</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="nameABCDEF"/>
+ <xsl:call-template name="role"/>
+ </name>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=720][not(marc:subfield[@code='t'])]">
+ <name>
+ <xsl:if test="@ind1=1">
+ <xsl:attribute name="type">
+ <xsl:text>personal</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <namePart>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </namePart>
+ <xsl:call-template name="role"/>
+ </name>
+ </xsl:for-each>
+-->
+
+ <typeOfResource>
+ <xsl:if test="$leader7='c'">
+ <xsl:attribute name="collection">yes</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
+ <xsl:attribute name="manuscript">yes</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$leader6='a' or $leader6='b' or $leader6='h' 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'">sound recording-nonmusical</xsl:when>
+ <xsl:when test="$leader6='j'">sound recording-musical</xsl:when>
+ <xsl:when test="$leader6='k'">still image</xsl:when>
+ <xsl:when test="$leader6='g'">moving image</xsl:when>
+ <xsl:when test="$leader6='n'">three dimensional object</xsl:when>
+ <xsl:when test="$leader6='l'">software, multimedia</xsl:when>
+ <xsl:when test="$leader6='p'">mixed material</xsl:when>
+ </xsl:choose>
+ </typeOfResource>
+
+ <!-- MARC21 controlField008 -->
+ <xsl:if test="substring(marc:field[@tag=124],26,1)='d'">
+ <genre authority="marc">globe</genre>
+ </xsl:if>
+
+ <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
+ <genre authority="marc">remote sensing image</genre>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='MP'">
+ <xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
+ <genre authority="marc">map</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
+ <genre authority="marc">atlas</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='SE'">
+ <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-21='d'">
+ <genre authority="marc">database</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-21='l'">
+ <genre authority="marc">loose-leaf</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-21='m'">
+ <genre authority="marc">series</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-21='n'">
+ <genre authority="marc">newspaper</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-21='p'">
+ <genre authority="marc">periodical</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-21='w'">
+ <genre authority="marc">web site</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='BK' or $typeOf008='SE'">
+ <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
+ <xsl:choose>
+ <xsl:when test="contains($controlField008-24,'a')">
+ <genre authority="marc">abstract or summary</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'b')">
+ <genre authority="marc">bibliography</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'c')">
+ <genre authority="marc">catalog</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'d')">
+ <genre authority="marc">dictionary</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'e')">
+ <genre authority="marc">encyclopedia</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'f')">
+ <genre authority="marc">handbook</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'g')">
+ <genre authority="marc">legal article</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'i')">
+ <genre authority="marc">index</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'k')">
+ <genre authority="marc">discography</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'l')">
+ <genre authority="marc">legislation</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'m')">
+ <genre authority="marc">theses</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'n')">
+ <genre authority="marc">survey of literature</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'o')">
+ <genre authority="marc">review</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'p')">
+ <genre authority="marc">programmed text</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'q')">
+ <genre authority="marc">filmography</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'r')">
+ <genre authority="marc">directory</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'s')">
+ <genre authority="marc">statistics</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'t')">
+ <genre authority="marc">technical report</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'v')">
+ <genre authority="marc">legal case and case notes</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'w')">
+ <genre authority="marc">law report or digest</genre>
+ </xsl:when>
+ <xsl:when test="contains($controlField008-24,'z')">
+ <genre authority="marc">treaty</genre>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-29='1'">
+ <genre authority="marc">conference publication</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='CF'">
+ <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-26='a'">
+ <genre authority="marc">numeric data</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-26='e'">
+ <genre authority="marc">database</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-26='f'">
+ <genre authority="marc">font</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-26='g'">
+ <genre authority="marc">game</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='BK'">
+ <xsl:if test="substring($controlField008,25,1)='j'">
+ <genre authority="marc">patent</genre>
+ </xsl:if>
+ <xsl:if test="substring($controlField008,31,1)='1'">
+ <genre authority="marc">festschrift</genre>
+ </xsl:if>
+
+ <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
+ <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
+ <genre authority="marc">biography</genre>
+ </xsl:if>
+
+ <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-33='e'">
+ <genre authority="marc">essay</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='d'">
+ <genre authority="marc">drama</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='c'">
+ <genre authority="marc">comic strip</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='l'">
+ <genre authority="marc">fiction</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='h'">
+ <genre authority="marc">humor, satire</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='i'">
+ <genre authority="marc">letter</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='f'">
+ <genre authority="marc">novel</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='j'">
+ <genre authority="marc">short story</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='s'">
+ <genre authority="marc">speech</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='MU'">
+ <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
+ <xsl:if test="contains($controlField008-30-31,'b')">
+ <genre authority="marc">biography</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'c')">
+ <genre authority="marc">conference publication</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'d')">
+ <genre authority="marc">drama</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'e')">
+ <genre authority="marc">essay</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'f')">
+ <genre authority="marc">fiction</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'o')">
+ <genre authority="marc">folktale</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'h')">
+ <genre authority="marc">history</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'k')">
+ <genre authority="marc">humor, satire</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'m')">
+ <genre authority="marc">memoir</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'p')">
+ <genre authority="marc">poetry</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'r')">
+ <genre authority="marc">rehearsal</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'g')">
+ <genre authority="marc">reporting</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'s')">
+ <genre authority="marc">sound</genre>
+ </xsl:if>
+ <xsl:if test="contains($controlField008-30-31,'l')">
+ <genre authority="marc">speech</genre>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$typeOf008='VM'">
+ <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
+ <xsl:choose>
+ <xsl:when test="$controlField008-33='a'">
+ <genre authority="marc">art original</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='b'">
+ <genre authority="marc">kit</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='c'">
+ <genre authority="marc">art reproduction</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='d'">
+ <genre authority="marc">diorama</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='f'">
+ <genre authority="marc">filmstrip</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='g'">
+ <genre authority="marc">legal article</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='i'">
+ <genre authority="marc">picture</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='k'">
+ <genre authority="marc">graphic</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='l'">
+ <genre authority="marc">technical drawing</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='m'">
+ <genre authority="marc">motion picture</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='n'">
+ <genre authority="marc">chart</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='o'">
+ <genre authority="marc">flash card</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='p'">
+ <genre authority="marc">microscope slide</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
+ <genre authority="marc">model</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='r'">
+ <genre authority="marc">realia</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='s'">
+ <genre authority="marc">slide</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='t'">
+ <genre authority="marc">transparency</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='v'">
+ <genre authority="marc">videorecording</genre>
+ </xsl:when>
+ <xsl:when test="$controlField008-33='w'">
+ <genre authority="marc">toy</genre>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:for-each select="marc:datafield[@tag=655]">
+ <genre authority="marc">
+ <xsl:attribute name="authority">
+ <xsl:value-of select="marc:subfield[@code='2']"/>
+ </xsl:attribute>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abvxyz</xsl:with-param>
+ <xsl:with-param name="delimeter">-</xsl:with-param>
+ </xsl:call-template>
+ </genre>
+ </xsl:for-each>
+
+ <originInfo>
+ <xsl:variable name="MARCpublicationCode" select="normalize-space(substring($controlField008,16,3))"/>
+
+ <xsl:if test="translate($MARCpublicationCode,'|','')">
+ <place>
+ <placeTerm>
+ <xsl:attribute name="type">code</xsl:attribute>
+ <xsl:attribute name="authority">marccountry</xsl:attribute>
+ <xsl:value-of select="$MARCpublicationCode"/>
+ </placeTerm>
+ </place>
+ </xsl:if>
+
+ <!-- MARC21 44a -->
+ <xsl:for-each select="marc:datafield[@tag=102]/marc:subfield[@code='a']">
+ <place>
+ <placeTerm>
+ <xsl:attribute name="type">code</xsl:attribute>
+ <xsl:attribute name="authority">iso3166</xsl:attribute>
+ <xsl:value-of select="."/>
+ </placeTerm>
+ </place>
+ </xsl:for-each>
+
+ <!-- MARC21 260a -->
+ <xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='a']">
+ <place>
+ <placeTerm>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:call-template name="chopPunctuationFront">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ <xsl:with-param name="chopString" select="../marc:subfield[@code='a']"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </placeTerm>
+ </place>
+ </xsl:for-each>
+
+ <!-- Unknown -->
+ <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']">
+ <dateValid point="start">
+ <xsl:value-of select="."/>
+ </dateValid>
+ </xsl:for-each>
+ <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']">
+ <dateValid point="end">
+ <xsl:value-of select="."/>
+ </dateValid>
+ </xsl:for-each>
+ <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']">
+ <dateModified>
+ <xsl:value-of select="."/>
+ </dateModified>
+ </xsl:for-each>
+
+ <!-- MARC21 260bcg -->
+ <xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='c' or @code='d' or @code='h']">
+ <xsl:choose>
+ <xsl:when test="@code='c'">
+ <publisher>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ <xsl:with-param name="punctuation">
+ <xsl:text>:,;/ </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </publisher>
+ </xsl:when>
+ <xsl:when test="@code='d'">
+ <dateIssued>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="chopPunctuationFront">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="punctuation"> <!-- add closing bracket -->
+ <xsl:text>:,;/] </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </dateIssued>
+ </xsl:when>
+ <xsl:when test="@code='h'">
+ <dateCreated>
+ <xsl:value-of select="."/>
+ </dateCreated>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+
+ <!-- Unknown
+ <xsl:variable name="dataField260d">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="marc:datafield[@tag=260]/marc:subfield[@code='d']"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="controlField008-7-10" select="normalize-space(substring($controlField008, 8, 4))"/>
+ <xsl:variable name="controlField008-11-14" select="normalize-space(substring($controlField008, 12, 4))"/>
+ <xsl:variable name="controlField008-6" select="normalize-space(substring($controlField008, 7, 1))"/>
+
+ <xsl:if test="$controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='t' or $controlField008-6='s'">
+ <xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260d)">
+ <dateIssued encoding="marc">
+ <xsl:value-of select="$controlField008-7-10"/>
+ </dateIssued>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+ <xsl:if test="$controlField008-7-10">
+ <dateIssued encoding="marc" point="start">
+ <xsl:value-of select="$controlField008-7-10"/>
+ </dateIssued>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+ <xsl:if test="$controlField008-11-14">
+ <dateIssued encoding="marc" point="end">
+ <xsl:value-of select="$controlField008-11-14"/>
+ </dateIssued>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$controlField008-6='q'">
+ <xsl:if test="$controlField008-7-10">
+ <dateIssued encoding="marc" point="start" qualifier="questionable">
+ <xsl:value-of select="$controlField008-7-10"/>
+ </dateIssued>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$controlField008-6='q'">
+ <xsl:if test="$controlField008-11-14">
+ <dateIssued encoding="marc" point="end" qualifier="questionable">
+ <xsl:value-of select="$controlField008-11-14"/>
+ </dateIssued>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="$controlField008-6='t'">
+ <xsl:if test="$controlField008-11-14">
+ <copyrightDate encoding="marc">
+ <xsl:value-of select="$controlField008-11-14"/>
+ </copyrightDate>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:for-each select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']">
+ <dateCaptured encoding="iso8601">
+ <xsl:value-of select="."/>
+ </dateCaptured>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]">
+ <dateCaptured encoding="iso8601" point="start">
+ <xsl:value-of select="."/>
+ </dateCaptured>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]">
+ <dateCaptured encoding="iso8601" point="end">
+ <xsl:value-of select="."/>
+ </dateCaptured>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 250a -->
+ <xsl:for-each select="marc:datafield[@tag=205]/marc:subfield[@code='a']">
+ <edition>
+ <xsl:value-of select="."/>
+ </edition>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:leader">
+ <issuance>
+ <xsl:choose>
+ <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">monographic</xsl:when>
+ <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">continuing</xsl:when>
+ </xsl:choose>
+ </issuance>
+ </xsl:for-each>
+
+ <!-- MARC21 310 and 321 -->
+ <xsl:for-each select="marc:datafield[@tag=326]">
+ <frequency>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </frequency>
+ </xsl:for-each>
+ </originInfo>
+
+ <xsl:for-each select="marc:datafield[@tag=101]">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <language>
+ <languageTerm authority="iso639-2b" type="code">
+ <xsl:value-of select="text()"/>
+ </languageTerm>
+ </language>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:variable name="controlField008-35-37" select="normalize-space(translate(substring($controlField008,36,3),'|#',''))"/>
+ <xsl:if test="$controlField008-35-37">
+ <language>
+ <languageTerm authority="iso639-2b" type="code">
+ <xsl:value-of select="substring($controlField008,36,3)"/>
+ </languageTerm>
+ </language>
+ </xsl:if>
+
+ <xsl:for-each select="marc:datafield[@tag=041]">
+
+ <!-- <xsl:variable name="langCodes">
+ <xsl:copy-of select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
+ </xsl:variable>
+ -->
+ <xsl:variable name="langCodes" select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
+
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='2']='rfc3066'">
+ <!-- not stacked but could be repeated -->
+ <xsl:call-template name="rfcLanguages">
+ <xsl:with-param name="nodeNum">
+ <xsl:value-of select="1"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:text></xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="controlField008-35-37">
+ <xsl:value-of select="$controlField008-35-37"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- iso -->
+ <xsl:variable name="allLanguages">
+ <xsl:copy-of select="$langCodes"/>
+ </xsl:variable>
+ <xsl:variable name="currentLanguage">
+ <xsl:value-of select="substring($allLanguages,1,3)"/>
+ </xsl:variable>
+ <xsl:call-template name="isoLanguage">
+ <xsl:with-param name="currentLanguage">
+ <xsl:value-of select="substring($allLanguages,1,3)"/>
+ </xsl:with-param>
+ <xsl:with-param name="remainingLanguages">
+ <xsl:value-of select="substring($allLanguages,4,string-length($allLanguages)-3)"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:if test="$controlField008-35-37">
+ <xsl:value-of select="$controlField008-35-37"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+
+ <xsl:variable name="physicalDescription">
+ <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a' or substring(.,12,1)='b']">
+ <digitalOrigin>reformatted digital</digitalOrigin>
+ </xsl:if>
+
+ <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
+ <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
+
+ <xsl:variable name="check008-23">
+ <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='SE' or $typeOf008='MM'">
+ <xsl:value-of select="true()"/>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:variable name="check008-29">
+ <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
+ <xsl:value-of select="true()"/>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
+ <form authority="marcform">braille</form>
+ </xsl:when>
+ <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='SE') and ($controlField008-23=' ' or $controlField008='r'))">
+ <form authority="marcform">print</form>
+ </xsl:when>
+ <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
+ <form authority="marcform">electronic</form>
+ </xsl:when>
+ <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
+ <form authority="marcform">microfiche</form>
+ </xsl:when>
+ <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
+ <form authority="marcform">microfilm</form>
+ </xsl:when>
+ </xsl:choose>
+<!--
+ <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+
+ <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
+ <form authority="gmd">
+ <xsl:call-template name="chopBrackets">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </form>
+ </xsl:if>
+ <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
+ <form>
+ <xsl:value-of select="."/>
+ </form>
+ </xsl:for-each>
+-->
+ <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
+ <xsl:choose>
+ <xsl:when test="substring(text(),14,1)='a'">
+ <reformattingQuality>access</reformattingQuality>
+ </xsl:when>
+ <xsl:when test="substring(text(),14,1)='p'">
+ <reformattingQuality>preservation</reformattingQuality>
+ </xsl:when>
+ <xsl:when test="substring(text(),14,1)='r'">
+ <reformattingQuality>replacement</reformattingQuality>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
+ <internetMediaType>
+ <xsl:value-of select="."/>
+ </internetMediaType>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 300 - PHYSICAL DESCRIPTION (R) subfields abce-->
+ <xsl:for-each select="marc:datafield[@tag=215]">
+ <extent>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">acde</xsl:with-param>
+ </xsl:call-template>
+ </extent>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="string-length(normalize-space($physicalDescription))">
+ <physicalDescription>
+ <xsl:copy-of select="$physicalDescription"/>
+ </physicalDescription>
+ </xsl:if>
+
+ <!-- MARC21 tag 520 -->
+ <xsl:for-each select="marc:datafield[@tag=330]">
+ <abstract>
+ <xsl:call-template name="uri"/>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </abstract>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 505 -->
+ <xsl:for-each select="marc:datafield[@tag=327]">
+ <tableOfContents>
+ <xsl:call-template name="uri"/>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">agrt</xsl:with-param>
+ </xsl:call-template>
+ </tableOfContents>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 521 -->
+ <xsl:for-each select="marc:datafield[@tag=333]">
+ <targetAudience>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </targetAudience>
+ </xsl:for-each>
+
+ <xsl:if test="$typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM'">
+ <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
+ <xsl:choose>
+ <!-- 01/04 fix -->
+ <xsl:when test="$controlField008-22='d'">
+ <targetAudience authority="marctarget">adolescent</targetAudience>
+ </xsl:when>
+ <xsl:when test="$controlField008-22='e'">
+ <targetAudience authority="marctarget">adult</targetAudience>
+ </xsl:when>
+ <xsl:when test="$controlField008-22='g'">
+ <targetAudience authority="marctarget">general</targetAudience>
+ </xsl:when>
+ <xsl:when test="$controlField008-22='b' or $controlField008-22='c' or $controlField008-22='j'">
+ <targetAudience authority="marctarget">juvenile</targetAudience>
+ </xsl:when>
+ <xsl:when test="$controlField008-22='a'">
+ <targetAudience authority="marctarget">preschool</targetAudience>
+ </xsl:when>
+ <xsl:when test="$controlField008-22='f'">
+ <targetAudience authority="marctarget">specialized</targetAudience>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+
+ <!-- MARC21 tag 245c -->
+ <xsl:for-each select="marc:datafield[@tag=200]/marc:subfield[@code='f' or @code='g']">
+ <note type="statement of responsibility">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="punctuation">
+ <xsl:text>.:,;/] </xsl:text> <!-- have to add the closing bracket -->
+ </xsl:with-param>
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="chopPunctuationFront">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </note>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 500 -->
+ <xsl:for-each select="marc:datafield[@tag > 299 and @tag < 316]">
+ <note>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ <xsl:call-template name="uri"/>
+ </note>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 511 -->
+ <xsl:for-each select="marc:datafield[@tag=323]">
+ <note type="performers">
+ <xsl:call-template name="uri"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </note>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=518]">
+ <note type="venue">
+ <xsl:call-template name="uri"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </note>
+ </xsl:for-each>
+
+
+ <xsl:for-each select="marc:datafield[@tag=501 or @tag=502 or @tag=504 or @tag=506 or @tag=507 or @tag=508 or @tag=513 or @tag=514 or @tag=515 or @tag=516 or @tag=522 or @tag=524 or @tag=525 or @tag=526 or @tag=530 or @tag=533 or @tag=534 or @tag=535 or @tag=536 or @tag=538 or @tag=540 or @tag=541 or @tag=544 or @tag=545 or @tag=546 or @tag=547 or @tag=550 or @tag=552 or @tag=555 or @tag=556 or @tag=561 or @tag=562 or @tag=565 or @tag=567 or @tag=580 or @tag=581 or @tag=583 or @tag=584 or @tag=585 or @tag=586]">
+ <note>
+ <xsl:call-template name="uri"/>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+ <xsl:value-of select="."/>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </note>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 tag 034 -->
+ <xsl:for-each select="marc:datafield[@tag=123][marc:subfield[@code='d' or @code='e' or @code='f' or @code='g']]">
+ <subject>
+ <cartographics>
+ <coordinates>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">defg</xsl:with-param>
+ </xsl:call-template>
+ </coordinates>
+ </cartographics>
+ </subject>
+ </xsl:for-each>
+
+ <!-- Unknown -->
+ <xsl:for-each select="marc:datafield[@tag=043]">
+ <subject>
+ <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
+ <geographicCode>
+ <xsl:attribute name="authority">
+ <xsl:if test="@code='a'">
+ <xsl:text>marcgac</xsl:text>
+ </xsl:if>
+ <xsl:if test="@code='b'">
+ <xsl:value-of select="following-sibling::marc:subfield[@code=2]"/>
+ </xsl:if>
+ <xsl:if test="@code='c'">
+ <xsl:text>iso3166</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:value-of select="self::marc:subfield"/>
+ </geographicCode>
+ </xsl:for-each>
+ </subject>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 255 -->
+ <!-- needs parsing -->
+<!--
+ <xsl:for-each select="marc:datafield[@tag=206]">
+ <subject>
+ <cartographics>
+ <xsl:for-each select="marc:subfield[@code='c']">
+ <coordinates>
+ <xsl:value-of select="."/>
+ </coordinates>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <scale>
+ <xsl:value-of select="."/>
+ </scale>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <projection>
+ <xsl:value-of select="."/>
+ </projection>
+ </xsl:for-each>
+ </cartographics>
+ </subject>
+ </xsl:for-each>
+-->
+
+ <xsl:apply-templates select="marc:datafield[653 >= @tag and @tag >= 600]"/>
+
+ <xsl:apply-templates select="marc:datafield[@tag=656]"/>
+
+ <!-- MARC21 tag 752 -->
+ <xsl:for-each select="marc:datafield[@tag=620]">
+ <subject>
+ <hierarchicalGeographic>
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <country>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </country>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <state>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </state>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='c']">
+ <county>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </county>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='d']">
+ <city>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </city>
+ </xsl:for-each>
+ </hierarchicalGeographic>
+ </subject>
+ </xsl:for-each>
+
+ <!-- MARC21 tag 045 -->
+ <xsl:for-each select="marc:datafield[@tag=122][marc:subfield[@code='a']]">
+ <subject>
+
+ <xsl:choose>
+
+ <xsl:when test="@ind1=2">
+
+ <temporal encoding="iso8601" point="start">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='a'][1]"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </temporal>
+ <temporal encoding="iso8601" point="end">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+
+
+ <xsl:value-of select="marc:subfield[@code='a'][2]"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </temporal>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <temporal encoding="iso8601">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </temporal>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </subject>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=050]">
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <classification authority="lcc">
+ <xsl:value-of select="preceding-sibling::marc:subfield[@code='a'][1]"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="text()"/>
+ </classification>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='a'][not(following-sibling::marc:subfield[@code='b'])]">
+ <classification authority="lcc">
+ <xsl:value-of select="text()"/>
+ </classification>
+ </xsl:for-each>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=082]">
+ <classification authority="ddc">
+ <xsl:if test="marc:subfield[@code='2']">
+ <xsl:attribute name="edition">
+ <xsl:value-of select="marc:subfield[@code='2']"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </classification>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=080]">
+ <classification authority="udc">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abx</xsl:with-param>
+ </xsl:call-template>
+ </classification>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=060]">
+ <classification authority="nlm">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </classification>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=086][@ind1=0]">
+ <classification authority="sudocs">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </classification>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=086][@ind1=1]">
+ <classification authority="candoc">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </classification>
+ </xsl:for-each>
+-->
+ <!-- MARC21 086a -->
+ <xsl:for-each select="marc:datafield[@tag=022]">
+ <classification>
+ <xsl:attribute name="authority">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </xsl:attribute>
+ <xsl:value-of select="marc:subfield[@code='b']"/>
+ </classification>
+ </xsl:for-each>
+
+ <!--
+ <xsl:for-each select="marc:datafield[@tag=084]">
+ <classification>
+ <xsl:attribute name="authority">
+ <xsl:value-of select="marc:subfield[@code='2']"/>
+ </xsl:attribute>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </classification>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=440]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">av</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </relatedItem>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 490/0 -->
+ <xsl:for-each select="marc:datafield[@tag=490]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adefhv</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ </relatedItem>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=510]">
+ <relatedItem type="isReferencedBy">
+ <note>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcx3</xsl:with-param>
+ </xsl:call-template>
+ </note>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=534]">
+ <relatedItem type="original">
+ <xsl:call-template name="relatedTitle"/>
+ <xsl:call-template name="relatedName"/>
+ <xsl:if test="marc:subfield[@code='b' or @code='c']">
+ <originInfo>
+ <xsl:for-each select="marc:subfield[@code='c']">
+ <publisher>
+ <xsl:value-of select="."/>
+ </publisher>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <edition>
+ <xsl:value-of select="."/>
+ </edition>
+ </xsl:for-each>
+ </originInfo>
+ </xsl:if>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ <xsl:for-each select="marc:subfield[@code='z']">
+ <identifier type="isbn">
+ <xsl:value-of select="."/>
+ </identifier>
+ </xsl:for-each>
+ <xsl:call-template name="relatedNote"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='t']]">
+ <relatedItem>
+ <xsl:call-template name="constituentOrRelatedType"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ <name type="personal">
+ <namePart>
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">aq</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="termsOfAddress"/>
+ <xsl:call-template name="nameDate"/>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=710][marc:subfield[@code='t']]">
+ <relatedItem>
+ <xsl:call-template name="constituentOrRelatedType"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">dg</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="relatedPartNumName"/>
+ </titleInfo>
+ <name type="corporate">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:variable name="tempNamePart">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">c</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($tempNamePart)">
+ <namePart>
+ <xsl:value-of select="$tempNamePart"/>
+ </namePart>
+ </xsl:if>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=711][marc:subfield[@code='t']]">
+ <relatedItem>
+ <xsl:call-template name="constituentOrRelatedType"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="relatedPartNumName"/>
+ </titleInfo>
+ <name type="conference">
+ <namePart>
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=730][@ind2=2]">
+ <relatedItem>
+ <xsl:call-template name="constituentOrRelatedType"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ <xsl:call-template name="relatedForm"/>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
+ <relatedItem>
+ <xsl:call-template name="constituentOrRelatedType"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ <xsl:call-template name="relatedForm"/>
+ </relatedItem>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 760 and 762 -->
+ <xsl:for-each select="marc:datafield[@tag=410]|marc:datafield[@tag=411]">
+ <relatedItem type="series">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 777 and 787 -->
+ <xsl:for-each select="marc:datafield[@tag=423]|marc:datafield[@tag=455]">
+ <relatedItem>
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 775 -->
+ <xsl:for-each select="marc:datafield[@tag=451]">
+ <relatedItem type="otherVersion">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 770 and 774 -->
+ <xsl:for-each select="marc:datafield[@tag=421]|marc:datafield[@tag=461]|marc:datafield[@tag=462]">
+ <relatedItem type="constituent">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 772 and 773 -->
+ <xsl:for-each select="marc:datafield[@tag=442]|marc:datafield[@tag=463]">
+ <relatedItem type="host">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 776 -->
+ <xsl:for-each select="marc:datafield[@tag=452]">
+ <relatedItem type="otherFormat">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 780 -->
+ <xsl:for-each select="marc:datafield[@tag > 429 and @tag < 438]">
+ <relatedItem type="preceding">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <!-- MARC21 785 -->
+ <xsl:for-each select="marc:datafield[@tag > 439 and @tag < 449]">
+ <relatedItem type="succeeding">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=786]">
+ <relatedItem type="original">
+ <xsl:call-template name="relatedItem76X-78X"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=800]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ <name type="personal">
+ <namePart>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">aq</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="termsOfAddress"/>
+ <xsl:call-template name="nameDate"/>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=810]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">dg</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="relatedPartNumName"/>
+ </titleInfo>
+ <name type="corporate">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <namePart>
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">c</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=811]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="afterCodes">g</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="relatedPartNumName"/>
+ </titleInfo>
+ <name type="conference">
+ <namePart>
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+ <xsl:with-param name="axis">t</xsl:with-param>
+ <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="relatedForm"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=830]">
+ <relatedItem type="series">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="part"/>
+ </titleInfo>
+ <xsl:call-template name="relatedForm"/>
+ </relatedItem>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=856][@ind2=2]/marc:subfield[@code='q']">
+ <relatedItem>
+ <internetMediaType>
+ <xsl:value-of select="."/>
+ </internetMediaType>
+ </relatedItem>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 020 -->
+ <xsl:for-each select="marc:datafield[@tag=010]">
+ <identifier type="isbn">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="translate(marc:subfield[@code='a'],'-','')"/>
+ </identifier>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=024][@ind1=0]">
+ <identifier type="isrc">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </identifier>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=024][@ind1=2]">
+ <identifier type="ismn">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </identifier>
+ </xsl:for-each>
+-->
+
+ <!-- MARC21 022 -->
+ <xsl:for-each select="marc:datafield[@tag=011]">
+ <identifier type="issn">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </identifier>
+ </xsl:for-each>
+<!--
+ <xsl:for-each select="marc:datafield[@tag=010]">
+ <identifier type="lccn">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
+ </identifier>
+ </xsl:for-each>
+-->
+ <!-- MARC21 028 -->
+ <xsl:for-each select="marc:datafield[@tag=071]">
+ <identifier>
+ <xsl:call-template name="isInvalid"/>
+ <xsl:attribute name="type">
+ <xsl:choose>
+ <xsl:when test="@ind1=0">issue number</xsl:when>
+ <xsl:when test="@ind1=1">matrix number</xsl:when>
+ <xsl:when test="@ind1=2">music plate</xsl:when>
+ <xsl:when test="@ind1=3">music publisher</xsl:when>
+ <xsl:when test="@ind1=4">videorecording identifier</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">
+ <xsl:choose>
+ <xsl:when test="@ind1=0">ba</xsl:when>
+ <xsl:otherwise>ab</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </identifier>
+ </xsl:for-each>
+
+<!--
+ <xsl:for-each select="marc:datafield[@tag=024][@ind1='4']">
+ <identifier type="sici">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </identifier>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=037]">
+ <identifier type="stock number">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ab</xsl:with-param>
+ </xsl:call-template>
+ </identifier>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]">
+ <identifier>
+ <xsl:attribute name="type">
+ <xsl:choose>
+ <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:doi') or starts-with(marc:subfield[@code='u'],'doi')">doi</xsl:when>
+ <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov')">hdl</xsl:when>
+ <xsl:otherwise>uri</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov') ">
+ <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="marc:subfield[@code='u']"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </identifier>
+ <xsl:if test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl')">
+ <identifier type="hdl">
+ <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']">
+ <xsl:attribute name="displayLabel">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3z</xsl:with-param>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/>
+ </identifier>
+ </xsl:if>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=024][@ind1=1]">
+ <identifier type="upc">
+ <xsl:call-template name="isInvalid"/>
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </identifier>
+ </xsl:for-each>
+ <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]">
+ <location>
+ <url>
+ <xsl:if test="marc:subfield[@code='y' or @code='3']">
+ <xsl:attribute name="displayLabel">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3</xsl:with-param>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="marc:subfield[@code='u']"/>
+ </url>
+ </location>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=852]">
+ <location>
+ <physicalLocation>
+ <xsl:call-template name="displayLabel"/>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abje</xsl:with-param>
+ </xsl:call-template>
+ </physicalLocation>
+ </location>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=506]">
+ <accessCondition type="restrictionOnAccess">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcd35</xsl:with-param>
+ </xsl:call-template>
+ </accessCondition>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=540]">
+ <accessCondition type="useAndReproduction">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcde35</xsl:with-param>
+ </xsl:call-template>
+ </accessCondition>
+ </xsl:for-each>
+-->
+ <recordInfo>
+<!--
+ <xsl:for-each select="marc:datafield[@tag=040]">
+ <recordContentSource authority="marcorg">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </recordContentSource>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:controlfield[@tag=008]">
+ <recordCreationDate encoding="marc">
+ <xsl:value-of select="substring(.,1,6)"/>
+ </recordCreationDate>
+ </xsl:for-each>
+-->
+
+ <xsl:for-each select="marc:controlfield[@tag=005]">
+ <recordChangeDate encoding="iso8601">
+ <xsl:value-of select="."/>
+ </recordChangeDate>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:controlfield[@tag=001]">
+ <recordIdentifier>
+ <xsl:if test="../marc:controlfield[@tag=003]">
+ <xsl:attribute name="source">
+ <xsl:value-of select="../marc:controlfield[@tag=003]"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </recordIdentifier>
+ </xsl:for-each>
+
+ <!-- needs to process tag 100 -->
+ <xsl:for-each select="marc:datafield[@tag=040]/marc:subfield[@code='b']">
+ <languageOfCataloging>
+ <languageTerm authority="iso639-2b" type="code">
+ <xsl:value-of select="."/>
+ </languageTerm>
+ </languageOfCataloging>
+ </xsl:for-each>
+ </recordInfo>
+ </xsl:template>
+
+ <xsl:template name="displayForm">
+ <xsl:for-each select="marc:subfield[@code='c']">
+ <displayForm>
+ <xsl:value-of select="."/>
+ </displayForm>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="affiliation">
+ <xsl:for-each select="marc:subfield[@code='p']">
+ <affiliation>
+ <xsl:value-of select="."/>
+ </affiliation>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="uri">
+ <xsl:for-each select="marc:subfield[@code='u']">
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="role">
+ <xsl:for-each select="marc:subfield[@code='e']">
+ <role>
+ <roleTerm type="text">
+ <xsl:value-of select="."/>
+ </roleTerm>
+ </role>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='4']">
+ <role>
+ <roleTerm authority="marcrelator" type="code">
+ <xsl:value-of select="."/>
+ </roleTerm>
+ </role>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="part">
+ <xsl:variable name="partNumber">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">h</xsl:with-param>
+ <xsl:with-param name="anyCodes">h</xsl:with-param>
+ <xsl:with-param name="afterCodes">bfgvz</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="partName">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">i</xsl:with-param>
+ <xsl:with-param name="anyCodes">i</xsl:with-param>
+ <xsl:with-param name="afterCodes">bfgvz</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length(normalize-space($partNumber))">
+ <partNumber>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partNumber"/>
+ </xsl:call-template>
+ </partNumber>
+ </xsl:if>
+ <xsl:if test="string-length(normalize-space($partName))">
+ <partName>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partName"/>
+ </xsl:call-template>
+ </partName>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="relatedPart">
+ <xsl:if test="@tag=773">
+ <xsl:for-each select="marc:subfield[@code='g']">
+ <part>
+ <text>
+ <xsl:value-of select="."/>
+ </text>
+ </part>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='q']">
+ <part>
+ <xsl:call-template name="parsePart"/>
+ </part>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="relatedPartNumName">
+ <xsl:variable name="partNumber">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">g</xsl:with-param>
+ <xsl:with-param name="anyCodes">g</xsl:with-param>
+ <xsl:with-param name="afterCodes">pst</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="partName">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">p</xsl:with-param>
+ <xsl:with-param name="anyCodes">p</xsl:with-param>
+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length(normalize-space($partNumber))">
+ <partNumber>
+ <xsl:value-of select="$partNumber"/>
+ </partNumber>
+ </xsl:if>
+ <xsl:if test="string-length(normalize-space($partName))">
+ <partName>
+ <xsl:value-of select="$partName"/>
+ </partName>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="relatedName">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <name>
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </name>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedForm">
+ <xsl:for-each select="marc:subfield[@code='h']">
+ <physicalDescription>
+ <form>
+ <xsl:value-of select="."/>
+ </form>
+ </physicalDescription>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedExtent">
+ <xsl:for-each select="marc:subfield[@code='h']">
+ <physicalDescription>
+ <extent>
+ <xsl:value-of select="."/>
+ </extent>
+ </physicalDescription>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedNote">
+ <xsl:for-each select="marc:subfield[@code='n']">
+ <note>
+ <xsl:value-of select="."/>
+ </note>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedSubject">
+ <xsl:for-each select="marc:subfield[@code='j']">
+ <subject>
+ <temporal encoding="iso8601">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </temporal>
+ </subject>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedIdentifierISSN">
+ <xsl:for-each select="marc:subfield[@code='x']">
+ <identifier type="issn">
+ <xsl:value-of select="."/>
+ </identifier>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedIdentifierISBN">
+ <xsl:for-each select="marc:subfield[@code='y']">
+ <identifier type="isbn">
+ <xsl:value-of select="."/>
+ </identifier>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedIdentifierLocal">
+ <xsl:for-each select="marc:subfield[@code='w']">
+ <identifier type="local">
+ <xsl:value-of select="."/>
+ </identifier>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedIdentifier">
+ <xsl:for-each select="marc:subfield[@code='o']">
+ <identifier>
+ <xsl:value-of select="."/>
+ </identifier>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedItem76X-78X">
+ <xsl:call-template name="displayLabel"/>
+ <xsl:call-template name="relatedTitle76X-78X"/>
+ <xsl:call-template name="relatedName"/>
+ <xsl:call-template name="relatedOriginInfo"/>
+ <xsl:call-template name="relatedLanguage"/>
+ <xsl:call-template name="relatedExtent"/>
+ <xsl:call-template name="relatedNote"/>
+ <xsl:call-template name="relatedSubject"/>
+ <xsl:call-template name="relatedIdentifier"/>
+ <xsl:call-template name="relatedIdentifierISSN"/>
+ <xsl:call-template name="relatedIdentifierISBN"/>
+ <xsl:call-template name="relatedIdentifierLocal"/>
+ <xsl:call-template name="relatedPart"/>
+ </xsl:template>
+
+ <xsl:template name="subjectGeographicZ">
+ <geographic>
+
+
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </geographic>
+ </xsl:template>
+
+ <xsl:template name="subjectTemporalY">
+ <temporal>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </temporal>
+ </xsl:template>
+
+ <xsl:template name="subjectTopic">
+ <topic>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </topic>
+ </xsl:template>
+
+ <xsl:template name="nameABCDN">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <namePart>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </namePart>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
+ <namePart>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">cdn</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="nameABCDQ">
+ <namePart>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">aq</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="punctuation">
+ <xsl:text>:,;/ </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="termsOfAddress"/>
+ <xsl:call-template name="nameDate"/>
+ </xsl:template>
+
+ <!-- added for unimarc -->
+ <xsl:template name="nameABCDFG">
+ <namePart>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abdg</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="punctuation">
+ <xsl:text>:,;/ </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="termsOfAddress"/>
+ <xsl:call-template name="nameDate"/>
+ </xsl:template>
+
+ <xsl:template name="nameACDEQ">
+ <namePart>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">acdeq</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </xsl:template>
+
+ <!-- added for unimarc -->
+ <xsl:template name="nameABCDEF">
+ <namePart>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcdef</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </xsl:template>
+
+ <xsl:template name="constituentOrRelatedType">
+ <xsl:if test="@ind2=2">
+ <xsl:attribute name="type">constituent</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="relatedTitle">
+ <xsl:for-each select="marc:subfield[@code='t']">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ </titleInfo>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedTitle76X-78X">
+ <xsl:for-each select="marc:subfield[@code='t']">
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+ <xsl:call-template name="relatedPartNumName"/>
+ </xsl:if>
+ </titleInfo>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='p']">
+ <titleInfo type="abbreviated">
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+ <xsl:call-template name="relatedPartNumName"/>
+ </xsl:if>
+ </titleInfo>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='s']">
+ <titleInfo type="uniform">
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </title>
+ <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+ <xsl:call-template name="relatedPartNumName"/>
+ </xsl:if>
+ </titleInfo>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="relatedOriginInfo">
+ <xsl:if test="marc:subfield[@code='b' or @code='d'] or marc:subfield[@code='f']">
+ <originInfo>
+ <xsl:if test="@tag=775">
+ <xsl:for-each select="marc:subfield[@code='f']">
+ <place>
+ <placeTerm>
+ <xsl:attribute name="type">code</xsl:attribute>
+ <xsl:attribute name="authority">marcgac</xsl:attribute>
+ <xsl:value-of select="."/>
+ </placeTerm>
+ </place>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="marc:subfield[@code='d']">
+ <publisher>
+ <xsl:value-of select="."/>
+ </publisher>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <edition>
+ <xsl:value-of select="."/>
+ </edition>
+ </xsl:for-each>
+ </originInfo>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="relatedLanguage">
+ <xsl:for-each select="marc:subfield[@code='e']">
+ <xsl:call-template name="getLanguage">
+ <xsl:with-param name="langString">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="nameDate">
+ <xsl:for-each select="marc:subfield[@code='f']">
+ <namePart type="date">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </namePart>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="subjectAuthority">
+
+ <xsl:if test="@ind2!=4">
+ <xsl:if test="@ind2!=' '">
+ <xsl:if test="@ind2!=8">
+ <xsl:if test="@ind2!=9">
+ <xsl:attribute name="authority">
+ <xsl:choose>
+
+ <xsl:when test="@ind2=0">lcsh</xsl:when>
+ <xsl:when test="@ind2=1">lcshac</xsl:when>
+ <xsl:when test="@ind2=2">mesh</xsl:when>
+ <!-- 1/04 fix -->
+ <xsl:when test="@ind2=3">nal</xsl:when>
+ <xsl:when test="@ind2=5">csh</xsl:when>
+ <xsl:when test="@ind2=6">rvm</xsl:when>
+ <xsl:when test="@ind2=7">
+ <xsl:value-of select="marc:subfield[@code='2']"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="subjectAnyOrder">
+ <xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
+ <xsl:choose>
+ <xsl:when test="@code='v'">
+ <xsl:call-template name="subjectTopic"/>
+ </xsl:when>
+ <xsl:when test="@code='x'">
+ <xsl:call-template name="subjectTopic"/>
+ </xsl:when>
+ <xsl:when test="@code='y'">
+ <xsl:call-template name="subjectTemporalY"/>
+ </xsl:when>
+ <xsl:when test="@code='z'">
+ <xsl:call-template name="subjectGeographicZ"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="specialSubfieldSelect">
+ <xsl:param name="anyCodes"/>
+ <xsl:param name="axis"/>
+ <xsl:param name="beforeCodes"/>
+ <xsl:param name="afterCodes"/>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:template>
+
+ <xsl:template match="marc:datafield[@tag=600 or @tag=602 or @Tag=604]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <name type="personal">
+ <xsl:call-template name="termsOfAddress"/>
+ <namePart>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:call-template name="nameDate"/>
+ <xsl:call-template name="affiliation"/>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 610 -->
+ <xsl:template match="marc:datafield[@tag=601 and @ind1=0]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <name type="corporate">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <namePart>
+ <xsl:value-of select="."/>
+ </namePart>
+ </xsl:for-each>
+ <xsl:if test="marc:subfield[@code='d' or @code='e' or @code='f']">
+ <namePart>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">def</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </xsl:if>
+ <xsl:call-template name="role"/>
+ </name>
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 611 -->
+ <xsl:template match="marc:datafield[@tag=601 and @ind1=01]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <name type="conference">
+ <namePart>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcdefghqnp</xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ <xsl:for-each select="marc:subfield[@code='4']">
+ <role>
+ <roleTerm authority="marcrelator" type="code">
+ <xsl:value-of select="."/>
+ </roleTerm>
+ </role>
+ </xsl:for-each>
+ </name>
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 630 -->
+ <xsl:template match="marc:datafield[@tag=605]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <titleInfo>
+ <title>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfkloqr</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="part"/>
+ </title>
+ </titleInfo>
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 650 -->
+ <xsl:template match="marc:datafield[@tag=606]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <topic>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcd</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </topic>
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 651 -->
+ <xsl:template match="marc:datafield[@tag=607]">
+ <subject>
+ <xsl:call-template name="subjectAuthority"/>
+ <xsl:for-each select="marc:subfield[@code='a']">
+
+ <geographic>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </geographic>
+ </xsl:for-each>
+
+ <xsl:call-template name="subjectAnyOrder"/>
+ </subject>
+ </xsl:template>
+
+ <!-- MARC21 field 610, empty ind2 -->
+ <xsl:template match="marc:datafield[@tag=610 and not(@ind2=0) and not(@ind2=1)]">
+ <subject>
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <topic>
+ <xsl:value-of select="."/>
+ </topic>
+ </xsl:for-each>
+ </subject>
+ </xsl:template>
+
+ <xsl:template match="marc:datafield[@tag=656]">
+ <subject>
+ <xsl:if test="marc:subfield[@code=2]">
+ <xsl:attribute name="authority">
+ <xsl:value-of select="marc:subfield[@code=2]"/>
+ </xsl:attribute>
+ </xsl:if>
+ <occupation>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </occupation>
+ </subject>
+ </xsl:template>
+
+ <xsl:template name="termsOfAddress">
+ <xsl:if test="marc:subfield[@code='c']">
+ <namePart type="termsOfAddress">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">c</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </namePart>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="displayLabel">
+ <xsl:if test="marc:subfield[@code='i']">
+ <xsl:attribute name="displayLabel">
+ <xsl:value-of select="marc:subfield[@code='i']"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="marc:subfield[@code='3']">
+ <xsl:attribute name="displayLabel">
+ <xsl:value-of select="marc:subfield[@code='3']"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="isInvalid">
+ <xsl:if test="marc:subfield[@code='z']">
+ <xsl:attribute name="invalid">yes</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="subtitle">
+ <xsl:if test="marc:subfield[@code='b']">
+ <subTitle>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='b']"/>
+
+ <!--<xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">b</xsl:with-param>
+ </xsl:call-template>-->
+ </xsl:with-param>
+ </xsl:call-template>
+ </subTitle>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="script">
+ <xsl:param name="scriptCode"/>
+ <xsl:attribute name="script">
+ <xsl:choose>
+ <xsl:when test="$scriptCode='(3'">Arabic</xsl:when>
+ <xsl:when test="$scriptCode='(B'">Latin</xsl:when>
+ <xsl:when test="$scriptCode='$1'">Chinese, Japanese, Korean</xsl:when>
+ <xsl:when test="$scriptCode='(N'">Cyrillic</xsl:when>
+ <xsl:when test="$scriptCode='(2'">Hebrew</xsl:when>
+ <xsl:when test="$scriptCode='(S'">Greek</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template name="parsePart">
+ <!-- assumes 773$q= 1:2:3<4
+ with up to 3 levels and one optional start page
+ -->
+ <xsl:variable name="level1">
+ <xsl:choose>
+ <xsl:when test="contains(text(),':')">
+ <!-- 1:2 -->
+ <xsl:value-of select="substring-before(text(),':')"/>
+ </xsl:when>
+ <xsl:when test="not(contains(text(),':'))">
+ <!-- 1 or 1<3 -->
+ <xsl:if test="contains(text(),'<')">
+ <!-- 1<3 -->
+ <xsl:value-of select="substring-before(text(),'<')"/>
+ </xsl:if>
+ <xsl:if test="not(contains(text(),'<'))">
+ <!-- 1 -->
+ <xsl:value-of select="text()"/>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sici2">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring-after(text(),$level1),':')">
+ <xsl:value-of select="substring(substring-after(text(),$level1),2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after(text(),$level1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="level2">
+ <xsl:choose>
+ <xsl:when test="contains($sici2,':')">
+ <!-- 2:3<4 -->
+ <xsl:value-of select="substring-before($sici2,':')"/>
+ </xsl:when>
+ <xsl:when test="contains($sici2,'<')">
+ <!-- 1: 2<4 -->
+ <xsl:value-of select="substring-before($sici2,'<')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$sici2"/>
+ <!-- 1:2 -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sici3">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring-after($sici2,$level2),':')">
+ <xsl:value-of select="substring(substring-after($sici2,$level2),2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($sici2,$level2)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="level3">
+ <xsl:choose>
+ <xsl:when test="contains($sici3,'<')">
+ <!-- 2<4 -->
+ <xsl:value-of select="substring-before($sici3,'<')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$sici3"/>
+ <!-- 3 -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="page">
+ <xsl:if test="contains(text(),'<')">
+ <xsl:value-of select="substring-after(text(),'<')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="$level1">
+ <detail level="1">
+ <number>
+ <xsl:value-of select="$level1"/>
+ </number>
+ </detail>
+ </xsl:if>
+ <xsl:if test="$level2">
+ <detail level="2">
+ <number>
+ <xsl:value-of select="$level2"/>
+ </number>
+ </detail>
+ </xsl:if>
+ <xsl:if test="$level3">
+ <detail level="3">
+ <number>
+ <xsl:value-of select="$level3"/>
+ </number>
+ </detail>
+ </xsl:if>
+ <xsl:if test="$page">
+ <extent unit="page">
+ <start>
+ <xsl:value-of select="$page"/>
+ </start>
+ </extent>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="getLanguage">
+ <xsl:param name="langString"/>
+ <xsl:param name="controlField008-35-37"/>
+ <xsl:variable name="length" select="string-length($langString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="$controlField008-35-37=substring($langString,1,3)">
+ <xsl:call-template name="getLanguage">
+ <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
+ <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <language>
+ <languageTerm authority="iso639-2b" type="code">
+ <xsl:value-of select="substring($langString,1,3)"/>
+ </languageTerm>
+ </language>
+ <xsl:call-template name="getLanguage">
+ <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
+ <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="isoLanguage">
+ <xsl:param name="currentLanguage"/>
+ <xsl:param name="usedLanguages"/>
+ <xsl:param name="remainingLanguages"/>
+ <xsl:choose>
+ <xsl:when test="string-length($currentLanguage)=0"/>
+ <xsl:when test="not(contains($usedLanguages, $currentLanguage))">
+ <language>
+ <languageTerm authority="iso639-2b" type="code">
+ <xsl:value-of select="$currentLanguage"/>
+ </languageTerm>
+ </language>
+ <xsl:call-template name="isoLanguage">
+ <xsl:with-param name="currentLanguage">
+ <xsl:value-of select="substring($remainingLanguages,1,3)"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
+ </xsl:with-param>
+ <xsl:with-param name="remainingLanguages">
+ <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="isoLanguage">
+ <xsl:with-param name="currentLanguage">
+ <xsl:value-of select="substring($remainingLanguages,1,3)"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
+ </xsl:with-param>
+ <xsl:with-param name="remainingLanguages">
+ <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="chopBrackets">
+ <xsl:param name="chopString"/>
+ <xsl:variable name="string">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$chopString"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="substring($string, 1,1)='['">
+ <xsl:value-of select="substring($string,2, string-length($string)-2)"/>
+ </xsl:if>
+ <xsl:if test="substring($string, 1,1)!='['">
+ <xsl:value-of select="$string"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="rfcLanguages">
+ <xsl:param name="nodeNum"/>
+ <xsl:param name="usedLanguages"/>
+ <xsl:param name="controlField008-35-37"/>
+ <!-- ??? xalan -->
+
+ <xsl:variable name="currentLanguage" select="marc:subfield[position()=$nodeNum]/text()"/>
+ <xsl:choose>
+ <xsl:when test="not($currentLanguage)"/>
+ <xsl:when test="$currentLanguage!=$controlField008-35-37 and $currentLanguage!='rfc3066'">
+ <xsl:if test="not(contains($usedLanguages,$currentLanguage))">
+ <language>
+ <languageTerm authority="rfc3066" type="code">
+ <xsl:value-of select="$currentLanguage"/>
+ </languageTerm>
+ </language>
+ </xsl:if>
+ <xsl:call-template name="rfcLanguages">
+ <!-- ??? xalan -->
+ <xsl:with-param name="nodeNum">
+ <xsl:value-of select="$nodeNum+1"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:value-of select="concat($usedLanguages,'|',$currentLanguage)"/>
+ </xsl:with-param>
+ <xsl:with-param name="controlField008-35-37">
+ <xsl:value-of select="$controlField008-35-37"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="rfcLanguages">
+ <xsl:with-param name="nodeNum">
+ <xsl:value-of select="$nodeNum+1"/>
+ </xsl:with-param>
+ <xsl:with-param name="usedLanguages">
+ <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
+ </xsl:with-param>
+ <xsl:with-param name="controlField008-35-37">
+ <xsl:value-of select="$controlField008-35-37"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- added for Tellico, don't print unrecognized datafields -->
+ <xsl:template match="marc:datafield">
+ </xsl:template>
+
+</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2003 Copyright Sonic Software Corporation. All rights reserved.
+<metaInformation>
+<scenarios ><scenario default="no" name="Apr 02 Test" userelativepaths="yes" externalpreview="no" url="file://n:\jackie\test_files\v3.xml" htmlbaseurl="" outputurl="file://n:\temp\x.xml" processortype="xalan" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="no" name="v3Test1" userelativepaths="yes" externalpreview="no" url="file://n:\jackie\test_files\v3.xml" htmlbaseurl="" outputurl="file://n:\jackie\test_files\modsv3Converted.xml" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="file://n:\ckeith\DESKTOP\test.xml" htmlbaseurl="" outputurl="" processortype="xalan" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="yes" name="Test" userelativepaths="yes" externalpreview="no" url="file://n:\jackie\MARCXML\marcxmlfile.xml" htmlbaseurl="" outputurl="" processortype="xalan" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
+</metaInformation>
+-->
diff --git a/xslt/html.xsl b/xslt/html.xsl new file mode 100644 index 0000000..7d29084 --- /dev/null +++ b/xslt/html.xsl @@ -0,0 +1,144 @@ +<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> +<xsl:output encoding="UTF-8"/> + +<xsl:template match="person"> +<xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="authors"> +<xsl:for-each select="person"> +<xsl:value-of select="."/> +<xsl:if test="position()!=last()"> +<xsl:text>, </xsl:text> +</xsl:if> +<xsl:if test="position()=last()-1"> +<xsl:text> and </xsl:text> +</xsl:if> +</xsl:for-each> +<xsl:text>: </xsl:text> +</xsl:template> + +<xsl:template match="editors"> +<xsl:text>Eds: </xsl:text> +<xsl:for-each select="person"> +<xsl:value-of select="."/> +<xsl:if test="position()!=last()"> +<xsl:text>, </xsl:text> +</xsl:if> +<xsl:if test="position()=last()-1"> +<xsl:text> and </xsl:text> +</xsl:if> +</xsl:for-each> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="title"> +<b><xsl:value-of select="."/></b> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="booktitle"> +<i><xsl:value-of select="."/></i> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="school"> +<xsl:value-of select="."/> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="journal"> +<i><xsl:value-of select="."/> +<xsl:if test="string-length(../volume)>0"> +<xsl:text> </xsl:text> +<xsl:value-of select="../volume"/> +<xsl:if test="string-length(../number)>0"> +<xsl:text>(</xsl:text> +<xsl:value-of select="../number"/> +<xsl:text>)</xsl:text> +</xsl:if> +</xsl:if> +</i> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="institution"> +<i><xsl:value-of select="."/></i> +<xsl:if test="string-length(../number)>0"> +<xsl:text> No. </xsl:text> +<xsl:value-of select="../number"/> +</xsl:if> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="publisher"> +<xsl:value-of select="."/> +<xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="volume"> +<xsl:if test="string-length(../journal)=0"> +<xsl:text>volume </xsl:text> +<xsl:value-of select="."/> +<xsl:text>, </xsl:text> +</xsl:if> +</xsl:template> + +<xsl:template match="edition"> +<xsl:value-of select="."/> +<xsl:text> edition, </xsl:text> +</xsl:template> + +<xsl:template match="pages"> +<xsl:value-of select="."/><xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="year"> +<xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="note"> +<xsl:text>, </xsl:text><xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="month"> +<xsl:value-of select="."/><xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="abstract"> +<br/><i>Abstract</i><xsl:text>: </xsl:text><xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="entry"> +<p> +<xsl:apply-templates select="authors" /> +<xsl:apply-templates select="title" /> +<xsl:apply-templates select="booktitle" /> +<xsl:apply-templates select="journal" /> +<xsl:apply-templates select="school" /> +<xsl:apply-templates select="volume" /> +<xsl:apply-templates select="edition" /> +<xsl:apply-templates select="publisher" /> +<xsl:apply-templates select="institution" /> +<xsl:apply-templates select="pages" /> +<xsl:apply-templates select="editors" /> +<xsl:apply-templates select="month" /> +<xsl:apply-templates select="year" /> +<xsl:apply-templates select="note" /> +<xsl:apply-templates select="abstract" /> +</p> +</xsl:template> + +<xsl:template match="bibliography"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<title>Bibliography</title> +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +</head> +<body> +<xsl:apply-templates select="entry" /> +</body> +</html> +</xsl:template> + +</xsl:stylesheet> |