orcid-map.xslt 1.75 KB
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet
        xmlns:xml="http://www.w3.org/XML/1998/namespace"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:orcid="http://www.orcid.org/ns/orcid"
        version="1.0">
<xsl:output method='text'/>
<xsl:template match="/">

    <xsl:text>"</xsl:text>
    <xsl:value-of select="//orcid:orcid-identifier/orcid:path/text()"/>
    <xsl:text>",</xsl:text>

    <xsl:text>"</xsl:text>
    <xsl:value-of select="//orcid:orcid-bio/orcid:personal-details/orcid:given-names/text()"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="//orcid:orcid-bio/orcid:personal-details/orcid:family-name/text()"/>
    <xsl:text>",</xsl:text>

    <xsl:text>"</xsl:text>
    <xsl:variable name="n_ResearcherID" select="count(//orcid:external-identifier/orcid:external-id-common-name[text()='ResearcherID'])"/>
    <xsl:for-each select="//orcid:external-identifier/orcid:external-id-common-name[text()='ResearcherID']/../orcid:external-id-reference">
        <xsl:value-of select="text()"/>
        <xsl:if test="$n_ResearcherID &gt; 1 and position() != last()">
            <xsl:text>||</xsl:text>
        </xsl:if>
    </xsl:for-each>
    <xsl:text>",</xsl:text>

    <xsl:text>"</xsl:text>
    <xsl:variable name="n_ScopusID" select="count(//orcid:external-identifier/orcid:external-id-common-name[text()='Scopus Author ID'])"/>
    <xsl:for-each select="//orcid:external-identifier/orcid:external-id-common-name[text()='Scopus Author ID']/../orcid:external-id-reference">
        <xsl:value-of select="text()"/> 
        <xsl:if test="$n_ScopusID &gt; 1 and position() != last()">       
            <xsl:text>||</xsl:text>
        </xsl:if>
    </xsl:for-each>
    <xsl:text>"&#xa;</xsl:text>
    </xsl:template>

</xsl:stylesheet>