Revision 10158
Added by Bryce Mecum almost 8 years ago
lib/style/skins/metacatui/eml-2/eml-party.xsl | ||
---|---|---|
206 | 206 |
</xsl:template> |
207 | 207 |
|
208 | 208 |
|
209 |
<xsl:template match="userId" mode="party"> |
|
210 |
<xsl:param name="partyfirstColStyle"/> |
|
211 |
<xsl:if test="normalize-space(.)!=''"> |
|
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> |
|
229 |
</xsl:if> |
|
230 |
</xsl:template> |
|
231 |
<xsl:template match="text()" mode="party" /> |
|
209 |
|
|
210 |
<xsl:template match="userId" mode="party"> |
|
211 |
<xsl:param name="partyfirstColStyle"/> |
|
212 |
<xsl:if test="normalize-space(.)!=''"> |
|
213 |
<div class="control-group"> |
|
214 |
<label class="control-label">Id</label> |
|
215 |
<div class="controls"> |
|
216 |
<!-- Display the userId as a link when it appears to be an |
|
217 |
ORCID. The display of ORCID information is subject to |
|
218 |
ORCID's guidelines: |
|
219 |
|
|
220 |
https://orcid.org/trademark-and-id-display-guidelines |
|
221 |
|
|
222 |
We want to display the content as a hyperlinked ORCID when |
|
223 |
we're reasonably sure the value of the userId element is an |
|
224 |
ORCID and otherwise just display the non-hyperlinked value |
|
225 |
of the element. |
|
226 |
|
|
227 |
An example serialization of an ORCID in EML is |
|
228 |
|
|
229 |
<userId directory="http://orcid.org"> |
|
230 |
http://orcid.org/0000-0003-1315-3818 |
|
231 |
</userId> |
|
232 |
--> |
|
233 |
|
|
234 |
<!-- Set up space-normalized variables for later use. --> |
|
235 |
<xsl:variable name="directory" select="normalize-space(./@directory)" /> |
|
236 |
<xsl:variable name="value" select="normalize-space(.)" /> |
|
237 |
|
|
238 |
<xsl:choose> |
|
239 |
<xsl:when test="starts-with($directory, 'http://orcid.org') or starts-with($directory, 'https://orcid.org') or ($directory = '' and (starts-with($value, 'http://orcid.org') or starts-with(@value, 'https://orcid.org')))"> |
|
240 |
<!-- ORCID Logo --> |
|
241 |
<a href="https://orcid.org"> |
|
242 |
<img src="img/orcid_64x64.png" style="display: inline; margin-right: 5px;" width="16" height="16" /> |
|
243 |
</a> |
|
244 |
<!-- ORCID Link--> |
|
245 |
<xsl:element name="a"> |
|
246 |
<xsl:choose> |
|
247 |
<xsl:when test="starts-with($value, 'http://orcid.org') or starts-with(./@value, 'https://orcid.org')"> |
|
248 |
<xsl:attribute name="href"> |
|
249 |
<xsl:value-of select="$value"/> |
|
250 |
</xsl:attribute> |
|
251 |
</xsl:when> |
|
252 |
<xsl:otherwise> |
|
253 |
<xsl:attribute name="href"> |
|
254 |
<xsl:value-of select="concat('http://orcid.org/', $value)" /> |
|
255 |
</xsl:attribute> |
|
256 |
</xsl:otherwise> |
|
257 |
</xsl:choose> |
|
258 |
<xsl:value-of select="$value"/> |
|
259 |
</xsl:element> |
|
260 |
</xsl:when> |
|
261 |
<xsl:otherwise> |
|
262 |
<xsl:value-of select="."/> |
|
263 |
</xsl:otherwise> |
|
264 |
</xsl:choose> |
|
265 |
</div> |
|
266 |
</div> |
|
267 |
</xsl:if> |
|
268 |
</xsl:template> |
|
269 |
<xsl:template match="text()" mode="party" /> |
|
232 | 270 |
</xsl:stylesheet> |
Also available in: Unified diff
Improve the EML XSLT's handling of ORCIDs as userIds