Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 48 additions & 28 deletions xslt/software/xslt-software-OpenAire.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
</datacite:subjects>
</xsl:if>

<xsl:if test="root/standard_articles/id[normalize-space(.) != '' and . != 'None'] or root/references[normalize-space(.) != '' and . != 'None']">
<datacite:relatedIdentifiers>
<xsl:apply-templates select="root/standard_articles/id"/>
<xsl:apply-templates select="root/references"/>
</datacite:relatedIdentifiers>
</xsl:if>
<xsl:if test="root/standard_articles/id[normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))] or root/references[normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))]">
<datacite:relatedIdentifiers>
<xsl:apply-templates select="root/standard_articles/id[normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))]"/>
<xsl:apply-templates select="root/references[normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))]"/>
</datacite:relatedIdentifiers>
</xsl:if>

<xsl:if test="normalize-space(root/homepage) != '' and root/homepage != 'None' and root/homepage != 'none'">
<datacite:alternateIdentifiers>
<datacite:alternateIdentifier alternateIdentifierType="URL">
Expand Down Expand Up @@ -65,12 +66,20 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<dc:language>eng</dc:language>
<xsl:apply-templates select="root/standard_articles/source"/>
<xsl:apply-templates select="root/standard_articles/title"/>
<datacite:date dateType="Issued">
<datacite:date dateType="Issued">
<xsl:choose>
<xsl:when test="root/standard_articles/year[normalize-space(.) != '' and . != 'None']">
<xsl:when test="normalize-space(root/standard_articles/year) != ''
and root/standard_articles/year != 'None'
and root/standard_articles/year != 'none'
and not(starts-with(root/standard_articles/year, '0'))
and not(contains(root/standard_articles/year, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))">
<xsl:value-of select="root/standard_articles/year[not(. > ../../standard_articles/year)]"/>
</xsl:when>
<xsl:when test="root/references_year_alt[1] and not(starts-with(root/references_year_alt[1], '0'))">
<xsl:when test="normalize-space(root/references_year_alt[1]) != ''
and root/references_year_alt[1] != 'None'
and root/references_year_alt[1] != 'none'
and not(starts-with(root/references_year_alt[1], '0'))
and not(contains(root/references_year_alt[1], 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))">
<xsl:apply-templates select="root/references_year_alt[1]"/>
</xsl:when>
<xsl:otherwise>
Expand All @@ -79,8 +88,6 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
</xsl:choose>
</datacite:date>



</resource>

</xsl:template>
Expand All @@ -97,31 +104,46 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<xsl:value-of select="."/>
</datacite:creatorName>
<datacite:givenName>
<xsl:value-of select="substring-after(., ', ')"/>
</datacite:givenName>
<datacite:familyName>
<xsl:value-of select="substring-before(., ', ')"/>
</datacite:familyName>
<xsl:choose>
<xsl:when test="contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-after(., ', ')"/>
</xsl:otherwise>
</xsl:choose>
</datacite:givenName>
<datacite:familyName>
<xsl:choose>
<xsl:when test="contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before(., ', ')"/>
</xsl:otherwise>
</xsl:choose>
</datacite:familyName>
</datacite:creator>

</xsl:template>



<xsl:template match="name">
<datacite:title>
<xsl:value-of select="."/>
</datacite:title>
</xsl:template>

<xsl:template match="license_terms">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'">
<oaire:licenseCondition>
<xsl:value-of select="."/>
</oaire:licenseCondition>
</xsl:if>
</xsl:template>

<xsl:template match="description">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'">
<dc:description xml:lang="en" descriptionType="Abstract">
<xsl:value-of select="."/>
</dc:description>
Expand All @@ -132,7 +154,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'">
<datacite:subject subjectScheme="msc2020" >
<xsl:value-of select="."/>
</datacite:subject>
</datacite:subject>
</xsl:if>
</xsl:template>

Expand All @@ -148,33 +170,31 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or


<xsl:template match="source">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'">
<dc:source>
<xsl:value-of select="."/>
</dc:source>
</xsl:if>
</xsl:template>

<xsl:template match="title">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'">
<oaire:citationTitle>
<xsl:value-of select="."/>
</oaire:citationTitle>
</xsl:if>
</xsl:template>

<xsl:template match="standard_articles/id">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<!-- If the id element is present and not empty -->
<xsl:template match="standard_articles/id">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))">
<datacite:relatedIdentifier relatedIdentifierType="URL" relationType="IsReferencedBy">
<xsl:value-of select="concat('https://zbmath.org/', normalize-space(.))"/>
</datacite:relatedIdentifier>
</xsl:if>
</xsl:template>

<xsl:template match="references">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<!-- If the id element is present and not empty -->
<xsl:template match="references">
<xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))">
<datacite:relatedIdentifier relatedIdentifierType="URL" relationType="IsSupplementedBy">
<xsl:value-of select="concat('https://api.zbmath.org/v1/document/', normalize-space(.))"/>
</datacite:relatedIdentifier>
Expand Down
Loading