contributor role function

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

contributor role function

Bruce D'Arcus
I've not quite figured out how to get this working, but with respect to
the need to categorize different mods:name elements based on their
roles, I'm thinking of a function something like this:

   <xsl:function name="bib:contributor-role" as="xs:string">
     <xsl:param name="name" as="element(mods:name)?"/>
     <xsl:variable name="primary" select="('author', 'editor',
'creator')"/>
     <xsl:variable name="secondary" select="('translator')"/>
     <xsl:value-of>
       <xsl:choose>
         <xsl:when
test="$name/mods:role/mods:roleTerm[@type='text']=$primary">
           <xsl:text>primary</xsl:text>
         </xsl:when>
         <xsl:when
test="$name/mods:role/mods:roleTerm[@type='text']=$secondary">
           <xsl:text>secondary</xsl:text>
         </xsl:when>
       </xsl:choose>
     </xsl:value-of>
   </xsl:function>

I suppose this raises the question of whether these roles ought to be
configured in CSL though.

Bruce