Skip to content

Commit

Permalink
authorKey for sorting by keyword in browse
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeier authored Nov 18, 2024
1 parent 5ca8c91 commit 2434f42
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions json-stylesheet.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,26 @@
</array>
</xsl:if>
</xsl:template>
<xsl:template match="*:fields[@function = 'authorKey']">
<xsl:param name="doc"/>
<xsl:if test="$doc/descendant::tei:biblStruct/descendant-or-self::tei:author or $doc/descendant::tei:biblStruct/descendant-or-self::tei:editor">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each select="$doc/descendant::tei:biblStruct/descendant-or-self::tei:author | $doc/descendant::tei:biblStruct/descendant-or-self::tei:editor">
<xsl:variable name="lastNameFirst">
<xsl:choose>
<xsl:when test="tei:surname">
<xsl:value-of select="concat(tei:surname, ' ', tei:forename)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-join(child::*,' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space($lastNameFirst)"/></string>
</xsl:for-each>
</array>
</xsl:if>
</xsl:template>
<!-- <xsl:template match="*:fields[@function = 'cbssPublicationDate']">
<xsl:param name="doc"/>
<xsl:if test="$doc/descendant::tei:imprint/tei:date">
Expand Down

0 comments on commit 2434f42

Please sign in to comment.