Skip to content

Commit

Permalink
#40 - fix DOI field, eliminate chance of redundant field
Browse files Browse the repository at this point in the history
  • Loading branch information
Klortho committed Sep 7, 2014
1 parent f57e4a3 commit 481fc84
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jats-to-mediawiki.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,11 @@
<xsl:apply-templates select="@xlink:href"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>

<!-- Avoid redundancy with specific ID fields below-->
<xsl:when test="ext-link[not(@ext-link-type='doi|pmcid|pmid')]">
<xsl:when test="ext-link[not(@ext-link-type='doi' or @ext-link-type='pmcid' or
@ext-link-type='pmid' or
starts-with(@xlink:href, 'http://dx.doi.org/'))]">
<xsl:text>| url = </xsl:text>
<xsl:apply-templates select="ext-link"/>
<xsl:text>&#xA;</xsl:text>
Expand Down Expand Up @@ -1100,15 +1103,20 @@

<xsl:choose>
<xsl:when test="pub-id[@pub-id-type='doi']">
<xsl:text>| doi = </xsl:text>
<xsl:text>| DOI = </xsl:text>
<xsl:apply-templates select="pub-id[@pub-id-type='doi']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:when test="ext-link[@ext-link-type='doi']">
<xsl:text>| doi = </xsl:text>
<xsl:text>| DOI = </xsl:text>
<xsl:apply-templates select="ext-link[@ext-link-type='doi']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:when test="ext-link[starts-with(., 'http://dx.doi.org/')]">
<xsl:text>| DOI = </xsl:text>
<xsl:apply-templates select="ext-link[starts-with(@xlink:href, 'http://dx.doi.org/')]"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
</xsl:choose>

<xsl:choose>
Expand Down

0 comments on commit 481fc84

Please sign in to comment.