Skip to content

Commit

Permalink
only add licenseAttributionByText if quelle is set in the license JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanzadelhoff committed Nov 4, 2022
1 parent 5ed1a70 commit 1b6c019
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/main/resources/iso2dcat.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -908,20 +908,13 @@

<xsl:template name="licenseAttributionByText">
<xsl:param name="accessConstraintsJson"/>
<xsl:if test="$accessConstraintsJson">
<xsl:variable name="byText">
<xsl:if test="starts-with(normalize-space($accessConstraintsJson), '{')">
<xsl:variable name="jsonWithQuelle" select="substring-after($accessConstraintsJson, '&quot;quelle&quot;')"/>
<xsl:variable name="quelle" select="substring-before(substring-after($jsonWithQuelle, '&quot;'), '&quot;')"/>
<xsl:value-of select="$quelle" />
</xsl:if>
</xsl:variable>
<xsl:if test="$byText">
<dcatde:licenseAttributionByText>
<xsl:call-template name="xmlLang"/>
<xsl:value-of select="$byText"/>
</dcatde:licenseAttributionByText>
</xsl:if>
<xsl:if test="$accessConstraintsJson and starts-with(normalize-space($accessConstraintsJson), '{') and contains($accessConstraintsJson, '&quot;quelle&quot;')">
<xsl:variable name="jsonWithQuelle" select="substring-after($accessConstraintsJson, '&quot;quelle&quot;')"/>
<xsl:variable name="quelle" select="substring-before(substring-after($jsonWithQuelle, '&quot;'), '&quot;')"/>
<dcatde:licenseAttributionByText>
<xsl:call-template name="xmlLang"/>
<xsl:value-of select="$quelle" />
</dcatde:licenseAttributionByText>
</xsl:if>
</xsl:template>

Expand Down

0 comments on commit 1b6c019

Please sign in to comment.