Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeier authored Nov 12, 2024
1 parent 0147657 commit f9ab221
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions json-stylesheet.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -438,36 +438,32 @@
</xsl:template>
<xsl:template match="*:fields[@function = 'persName']">
<xsl:param name="doc"/>
<xsl:param name="id"/>
<xsl:if test="$doc/descendant::tei:body/descendant::tei:persName">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each-group select="$doc/descendant::tei:body/descendant::tei:persName" group-by="text()>
<xsl:for-each select="$doc/descendant::tei:body/descendant::tei:persName">
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space(string-join(.,' '))"/></string>
</xsl:for-each-group>
</xsl:for-each>
</array>
</xsl:if>
</xsl:template>

<xsl:template match="*:fields[@function = 'placeName']">
<xsl:param name="doc"/>
<xsl:param name="id"/>
<xsl:if test="contains($id, '/place')">
<xsl:if test="$doc/descendant::tei:body/tei:listPlace/tei:placeName">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each-group select="$doc/descendant::tei:body/tei:listPlace/tei:placeName[. != '']" group-by="text()">
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space(string-join(.,' '))"/></string>
</xsl:for-each-group>
</array>
</xsl:if>
<xsl:if test="$doc/descendant::tei:body/descendant::tei:placeName">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each select="$doc/descendant::tei:body/descendant::tei:placeName">
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space(string-join(.,' '))"/></string>
</xsl:for-each>
</array>
</xsl:if>
</xsl:template>
<xsl:template match="*:fields[@function = 'location']">
<xsl:param name="doc"/>
<xsl:if test="$doc/descendant::tei:body/descendant::tei:location">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each-group select="$doc/descendant::tei:body/descendant::tei:location" group-by="text()">
<xsl:for-each select="$doc/descendant::tei:body/descendant::tei:location">
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space(string-join(.,' '))"/></string>
</xsl:for-each-group>
</xsl:for-each>
</array>
</xsl:if>
</xsl:template>
Expand Down Expand Up @@ -564,9 +560,9 @@
<xsl:param name="id"/>
<xsl:if test="$doc/descendant::tei:body/descendant::tei:state">
<array key="{.}" xmlns="http://www.w3.org/2005/xpath-functions">
<xsl:for-each-group select="$doc/descendant::tei:body/descendant::tei:state[@type]" group-by="@type">
<xsl:for-each select="$doc/descendant::tei:body/descendant::tei:state">
<string xmlns="http://www.w3.org/2005/xpath-functions"><xsl:value-of select="normalize-space(string-join(descendant-or-self::text(),' '))"/></string>
</xsl:for-each-group>
</xsl:for-each>
</array>
</xsl:if>
</xsl:template>
Expand Down

0 comments on commit f9ab221

Please sign in to comment.