Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-datatable.xsl @ 10145

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 13:17:24 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 8005 $'
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="UTF-8"
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
    <!-- Display physical information, with distribution details -->
104
    <xsl:for-each select="physical">
105
        <xsl:call-template name="physical">
106
         <xsl:with-param name="physicalfirstColStyle" select="$datatablefirstColStyle"/>
107
         <xsl:with-param name="notshowdistribution"></xsl:with-param>
108
        </xsl:call-template>
109
    </xsl:for-each>
110
    
111
    <xsl:for-each select="caseSensitive">
112
       <xsl:call-template name="datatablecaseSensitive">
113
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
114
       </xsl:call-template>
115
    </xsl:for-each>
116
    
117
    <xsl:for-each select="numberOfRecords">
118
       <xsl:call-template name="datatablenumberOfRecords">
119
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
120
       </xsl:call-template>
121
    </xsl:for-each>
122
    
123
	<!-- Display distribution info -->
124
	<!-- NOTE: showing this as part of the physical section now -->
125
	<!--
126
    <xsl:for-each select="physical">
127
       <xsl:call-template name="showdistribution">
128
          <xsl:with-param name="docid" select="$docid"/>
129
          <xsl:with-param name="entityindex" select="$entityindex"/>
130
          <xsl:with-param name="physicalindex" select="position()"/>
131
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
132
          <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
133
       </xsl:call-template>
134
    </xsl:for-each>
135
    -->
136
    
137
    <xsl:if test="coverage">
138
		<div class="control-group">
139
			<label class="control-label">Coverage Description</label>
140
			<div class="controls controls-well">
141
				<xsl:for-each select="coverage">
142
			        <xsl:call-template name="coverage">
143
			        </xsl:call-template>
144
			    </xsl:for-each>
145
			</div>
146
		</div>
147
    </xsl:if>
148
    
149
    <xsl:if test="method">
150
		<div class="control-group">
151
			<label class="control-label">Method Description</label>
152
			<div class="controls controls-well">
153
				<xsl:for-each select="method">
154
			        <xsl:call-template name="method">
155
			          <xsl:with-param name="methodfirstColStyle" select="$datatablefirstColStyle"/>
156
			          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
157
			        </xsl:call-template>
158
			    </xsl:for-each>
159
			</div>
160
		</div>
161
    </xsl:if>
162
    
163
    <xsl:if test="constraint">
164
		<div class="control-group">
165
			<label class="control-label">Constraint</label>
166
			<div>
167
				<xsl:for-each select="constraint">
168
			        <xsl:call-template name="constraint">
169
			          <xsl:with-param name="constraintfirstColStyle" select="$datatablefirstColStyle"/>
170
			        </xsl:call-template>
171
			    </xsl:for-each>
172
			</div>
173
		</div>			
174
    </xsl:if>
175
    
176
     <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
177
      <xsl:for-each select="attributeList">
178
       <xsl:call-template name="datatableattributeList">
179
         <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
180
         <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
181
         <xsl:with-param name="docid" select="$docid"/>
182
         <xsl:with-param name="entityindex" select="$entityindex"/>
183
       </xsl:call-template>
184
      </xsl:for-each>
185
     </xsl:if>
186
     
187
  </xsl:template>
188

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

    
198
  </xsl:template>
199

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

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

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

    
236

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

    
255

    
256

    
257
</xsl:stylesheet>