Project

General

Profile

« Previous | Next » 

Revision 10145

Added by Bryce Mecum over 7 years ago

Add support in the EML XSLT for making ORCID userIds into links

View differences:

eml-party.xsl
209 209
  <xsl:template match="userId" mode="party">
210 210
      <xsl:param name="partyfirstColStyle"/>
211 211
      <xsl:if test="normalize-space(.)!=''">
212
      <div class="control-group">
213
      	<label class="control-label">Id</label>
214
      	<div class="controls">
215
        	<xsl:value-of select="."/>
216
        </div>
217
       </div>
212
          <div class="control-group">
213
              <label class="control-label">Id</label>
214
              <div class="controls">
215
                  <!-- Display the userId as a link when it appears to be an ORCID -->
216
                  <xsl:choose>
217
                      <xsl:when test="./@directory = 'http://orcid.org' and starts-with(., 'http')">
218
                          <xsl:element name="a">
219
                              <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
220
                              <xsl:value-of select="."/>
221
                          </xsl:element>
222
                      </xsl:when>
223
                      <xsl:otherwise>
224
                          <xsl:value-of select="."/>
225
                      </xsl:otherwise>
226
                  </xsl:choose>
227
              </div>
228
          </div>
218 229
      </xsl:if>
219 230
  </xsl:template>
220 231
  <xsl:template match="text()" mode="party" />

Also available in: Unified diff