Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
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 10:35:23 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 7998 $'
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-file.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

    
35
  <xsl:output method="html" encoding="iso-8859-1"
36
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
37
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
38
              indent="yes" />  
39
  <!-- This module is for datatable module-->
40

    
41
  <xsl:template name="dataTable">
42
      <xsl:param name="datatablefirstColStyle"/>
43
      <xsl:param name="datatablesubHeaderStyle"/>
44
      <xsl:param name="docid"/>
45
      <xsl:param name="entityindex"/>
46
      
47
      <!-- start the data Table -->
48
      <div class="dataTableContainer">
49
      
50
        <xsl:choose>
51
         <xsl:when test="references!=''">
52
          <xsl:variable name="ref_id" select="references"/>
53
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
54
          <xsl:for-each select="$references">
55
            <xsl:call-template name="datatablecommon">
56
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
57
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
58
             <xsl:with-param name="docid" select="$docid"/>
59
             <xsl:with-param name="entityindex" select="$entityindex"/>
60
            </xsl:call-template>
61
          </xsl:for-each>
62
        </xsl:when>
63
        <xsl:otherwise>
64
          <xsl:call-template name="datatablecommon">
65
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
66
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
67
             <xsl:with-param name="docid" select="$docid"/>
68
             <xsl:with-param name="entityindex" select="$entityindex"/>
69
          </xsl:call-template>
70
         </xsl:otherwise>
71
      </xsl:choose>
72
      
73
	</div>
74

    
75
  </xsl:template>
76

    
77
  <xsl:template name="datatablecommon">
78
    <xsl:param name="datatablefirstColStyle"/>
79
    <xsl:param name="datatablesubHeaderStyle"/>
80
    <xsl:param name="docid"/>
81
    <xsl:param name="entityindex"/>
82
    <xsl:for-each select="entityName">
83
       <xsl:call-template name="entityName">
84
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
85
       </xsl:call-template>
86
    </xsl:for-each>
87
    <xsl:for-each select="alternateIdentifier">
88
       <xsl:call-template name="entityalternateIdentifier">
89
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
90
       </xsl:call-template>
91
    </xsl:for-each>
92
    <xsl:for-each select="entityDescription">
93
       <xsl:call-template name="entityDescription">
94
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
95
       </xsl:call-template>
96
    </xsl:for-each>
97
    <xsl:for-each select="additionalInfo">
98
       <xsl:call-template name="entityadditionalInfo">
99
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
100
       </xsl:call-template>
101
    </xsl:for-each>
102
    
103
    <!-- call physical module without show distribution(we want see it later)-->
104
    <xsl:if test="physical">
105
       <h4>Physical Structure Description</h4>
106
    </xsl:if>
107
    
108
    <!-- Display physical information -->
109
    <xsl:for-each select="physical">
110
        <xsl:call-template name="physical">
111
         <xsl:with-param name="physicalfirstColStyle" select="$datatablefirstColStyle"/>
112
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
113
        </xsl:call-template>
114
    </xsl:for-each>
115
    
116
    <xsl:for-each select="caseSensitive">
117
       <xsl:call-template name="datatablecaseSensitive">
118
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
119
       </xsl:call-template>
120
    </xsl:for-each>
121
    
122
    <xsl:for-each select="numberOfRecords">
123
       <xsl:call-template name="datatablenumberOfRecords">
124
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
125
       </xsl:call-template>
126
    </xsl:for-each>
127
    
128
	<!-- Display distribution info-->
129
    <xsl:for-each select="physical">
130
       <xsl:call-template name="showdistribution">
131
          <xsl:with-param name="docid" select="$docid"/>
132
          <xsl:with-param name="entityindex" select="$entityindex"/>
133
          <xsl:with-param name="physicalindex" select="position()"/>
134
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
135
          <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
136
       </xsl:call-template>
137
    </xsl:for-each>
138
    
139
    <xsl:if test="coverage">
140
		<div class="control-group">
141
			<label class="control-label">Coverage Description</label>
142
			<div class="controls controls-well">
143
				<xsl:for-each select="coverage">
144
			        <xsl:call-template name="coverage">
145
			        </xsl:call-template>
146
			    </xsl:for-each>
147
			</div>
148
		</div>
149
    </xsl:if>
150
    
