Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-resource.xsl @ 8015

1
<?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: leinfelder $'
10
  *     '$Date: 2013-07-16 16:39:08 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 8015 $'
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
  <!--<xsl:import href="eml-party.xsl"/>
34
  <xsl:import href="eml-distribution.xsl"/>
35
  <xsl:import href="eml-coverage.xsl"/>-->
36
  <xsl:output method="html" encoding="UTF-8"
37
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
38
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
39
    indent="yes" />  
40

    
41
  <!-- This module is for resouce and it is self-contained (it is table)-->
42
  <xsl:template name="resource">
43
    <xsl:param name="resfirstColStyle"/>
44
    <xsl:param name="ressubHeaderStyle"/>
45
    <xsl:param name="creator">Data Set Creator(s)</xsl:param>
46
  </xsl:template>
47

    
48
  <!-- style the alternate identifier elements -->
49
  <xsl:template name="resourcealternateIdentifier" >
50
      <xsl:param name="resfirstColStyle"/>
51
      <xsl:param name="ressecondColStyle"/>
52
      <xsl:if test="normalize-space(.)!=''">
53
      <div class="control-group">
54
      	<label class="control-label">Alternate Identifier</label>
55
        <div class="controls controls-well">
56
        	<xsl:call-template name="i18n">
57
       			<xsl:with-param name="i18nElement" select="."/>
58
       		</xsl:call-template>
59
        </div>
60
      </div>
61
      </xsl:if>
62
  </xsl:template>
63

    
64

    
65
  <!-- style the short name elements -->
66
  <xsl:template name="resourceshortName">
67
      <xsl:param name="resfirstColStyle"/>
68
      <xsl:param name="ressecondColStyle"/>
69
      <xsl:if test="normalize-space(.)!=''">
70
      <div class="control-group">
71
      	<label class="control-label">Short Name</label>
72
        <div class="controls controls-well">
73
        	<xsl:call-template name="i18n">
74
       			<xsl:with-param name="i18nElement" select="."/>
75
       		</xsl:call-template>
76
        </div>
77
      </div>
78
      </xsl:if>
79
  </xsl:template>
80

    
81

    
82
  <!-- style the title element -->
83
  <xsl:template name="resourcetitle" >
84
      <xsl:param name="resfirstColStyle"/>
85
      <xsl:param name="ressecondColStyle"/>
86
      <xsl:if test="normalize-space(.)!=''">
87
      <div class="control-group">
88
      	<label class="control-label">Title</label>
89
        <div class="controls controls-well">
90
          <strong>
91
       		<xsl:call-template name="i18n">
92
       			<xsl:with-param name="i18nElement" select="."/>
93
       		</xsl:call-template>	
94
          </strong>
95
        </div>
96
      </div>
97
      </xsl:if>
98
  </xsl:template>
99

    
100
  <xsl:template name="resourcecreator" >
101
      <xsl:param name="resfirstColStyle"/>
102
       <xsl:call-template name="party">
103
              <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
104
       </xsl:call-template>
105
   </xsl:template>
106

    
107
  <xsl:template name="resourcemetadataProvider" >
108
      <xsl:param name="resfirstColStyle"/>
109
      <xsl:call-template name="party">
110
            <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
111
      </xsl:call-template>
112
  </xsl:template>
113

    
114
  <xsl:template name="resourceassociatedParty">
115
      <xsl:param name="resfirstColStyle"/>
116
      <xsl:call-template name="party">
117
          <xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
118
      </xsl:call-template>
119
  </xsl:template>
120

    
121

    
122
  <xsl:template name="resourcepubDate">
123
      <xsl:param name="resfirstColStyle"/>
124
      <xsl:if test="normalize-space(../pubDate)!=''">
125
      	<div class="control-group">
126
      		<label class="control-label">Publication Date</label>
127
      		<div class="controls controls-well">
128
        		<xsl:value-of select="../pubDate"/>
129
      		</div>
130
      	</div>	
131
      </xsl:if>
132
  </xsl:template>
133

    
134

    
135
  <xsl:template name="resourcelanguage">
136
      <xsl:param name="resfirstColStyle"/>
137
      <xsl:if test="normalize-space(.)!=''">
138
      <div class="control-group">
139
      		<label class="control-label">Language</label>
140
        	<div class="controls controls-well">
141
	        	<xsl:call-template name="i18n">
142
	       			<xsl:with-param name="i18nElement" select="."/>
143
	       		</xsl:call-template>
144
        	</div>
145
        </div>
146
      </xsl:if>
147
  </xsl:template>
148

    
149

    
150
  <xsl:template name="resourceseries">
151
      <xsl:param name="resfirstColStyle"/>
152
      <xsl:if test="normalize-space(../series)!=''">
153
      <div class="control-group">
