1 |
7982
|
leinfelder
|
<?xml version="1.0"?>
|
2 |
|
|
<!--
|
3 |
|
|
* '$RCSfile$'
|
4 |
|
|
* Authors: Matthew Brooke
|
5 |
|
|
* Copyright: 2000 Regents of the University of California and the
|
6 |
|
|
* National Center for Ecological Analysis and Synthesis
|
7 |
|
|
* For Details: http://www.nceas.ucsb.edu/
|
8 |
|
|
*
|
9 |
|
|
* '$Author$'
|
10 |
|
|
* '$Date$'
|
11 |
|
|
* '$Revision$'
|
12 |
|
|
*
|
13 |
|
|
* This program is free software; you can redistribute it and/or modify
|
14 |
|
|
* it under the terms of the GNU General Public License as published by
|
15 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
16 |
|
|
* (at your option) any later version.
|
17 |
|
|
*
|
18 |
|
|
* This program is distributed in the hope that it will be useful,
|
19 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
|
|
* GNU General Public License for more details.
|
22 |
|
|
*
|
23 |
|
|
* You should have received a copy of the GNU General Public License
|
24 |
|
|
* along with this program; if not, write to the Free Software
|
25 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26 |
|
|
*
|
27 |
|
|
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
|
28 |
|
|
* convert an XML file that is valid with respect to the eml-variable.dtd
|
29 |
|
|
* module of the Ecological Metadata Language (EML) into an HTML format
|
30 |
|
|
* suitable for rendering with modern web browsers.
|
31 |
|
|
-->
|
32 |
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
33 |
|
|
|
34 |
8005
|
leinfelder
|
<xsl:output method="html" encoding="UTF-8"
|
35 |
7982
|
leinfelder
|
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
|
36 |
|
|
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
|
37 |
|
|
indent="yes" />
|
38 |
|
|
|
39 |
|
|
<!-- This module is for party member and it is self contained-->
|
40 |
|
|
|
41 |
|
|
<xsl:template name="party">
|
42 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
43 |
7988
|
leinfelder
|
<div class="row-fluid">
|
44 |
7982
|
leinfelder
|
<xsl:choose>
|
45 |
|
|
<xsl:when test="references!=''">
|
46 |
|
|
<xsl:variable name="ref_id" select="references"/>
|
47 |
|
|
<xsl:variable name="references" select="$ids[@id=$ref_id]" />
|
48 |
|
|
<xsl:for-each select="$references">
|
49 |
|
|
<xsl:apply-templates mode="party">
|
50 |
|
|
<xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
|
51 |
|
|
</xsl:apply-templates>
|
52 |
|
|
</xsl:for-each>
|
53 |
|
|
</xsl:when>
|
54 |
|
|
<xsl:otherwise>
|
55 |
|
|
<xsl:apply-templates mode="party">
|
56 |
|
|
<xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
|
57 |
|
|
</xsl:apply-templates>
|
58 |
|
|
</xsl:otherwise>
|
59 |
|
|
</xsl:choose>
|
60 |
7988
|
leinfelder
|
</div>
|
61 |
7982
|
leinfelder
|
</xsl:template>
|
62 |
|
|
|
63 |
|
|
<!-- *********************************************************************** -->
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
<xsl:template match="individualName" mode="party">
|
67 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
68 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
69 |
7988
|
leinfelder
|
<div class="control-group">
|
70 |
8008
|
leinfelder
|
<label class="control-label">Individual</label>
|
71 |
7988
|
leinfelder
|
<div class="controls" >
|
72 |
|
|
<b><xsl:value-of select="./salutation"/><xsl:text> </xsl:text>
|
73 |
|
|
<xsl:value-of select="./givenName"/><xsl:text> </xsl:text>
|
74 |
|
|
<xsl:value-of select="./surName"/></b>
|
75 |
|
|
</div>
|
76 |
|
|
</div>
|
77 |
7982
|
leinfelder
|
</xsl:if>
|
78 |
|
|
</xsl:template>
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
<xsl:template match="organizationName" mode="party">
|
82 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
83 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
84 |
7988
|
leinfelder
|
<div class="control-group">
|
85 |
8008
|
leinfelder
|
<label class="control-label">Organization</label>
|
86 |
7988
|
leinfelder
|
<div class="controls">
|
87 |
|
|
<b><xsl:value-of select="."/></b>
|
88 |
|
|
</div>
|
89 |
|
|
</div>
|
90 |
7982
|
leinfelder
|
</xsl:if>
|
91 |
|
|
</xsl:template>
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
<xsl:template match="positionName" mode="party">
|
95 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
96 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
97 |
7988
|
leinfelder
|
<div class="control-group">
|
98 |
8008
|
leinfelder
|
<label class="control-label">Position</label>
|
99 |
7988
|
leinfelder
|
<div class="controls">
|
100 |
|
|
<xsl:value-of select="."/>
|
101 |
|
|
</div>
|
102 |
|
|
</div>
|
103 |
7982
|
leinfelder
|
</xsl:if>
|
104 |
|
|
</xsl:template>
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
<xsl:template match="address" mode="party">
|
108 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
109 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
110 |
|
|
<xsl:call-template name="addressCommon">
|
111 |
|
|
<xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
|
112 |
|
|
</xsl:call-template>
|
113 |
|
|
</xsl:if>
|
114 |
|
|
</xsl:template>
|
115 |
|
|
|
116 |
|
|
<!-- This template will be call by other place-->
|
117 |
|
|
<xsl:template name="address">
|
118 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
119 |
|
|
<xsl:choose>
|
120 |
|
|
<xsl:when test="references!=''">
|
121 |
|
|
<xsl:variable name="ref_id" select="references"/>
|
122 |
|
|
<xsl:variable name="references" select="$ids[@id=$ref_id]" />
|
123 |
|
|
<xsl:for-each select="$references">
|
124 |
|
|
<xsl:call-template name="addressCommon">
|
125 |
|
|
<xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
|
126 |
|
|
</xsl:call-template>
|
127 |
|
|
</xsl:for-each>
|
128 |
|
|
</xsl:when>
|
129 |
|
|
<xsl:otherwise>
|
130 |
|
|
<xsl:call-template name="addressCommon">
|
131 |
|
|
<xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
|
132 |
|
|
</xsl:call-template>
|
133 |
|
|
</xsl:otherwise>
|
134 |
|
|
</xsl:choose>
|
135 |
|
|
</xsl:template>
|
136 |
|
|
|
137 |
|
|
<xsl:template name="addressCommon">
|
138 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
139 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
140 |
7988
|
leinfelder
|
<div class="control-group">
|
141 |
8008
|
leinfelder
|
<label class="control-label">Address</label>
|
142 |
7988
|
leinfelder
|
<div class="controls">
|
143 |
|
|
<address>
|
144 |
|
|
<xsl:for-each select="deliveryPoint">
|
145 |
|
|
<xsl:value-of select="."/><xsl:text>, </xsl:text>
|
146 |
|
|
</xsl:for-each>
|
147 |
|
|
<br/>
|
148 |
|
|
<!-- only include comma if city exists... -->
|
149 |
|
|
<xsl:if test="normalize-space(city)!=''">
|
150 |
|
|
<xsl:value-of select="city"/><xsl:text>, </xsl:text>
|
151 |
|
|
</xsl:if>
|
152 |
|
|
<xsl:if test="normalize-space(administrativeArea)!='' or normalize-space(postalCode)!=''">
|
153 |
|
|
<xsl:value-of select="administrativeArea"/><xsl:text> </xsl:text><xsl:value-of select="postalCode"/><xsl:text> </xsl:text>
|
154 |
|
|
</xsl:if>
|
155 |
|
|
<xsl:if test="normalize-space(country)!=''">
|
156 |
|
|
<xsl:value-of select="country"/>
|
157 |
|
|
</xsl:if>
|
158 |
|
|
</address>
|
159 |
|
|
</div>
|
160 |
|
|
</div>
|
161 |
7982
|
leinfelder
|
</xsl:if>
|
162 |
|
|
</xsl:template>
|
163 |
|
|
|
164 |
|
|
<xsl:template match="phone" mode="party">
|
165 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
166 |
7988
|
leinfelder
|
<div class="control-group">
|
167 |
|
|
<label class="control-label">Phone</label>
|
168 |
|
|
<div class="controls">
|
169 |
|
|
<xsl:value-of select="."/>
|
170 |
|
|
<xsl:if test="normalize-space(./@phonetype)!=''">
|
171 |
|
|
<xsl:text> (</xsl:text><xsl:value-of select="./@phonetype"/><xsl:text>)</xsl:text>
|
172 |
|
|
</xsl:if>
|
173 |
|
|
</div>
|
174 |
|
|
</div>
|
175 |
7982
|
leinfelder
|
</xsl:template>
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
<xsl:template match="electronicMailAddress" mode="party">
|
179 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
180 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
181 |
7988
|
leinfelder
|
<div class="control-group">
|
182 |
|
|
<label class="control-label" >
|
183 |
|
|
Email Address
|
184 |
|
|
</label>
|
185 |
|
|
<div class="controls">
|
186 |
|
|
<a><xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
|
187 |
7982
|
leinfelder
|
<xsl:value-of select="."/></a>
|
188 |
7988
|
leinfelder
|
</div>
|
189 |
|
|
</div>
|
190 |
|
|
|
191 |
7982
|
leinfelder
|
</xsl:if>
|
192 |
|
|
</xsl:template>
|
193 |
|
|
|
194 |
|
|
|
195 |
|
|
<xsl:template match="onlineUrl" mode="party">
|
196 |
|
|
<xsl:param name="partyfirstColStyle"/>
|
197 |
|
|
<xsl:if test="normalize-space(.)!=''">
|
198 |
7988
|
leinfelder
|
<div class="control-group">
|
199 |
|
|
<label class="control-label">Web Address</label>
|
200 |
8012
|
leinfelder
|
<div class="controls">
|
201 |
7988
|
leinfelder
|
<a><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
|
202 |
|
|
<xsl:value-of select="."/></a>
|
203 |
|
|
</div>
|
204 |
|
|
</div>
|
205 |
|
|
</xsl:if>
|
206 |
7982
|
leinfelder
|
</xsl:template>
|
207 |
|
|
|
208 |
|
|
|
209 |
10158
|
mecum
|
|
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" />
|
270 |
7982
|
leinfelder
|
</xsl:stylesheet>
|