Skip to content

Commit

Permalink
adjusting the optional templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Shirazos7 committed Jan 28, 2025
1 parent c350d21 commit 6ad2d05
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions xslt/articles/xslt-article-Datacite.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,25 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
</xsl:template>
<!-- Template for processing the rest of the identifiers of our Metadata and considered as alternative identifiers-->
<xsl:template match="identifier">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<alternateIdentifier alternateIdentifierType="zbMATH Identifier">
<xsl:value-of select="."/>
</alternateIdentifier>
</xsl:if>
</xsl:template>
<xsl:template match="id">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<alternateIdentifier alternateIdentifierType="zbMATH Document ID">
<xsl:value-of select="."/>
</alternateIdentifier>
</xsl:if>
</xsl:template>
<xsl:template match="zbmath_url">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<alternateIdentifier alternateIdentifierType="URL">
<xsl:value-of select="."/>
</alternateIdentifier>
</xsl:if>
</xsl:template>

<!-- Template for processing authors -->
Expand Down Expand Up @@ -129,9 +135,11 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
</xsl:template>
<!-- Template for processing the language of the document -->
<xsl:template match="languages">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<language>
<xsl:value-of select="."/>
</language>
</xsl:if>
</xsl:template>
<!-- Template for processing the document type which can be various and needs to be properly handeld -->
<xsl:template match="description">
Expand Down Expand Up @@ -197,16 +205,18 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or

<!-- Template for processing text node into description text with its subproperty -->
<xsl:template match="text">
<!-- Transformation of description text -->
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<description xml:lang="en" descriptionType="Abstract">

<xsl:value-of select="normalize-space(.)"/>

</description>
</xsl:if>
</xsl:template>
<!-- Template for processing MSC (Mathematics Subject Classification)
transforming all its values -->
<xsl:template match="msc">
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">
<subject>
<xsl:attribute name="subjectScheme">
<xsl:value-of select="scheme"/>
Expand All @@ -216,23 +226,25 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
</xsl:attribute>
<xsl:value-of select="text"/>
</subject>
</xsl:if>
</xsl:template>
<!-- Template for processing keywords it is also under the subject section with MSC'S
with its own subjectscheme -->


<xsl:template match="keywords">
<!-- Transformation of keywords -->
<xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'">

<subject subjectScheme="keyword">
<xsl:value-of select="."/>
</subject>
</xsl:if>
</xsl:template>

<!-- Template for processing DOI references -->

<xsl:template match="doi[normalize-space()]">
<relatedIdentifier relatedIdentifierType="DOI" relationType="Cites" resourceTypeGeneral="JournalArticle"><xsl:value-of select="normalize-space(.)"/></relatedIdentifier>
</xsl:template>

<!-- Template to handle references with empty DOI elements and take the value of document_id also adding the url of zbmath to the result -->

<xsl:template match="references[not(doi[normalize-space()])]">
<relatedIdentifier relatedIdentifierType="URL" relationType="IsCitedBy"><xsl:value-of select="concat('https://zbmath.org/', zbmath/document_id)"/></relatedIdentifier>
</xsl:template>
Expand Down

0 comments on commit 6ad2d05

Please sign in to comment.