154
      		<label class="control-label">Series</label>
155
      		<div class="controls controls-well">
156
        		<xsl:value-of select="../series"/>
157
        	</div>
158
        </div>
159
      </xsl:if>
160
  </xsl:template>
161

    
162

    
163
  <xsl:template name="resourceabstract">
164
     <xsl:param name="resfirstColStyle"/>
165
     <xsl:param name="ressecondColStyle"/>
166
     <div class="control-group">
167
       <label class="control-label">Abstract</label>
168
       <div class="controls controls-well">
169
         <xsl:call-template name="text">
170
           <xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
171
           <xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
172
         </xsl:call-template>
173
       </div>
174
     </div>
175
  </xsl:template>
176

    
177
  <xsl:template name="resourcekeywordSet">
178
		
179
		<xsl:if test="normalize-space(keyword)!=''">
180
  			<p>
181
  				<xsl:value-of select="keywordThesaurus"/>
182
  			</p>
183
  			<div>
184
	    		<table class="table table-striped table-condensed">
185
		        	<thead>
186
		        		<tr>
187
		        			<th>Keyword</th>
188
		        			<th>Type</th>
189
		        		</tr>
190
		        	</thead>
191
		          <xsl:for-each select="keyword">
192
		            <tr>
193
		            	<td>
194
			            	<xsl:call-template name="i18n">
195
				       			<xsl:with-param name="i18nElement" select="."/>
196
				       		</xsl:call-template>
197
				       	</td>
198
				       	<td>	
199
				            <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
200
				              <xsl:value-of select="./@keywordType"/>
201
				            </xsl:if>
202
			            </td>
203
		            </tr>
204
		          </xsl:for-each>
205
		        </table>
206
    		</div>
207
      			
208
	        
209
        </xsl:if>
210
		
211
  </xsl:template>
212

    
213
   <xsl:template name="resourceadditionalInfo">
214
     <xsl:param name="ressubHeaderStyle"/>
215
     <xsl:param name="resfirstColStyle"/>
216
     <div class="control-group">
217
      		<label class="control-label">Additional Information</label>
218
      		<div class="controls controls-well">
219
				<xsl:call-template name="text">
220
					<xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
221
				</xsl:call-template>
222
      		</div>
223
         </div>
224
  </xsl:template>
225

    
226

    
227
   <xsl:template name="resourceintellectualRights">
228
     <xsl:param name="resfirstColStyle"/>
229
     <xsl:param name="ressecondColStyle"/>
230
     <div class="control-group">
231
		<label class="control-label">Intellectual Rights</label>
232
		<div class="controls controls-well">
233
	       <xsl:call-template name="text">
234
	         <xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
235
	       </xsl:call-template>
236
		</div>
237
	</div>   
238
  </xsl:template>
239

    
240
   <xsl:template name="resourcedistribution">
241
     <xsl:param name="ressubHeaderStyle"/>
242
     <xsl:param name="resfirstColStyle"/>
243
     <xsl:param name="index"/>
244
     <xsl:param name="docid"/>
245
        <xsl:call-template name="distribution">
246
          <xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
247
          <xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
248
          <xsl:with-param name="level">toplevel</xsl:with-param>
249
          <xsl:with-param name="distributionindex" select="$index"/>
250
          <xsl:with-param name="docid" select="$docid"/>
251
        </xsl:call-template>
252
  </xsl:template>
253

    
254
  <xsl:template name="resourcecoverage">
255
     <xsl:param name="ressubHeaderStyle"/>
256
     <xsl:param name="resfirstColStyle"/>
257
        <xsl:call-template name="coverage">
258
        </xsl:call-template>
259
  </xsl:template>
260
  
261
	<!-- for displaying any nested translation element for i18nNonEmptyString type -->
262
	<xsl:template name="i18n">
263
		<xsl:param name="i18nElement"/>
264
		<!-- the primary value -->
265
		<xsl:if test="$i18nElement/text() != ''">
266
			<xsl:if test="./@xml:lang != ''">
267
				(<xsl:value-of select="./@xml:lang"/>)
268
			</xsl:if>
269
			<xsl:value-of select="$i18nElement/."/>
270
		</xsl:if>
271
		<!-- any translations -->
272
		<xsl:if test="count($i18nElement/value) > 0">
273
			<br/>
274
			<xsl:for-each select="$i18nElement/value">
275
				<xsl:if test="./@xml:lang != ''">
276
					(<xsl:value-of select="./@xml:lang"/>)
277
				</xsl:if>
278
				<xsl:value-of select="."/>
279
				<xsl:if test="position() != last()">
280
					<br/>
281
				</xsl:if>	
282
			</xsl:for-each>
283
		</xsl:if>
284
	</xsl:template>
285

    
286

    
287
</xsl:stylesheet>