151
    <xsl:if test="method">
152
		<div class="control-group">
153
			<label class="control-label">Method Description</label>
154
			<div class="controls controls-well">
155
				<xsl:for-each select="method">
156
			        <xsl:call-template name="method">
157
			          <xsl:with-param name="methodfirstColStyle" select="$datatablefirstColStyle"/>
158
			          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
159
			        </xsl:call-template>
160
			    </xsl:for-each>
161
			</div>
162
		</div>
163
    </xsl:if>
164
    
165
    <xsl:if test="constraint">
166
		<div class="control-group">
167
			<label class="control-label">Constraint</label>
168
			<div>
169
				<xsl:for-each select="constraint">
170
			        <xsl:call-template name="constraint">
171
			          <xsl:with-param name="constraintfirstColStyle" select="$datatablefirstColStyle"/>
172
			        </xsl:call-template>
173
			    </xsl:for-each>
174
			</div>
175
		</div>			
176
    </xsl:if>
177
    
178
     <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
179
      <xsl:for-each select="attributeList">
180
       <xsl:call-template name="datatableattributeList">
181
         <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
182
         <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
183
         <xsl:with-param name="docid" select="$docid"/>
184
         <xsl:with-param name="entityindex" select="$entityindex"/>
185
       </xsl:call-template>
186
      </xsl:for-each>
187
     </xsl:if>
188
     
189
  </xsl:template>
190

    
191
  <xsl:template name="datatablecaseSensitive">
192
	<xsl:param name="datatablefirstColStyle"/>
193
	<div class="control-group">
194
       	<label class="control-label">Case Sensitive?</label>
195
       	<div class="controls controls-well">
196
       		<xsl:value-of select="."/>
197
       	</div>
198
	</div>
199

    
200
  </xsl:template>
201

    
202
  <xsl:template name="datatablenumberOfRecords">
203
	<xsl:param name="datatablefirstColStyle"/>
204
	<div class="control-group">
205
		<label class="control-label">Number Of Records</label>
206
		<div class="controls controls-well">
207
       		<xsl:value-of select="."/>
208
       	</div>
209
	</div>
210
  </xsl:template>
211

    
212
  <xsl:template name="showdistribution">
213
     <xsl:param name="datatablefirstColStyle"/>
214
     <xsl:param name="datatablesubHeaderStyle"/>
215
     <xsl:param name="docid"/>
216
     <xsl:param name="level">entitylevel</xsl:param>
217
     <xsl:param name="entitytype">dataTable</xsl:param>
218
     <xsl:param name="entityindex"/>
219
     <xsl:param name="physicalindex"/>
220

    
221
    <xsl:for-each select="distribution">
222
      
223
        <xsl:call-template name="distribution">
224
          <xsl:with-param name="docid" select="$docid"/>
225
          <xsl:with-param name="level" select="$level"/>
226
          <xsl:with-param name="entitytype" select="$entitytype"/>
227
          <xsl:with-param name="entityindex" select="$entityindex"/>
228
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
229
          <xsl:with-param name="distributionindex" select="position()"/>
230
          <xsl:with-param name="disfirstColStyle" select="$datatablefirstColStyle"/>
231
          <xsl:with-param name="dissubHeaderStyle" select="$datatablesubHeaderStyle"/>
232
        </xsl:call-template>
233
        
234
      
235
    </xsl:for-each>
236
  </xsl:template>
237

    
238

    
239
  <xsl:template name="datatableattributeList">
240
    <xsl:param name="datatablefirstColStyle"/>
241
    <xsl:param name="datatablesubHeaderStyle"/>
242
    <xsl:param name="docid"/>
243
    <xsl:param name="entitytype">dataTable</xsl:param>
244
    <xsl:param name="entityindex"/>
245
    
246
    <h4>Attribute Information</h4>
247
    <div class="attributeList">
248
         <xsl:call-template name="attributelist">
249
           <xsl:with-param name="docid" select="$docid"/>
250
           <xsl:with-param name="entitytype" select="$entitytype"/>
251
           <xsl:with-param name="entityindex" select="$entityindex"/>
252
         </xsl:call-template>
253
    </div>
254
    
255
  </xsl:template>
256

    
257

    
258

    
259
</xsl:stylesheet>
(8-8/27)