Project

General

Profile

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

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 14:01:10 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 8008 $'
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
          <em class="bold">
91
       		<xsl:call-template name="i18n">
92
       			<xsl:with-param name="i18nElement" select="."/>
93
       		</xsl:call-template>	
94
          </em>
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
      <xsl:for-each select="keywordThesaurus">
179
        <xsl:if test="normalize-space(.)!=''">
180
          <xsl:value-of select="."/>
181
          <xsl:text>: </xsl:text>
182
        </xsl:if>
183
        <xsl:if test="normalize-space(keyword)!=''">
184
        <ul>
185
          <xsl:for-each select="keyword">
186
            <li>
187
            	<xsl:call-template name="i18n">
188
	       			<xsl:with-param name="i18nElement" select="."/>
189
	       		</xsl:call-template>
190
	            <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
191
	              (<xsl:value-of select="./@keywordType"/>)
192
	            </xsl:if>
193
            </li>
194
          </xsl:for-each>
195
        </ul>
196
        </xsl:if>
197
      </xsl:for-each>
198
        <xsl:if test="normalize-space(keyword)!=''">
199
        <ul>
200
          <xsl:for-each select="keyword">
201
            <li>
202
            <xsl:call-template name="i18n">
203
       			<xsl:with-param name="i18nElement" select="."/>
204
       		</xsl:call-template>
205
            <xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
206
              (<xsl:value-of select="./@keywordType"/>)
207
            </xsl:if>
208
            </li>
209
          </xsl:for-each>
210
        </ul>
211
        </xsl:if>
212
  </xsl:template>
213

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

    
227

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

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

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

    
287

    
288
</xsl:stylesheet>