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:21:39 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 7997 $'
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
    <!-- call physical module without show distribution(we want see it later)-->
103
    <xsl:if test="physical">
104
       <h4>Physical Structure Description</h4>
105
    </xsl:if>
106
    <xsl:for-each select="physical">
107
        <xsl:call-template name="physical">
108
         <xsl:with-param name="physicalfirstColStyle" select="$datatablefirstColStyle"/>
109
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
110
        </xsl:call-template>
111
    </xsl:for-each>
112

    
113
    <xsl:for-each select="caseSensitive">
114
       <xsl:call-template name="datatablecaseSensitive">
115
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
116
       </xsl:call-template>
117
    </xsl:for-each>
118
    <xsl:for-each select="numberOfRecords">
119
       <xsl:call-template name="datatablenumberOfRecords">
120
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
121
       </xsl:call-template>
122
    </xsl:for-each>
123
    
124
    <!-- Here to display distribution info-->
125
    <xsl:for-each select="physical">
126
       <xsl:call-template name="showdistribution">
127
          <xsl:with-param name="docid" select="$docid"/>
128
          <xsl:with-param name="entityindex" select="$entityindex"/>
129
          <xsl:with-param name="physicalindex" select="position()"/>
130
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
131
          <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
132
       </xsl:call-template>
133
    </xsl:for-each>
134
    
135
    <xsl:if test="coverage">
136
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
137
        Coverage Description:
138
      </td></tr>
139
    </xsl:if>
140
    <xsl:for-each select="coverage">
141
      <tr><td colspan="2">
142
        <xsl:call-template name="coverage">
143
        </xsl:call-template>
144
      </td></tr>
145
    </xsl:for-each>
146
    <xsl:if test="method">
147
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
148
        Method Description:
149
      </td></tr>
150
    </xsl:if>
151
    <xsl:for-each select="method">
152
      <tr><td colspan="2">
153
        <xsl:call-template name="method">
154
          <xsl:with-param name="methodfirstColStyle" select="$datatablefirstColStyle"/>
155
          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
156
        </xsl:call-template>
157
      </td></tr>
158
    </xsl:for-each>
159
    <xsl:if test="constraint">
160
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
161
        Constraint:
162
       </td></tr>
163
    </xsl:if>
164
    <xsl:for-each select="constraint">
165
      <tr><td colspan="2">
166
        <xsl:call-template name="constraint">
167
          <xsl:with-param name="constraintfirstColStyle" select="$datatablefirstColStyle"/>
168
        </xsl:call-template>
169
      </td></tr>
170
    </xsl:for-each>
171
     <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
172
      <xsl:for-each select="attributeList">
173
       <xsl:call-template name="datatableattributeList">
174
         <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
175
         <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
176
         <xsl:with-param name="docid" select="$docid"/>
177
         <xsl:with-param name="entityindex" select="$entityindex"/>
178
       </xsl:call-template>
179
      </xsl:for-each>
180
     </xsl:if>
181
     
182
  </xsl:template>
183

    
184

    
185

    
186

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

    
196
  </xsl:template>
197

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

    
208
  <xsl:template name="showdistribution">
209
     <xsl:param name="datatablefirstColStyle"/>
210
     <xsl:param name="datatablesubHeaderStyle"/>
211
     <xsl:param name="docid"/>
212
     <xsl:param name="level">entitylevel</xsl:param>
213
     <xsl:param name="entitytype">dataTable</xsl:param>
214
     <xsl:param name="entityindex"/>
215
     <xsl:param name="physicalindex"/>
216

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

    
234

    
235
  <xsl:template name="datatableattributeList">
236
    <xsl:param name="datatablefirstColStyle"/>
237
    <xsl:param name="datatablesubHeaderStyle"/>
238
    <xsl:param name="docid"/>
239
    <xsl:param name="entitytype">dataTable</xsl:param>
240
    <xsl:param name="entityindex"/>
241
    <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
242
        <xsl:text>Attribute(s) Info:</xsl:text>
243
    </td></tr>
244
    <tr><td colspan="2">
245
         <xsl:call-template name="attributelist">
246
           <xsl:with-param name="docid" select="$docid"/>
247
           <xsl:with-param name="entitytype" select="$entitytype"/>
248
           <xsl:with-param name="entityindex" select="$entityindex"/>
249
         </xsl:call-template>
250
       </td>
251
    </tr>
252
  </xsl:template>
253

    
254

    
255

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