Created
October 3, 2016 23:25
-
-
Save terrywbrady/d0304eed59815d2e9c2d658a21cc5628 to your computer and use it in GitHub Desktop.
Show Orcid with XMLUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
display item summary info | |
$notLast and $sep are used to control the display of multiple authors | |
--> | |
<xsl:when test="@element='contributor' and @qualifier='author' and @authority"> | |
<xsl:variable name="a"> | |
<xsl:value-of select="."/> | |
<xsl:call-template name="ORCID"> | |
<xsl:with-param name="uuid" select='@authority'/> | |
</xsl:call-template> | |
</xsl:variable> | |
<xsl:variable name="b"> | |
<xsl:if test="$notLast"><xsl:copy-of select="$sep"/></xsl:if> | |
</xsl:variable> | |
<xsl:copy-of select="$a"/><xsl:copy-of select="$b"/> | |
</xsl:when> | |
<!-- create a link to ORCID using the SOLR authority --> | |
<xsl:template name="ORCID"> | |
<xsl:param name='uuid'/> | |
<xsl:variable name="solr" select="concat('http://localhost/solr/authority/select?q=id:',$uuid)"/> | |
<xsl:variable name="authority" select="document($solr)/response/result/doc/str[@name='orcid_id']/text()"/> | |
<xsl:if test="$authority"> | |
<xsl:text> (</xsl:text> | |
<a> | |
<xsl:attribute name='href'> | |
<xsl:value-of select="concat('http://orcid.org/',$authority)"/> | |
</xsl:attribute> | |
<xsl:text>ORCID</xsl:text> | |
</a> | |
<xsl:text>)</xsl:text> | |
</xsl:if> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment