Print

Print


Hello,
 
What value is used exactly for the <role> element ?
Relator terms or relator codes ?
 
The MARC21slim2MODS stylesheet use both MARC subfield e (term) and subfield 4 (code).
 
May be it's a good practice to use only one value (the term for example) ?
 
or may be both like this :
<role code="ill">Illustrator</code>
but also :
<role code="ill"/>
But for internationalisation purpose, why not do this :
 
<role code="ill" xml:lang="fre">Illustrateur</code>
<role code="ill" xml:lang="eng">Illustrator</code>
 
For UNIMARC2MODS.xsl, i use a "lookup table" to convert UNIMARC relator codes to MARC21 relator terms :
 
the lookup "table" : relators.xml

<?xml version="1.0" encoding="UTF-16"?>
<!--
    2002 Yves Pratter <
[log in to unmask]>
    Sources :
        MARC 21 Concise Format for BIBLIOGRAPHIC DATA : 2002 Concise Edition
       
http://www.loc.gov/marc/bibliographic/
        UNIMARC Manual : Bibliographic Format 1994
       
http://www.ifla.org/VI/3/p1996-1/sec-uni.htm
    Notes :
        uid : UNIMARC code
        mid : MARC21  code
        Relator value is the MARC21 relator
-->

<relators>
    <relator uid='005' mid='act'>Actor</relator>
    <relator uid='010' mid='adp'>Adapter</relator>
    <relator uid='020' mid='ann'>Annotator</relator>
    ...
    <relator           mid='wdc'>Woodcutter</relator>
    <relator uid='760' mid='wde'>Wood-engraver</relator>
    <relator uid='770' mid='wam'>Writer of accompanying material</relator>
</relators>

The xslt code to convert the unimarc relators :
 
 <xsl:template name="role">
  <xsl:choose>
   <xsl:when test="marc:subfield[@code='e']">
    <role><xsl:value-of select="marc:subfield[@code='e']"/></role>
   </xsl:when>
   <xsl:when test="marc:subfield[@code='4']">
   




    <!-- load the lookup table in variable $relators -->
    <xsl:variable name="relators" select="document('relators.xml')"/>
   

    <xsl:for-each select="marc:subfield[@code='4']">
   
    <!-- UNIMARC relator code to convert -->

     <xsl:variable name="code" select="text()"/>
     <role>
      <!-- get MARC21 relator term -->
      <xsl:value-of select="$relators//relator[@uid=$code]"/>
     </role>
    </xsl:for-each>
    <xsl:for-each select="$relators//relator[@id=marc:subfield[@code='4']/text()]">
     <role><xsl:value-of select="text()"/></role>
    </xsl:for-each>
   </xsl:when>
  </xsl:choose>
 </xsl:template>
Of course it's possible to use this code in MARC21slim2MODS.xsl to convert subfield $4 (MARC21 relator code) to MARC21 relator term.
Just select relator element with attribute mid :
<xsl:value-of select="$relators//relator[@mid=$code]"/>
What is your opinion ?
 
Yves