|
Lines 27-111
Link Here
|
| 27 |
<xsl:variable name="AuthorLinkSortOrder" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortOrder']"/> |
27 |
<xsl:variable name="AuthorLinkSortOrder" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortOrder']"/> |
| 28 |
|
28 |
|
| 29 |
<!-- Add links based on persistent identifiers Bug 38425 --> |
29 |
<!-- Add links based on persistent identifiers Bug 38425 --> |
| 30 |
<xsl:if test="marc:datafield[@tag=017]"> |
30 |
<xsl:if test="marc:datafield[@tag=017]/marc:subfield[@code='2'][ |
| 31 |
<span class="results_summary pid_links"> |
31 |
. = 'doi' or |
| 32 |
<span class="label">External resource(s): </span> |
32 |
. = 'pmid' or |
| 33 |
<ul class="resource_list"> |
33 |
. = 'pmc' or |
| 34 |
<xsl:for-each select="marc:datafield[@tag=017]/marc:subfield[@code='2']"> |
34 |
. = 'arxiv' or |
| 35 |
<xsl:choose> |
35 |
. = 'inspire' or |
| 36 |
<xsl:when test=". = 'doi'"> |
36 |
. = 'openlibrary' or |
| 37 |
<li> |
37 |
. = 'hdl' |
| 38 |
<span class="label">doi:</span> |
38 |
]"> |
| 39 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
39 |
<span class="results_summary pid_links"> |
| 40 |
<a> |
40 |
<!-- Process each pid type --> |
| 41 |
<xsl:attribute name="href">https://doi.org/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
41 |
<xsl:call-template name="show-pid-link"> |
| 42 |
<xsl:value-of select="current()" /> |
42 |
<xsl:with-param name="type" select="'doi'"/> |
| 43 |
</a> |
43 |
<xsl:with-param name="label" select="'DOI: '"/> |
| 44 |
</xsl:for-each> |
44 |
<xsl:with-param name="url-prefix" select="'https://doi.org/'"/> |
| 45 |
</li> |
45 |
</xsl:call-template> |
| 46 |
</xsl:when> |
46 |
|
| 47 |
<xsl:when test=". = 'pmid'"> |
47 |
<xsl:call-template name="show-pid-link"> |
| 48 |
<li> |
48 |
<xsl:with-param name="type" select="'pmid'"/> |
| 49 |
<span class="label">PMID: </span> |
49 |
<xsl:with-param name="label" select="'PMID: '"/> |
| 50 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
50 |
<xsl:with-param name="url-prefix" select="'https://pubmed.ncbi.nlm.nih.gov/'"/> |
| 51 |
<a> |
51 |
</xsl:call-template> |
| 52 |
<xsl:attribute name="href">https://pubmed.ncbi.nlm.nih.gov/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
52 |
|
| 53 |
<xsl:value-of select="current()" /> |
53 |
<xsl:call-template name="show-pid-link"> |
| 54 |
</a> |
54 |
<xsl:with-param name="type" select="'pmc'"/> |
| 55 |
</xsl:for-each> |
55 |
<xsl:with-param name="label" select="'PMC: '"/> |
| 56 |
</li> |
56 |
<xsl:with-param name="url-prefix" select="'https://pmc.ncbi.nlm.nih.gov/articles/'"/> |
| 57 |
</xsl:when> |
57 |
</xsl:call-template> |
| 58 |
<xsl:when test=". = 'pmc'"> |
58 |
|
| 59 |
<li> |
59 |
<xsl:call-template name="show-pid-link"> |
| 60 |
<span class="label">PMCID: </span> |
60 |
<xsl:with-param name="type" select="'arxiv'"/> |
| 61 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
61 |
<xsl:with-param name="label" select="'arXiv: '"/> |
| 62 |
<a> |
62 |
<xsl:with-param name="url-prefix" select="'https://arxiv.org/abs/'"/> |
| 63 |
<xsl:attribute name="href">https://pmc.ncbi.nlm.nih.gov/articles/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
63 |
</xsl:call-template> |
| 64 |
<xsl:value-of select="current()" /> |
64 |
|
| 65 |
</a> |
65 |
<xsl:call-template name="show-pid-link"> |
| 66 |
</xsl:for-each> |
66 |
<xsl:with-param name="type" select="'inspire'"/> |
| 67 |
</li> |
67 |
<xsl:with-param name="label" select="'iNSPIRE: '"/> |
| 68 |
</xsl:when> |
68 |
<xsl:with-param name="url-prefix" select="'https://inspirehep.net/literature/'"/> |
| 69 |
<xsl:when test=". = 'arxiv'"> |
69 |
</xsl:call-template> |
| 70 |
<li> |
70 |
|
| 71 |
<!-- arXiv-ids are `arxiv:1234.5678` is redundant |
71 |
<xsl:call-template name="show-pid-link"> |
| 72 |
<span class="label">arXiv:</span> |
72 |
<xsl:with-param name="type" select="'openlibrary'"/> |
| 73 |
--> |
73 |
<xsl:with-param name="label" select="'Open Library: '"/> |
| 74 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
74 |
<xsl:with-param name="url-prefix" select="'https://openlibrary.org/works/'"/> |
| 75 |
<a> |
75 |
</xsl:call-template> |
| 76 |
<xsl:attribute name="href">https://arxiv.org/abs/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
76 |
|
| 77 |
<xsl:value-of select="current()" /> |
77 |
<xsl:call-template name="show-pid-link"> |
| 78 |
</a> |
78 |
<xsl:with-param name="type" select="'hdl'"/> |
| 79 |
</xsl:for-each> |
79 |
<xsl:with-param name="label" select="'Handle: '"/> |
| 80 |
</li> |
80 |
<xsl:with-param name="url-prefix" select="'https://hdl.handle.net/'"/> |
| 81 |
</xsl:when> |
81 |
</xsl:call-template> |
| 82 |
<xsl:when test=". = 'inspire'"> |
82 |
</span> |
| 83 |
<li> |
83 |
</xsl:if> |
| 84 |
<span class="label">inspire: </span> |
84 |
|
| 85 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
|
|
| 86 |
<a> |
| 87 |
<xsl:attribute name="href">https://inspirehep.net/literature/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
| 88 |
<xsl:value-of select="current()" /> |
| 89 |
</a> |
| 90 |
</xsl:for-each> |
| 91 |
</li> |
| 92 |
</xsl:when> |
| 93 |
<xsl:when test=". = 'openlibrary'"> |
| 94 |
<li> |
| 95 |
<span class="label">OpenLibrary: </span> |
| 96 |
<xsl:for-each select="../marc:subfield[@code='a']"> |
| 97 |
<a> |
| 98 |
<xsl:attribute name="href">https://openlibrary.org/works/<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute> |
| 99 |
<xsl:value-of select="current()" /> |
| 100 |
</a> |
| 101 |
</xsl:for-each> |
| 102 |
</li> |
| 103 |
</xsl:when> |
| 104 |
</xsl:choose> |
| 105 |
</xsl:for-each> |
| 106 |
</ul> |
| 107 |
</span> |
| 108 |
</xsl:if> |
| 109 |
|
85 |
|
| 110 |
<xsl:if test="marc:datafield[@tag=200]"> |
86 |
<xsl:if test="marc:datafield[@tag=200]"> |
| 111 |
<xsl:for-each select="marc:datafield[@tag=200]"> |
87 |
<xsl:for-each select="marc:datafield[@tag=200]"> |
|
Lines 737-740
Link Here
|
| 737 |
<xsl:value-of select="substring($str,1,string-length($str)-1)"/> |
713 |
<xsl:value-of select="substring($str,1,string-length($str)-1)"/> |
| 738 |
</xsl:template> |
714 |
</xsl:template> |
| 739 |
|
715 |
|
|
|
716 |
<!-- Template for PID links, cf Bug 38425 --> |
| 717 |
<xsl:template name="show-pid-link"> |
| 718 |
<xsl:param name="type"/> |
| 719 |
<xsl:param name="label"/> |
| 720 |
<xsl:param name="url-prefix"/> |
| 721 |
|
| 722 |
<xsl:variable name="values" select="marc:datafield[@tag=017]/marc:subfield[@code='2'][. = $type]/../marc:subfield[@code='a']"/> |
| 723 |
|
| 724 |
<xsl:if test="$values"> |
| 725 |
<span class="results_summary resource_list_{$type}"> |
| 726 |
<xsl:if test="$label"> |
| 727 |
<span class="label"> |
| 728 |
<xsl:value-of select="$label"/> |
| 729 |
</span> |
| 730 |
</xsl:if> |
| 731 |
<ul class="resource_list"> |
| 732 |
<xsl:for-each select="$values"> |
| 733 |
<li class="resource_{$type}"> |
| 734 |
<a class="resource_link" href="{$url-prefix}{str:encode-uri(current(), true())}"> |
| 735 |
<xsl:value-of select="current()"/> |
| 736 |
</a> |
| 737 |
</li> |
| 738 |
</xsl:for-each> |
| 739 |
</ul> |
| 740 |
</span> |
| 741 |
</xsl:if> |
| 742 |
</xsl:template> |
| 743 |
|
| 744 |
|
| 740 |
</xsl:stylesheet> |
745 |
</xsl:stylesheet> |
| 741 |
- |
|
|