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: cjones $'
10
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
11
  * '$Revision: 3094 $'
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
      <table class="{$tabledefaultStyle}">
47
        <xsl:choose>
48
         <xsl:when test="references!=''">
49
          <xsl:variable name="ref_id" select="references"/>
50
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
51
          <xsl:for-each select="$references">
52
            <xsl:call-template name="datatablecommon">
53
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
54
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
55
             <xsl:with-param name="docid" select="$docid"/>
56
             <xsl:with-param name="entityindex" select="$entityindex"/>
57
            </xsl:call-template>
58
          </xsl:for-each>
59
        </xsl:when>
60
        <xsl:otherwise>
61
          <xsl:call-template name="datatablecommon">
62
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
63
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
64
             <xsl:with-param name="docid" select="$docid"/>
65
             <xsl:with-param name="entityindex" select="$entityindex"/>
66
          </xsl:call-template>
67
         </xsl:otherwise>
68
      </xsl:choose>
69
      </table>
70
  </xsl:template>
71

    
72
  <xsl:template name="datatablecommon">
73
    <xsl:param name="datatablefirstColStyle"/>
74
    <xsl:param name="datatablesubHeaderStyle"/>
75
    <xsl:param name="docid"/>
76
    <xsl:param name="entityindex"/>
77
    <xsl:for-each select="entityName">
78
       <xsl:call-template name="entityName">
79
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
80
       </xsl:call-template>
81
    </xsl:for-each>
82
    <xsl:for-each select="alternateIdentifier">
83
       <xsl:call-template name="entityalternateIdentifier">
84
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
85
       </xsl:call-template>
86
    </xsl:for-each>
87
    <xsl:for-each select="entityDescription">
88
       <xsl:call-template name="entityDescription">
89
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
90
       </xsl:call-template>
91
    </xsl:for-each>
92
    <xsl:for-each select="additionalInfo">
93
       <xsl:call-template name="entityadditionalInfo">
94
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
95
       </xsl:call-template>
96
    </xsl:for-each>
97
    <!-- call physical moduel without show distribution(we want see it later)-->
98
    <xsl:if test="physical">
99
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
100
        Physical Structure Description:
101
      </td></tr>
102
    </xsl:if>
103
    <xsl:for-each select="physical">
104
       <tr><td colspan="2">
105
        <xsl:call-template name="physical">
106
         <xsl:with-param name="physicalfirstColStyle" select="$datatablefirstColStyle"/>
107
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
108
        </xsl:call-template>
109
       </td></tr>
110
    </xsl:for-each>
111

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

    
180

    
181

    
182

    
183
  <xsl:template name="datatablecaseSensitive">
184
       <xsl:param name="datatablefirstColStyle"/>
185
       <tr><td class="{$datatablefirstColStyle}">
186
       Case Sensitive?</td><td class="{$secondColStyle}">
187
       <xsl:value-of select="."/></td></tr>
188

    
189
  </xsl:template>
190

    
191
  <xsl:template name="datatablenumberOfRecords">
192
       <xsl:param name="datatablefirstColStyle"/>
193
       <tr><td class="{$datatablefirstColStyle}">
194
            Number Of Records:</td><td class="{$secondColStyle}">
195
       <xsl:value-of select="."/></td></tr>
196
  </xsl:template>
197

    
198
  <xsl:template name="showdistribution">
199
     <xsl:param name="datatablefirstColStyle"/>
200
     <xsl:param name="datatablesubHeaderStyle"/>
201
     <xsl:param name="docid"/>
202
     <xsl:param name="level">entitylevel</xsl:param>
203
     <xsl:param name="entitytype">dataTable</xsl:param>
204
     <xsl:param name="entityindex"/>
205
     <xsl:param name="physicalindex"/>
206

    
207
    <xsl:for-each select="distribution">
208
      <tr><td colspan="2">
209
        <xsl:call-template name="distribution">
210
          <xsl:with-param name="docid" select="$docid"/>
211
          <xsl:with-param name="level" select="$level"/>
212
          <xsl:with-param name="entitytype" select="$entitytype"/>
213
          <xsl:with-param name="entityindex" select="$entityindex"/>
214
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
215
          <xsl:with-param name="distributionindex" select="position()"/>
216
          <xsl:with-param name="disfirstColStyle" select="$datatablefirstColStyle"/>
217
          <xsl:with-param name="dissubHeaderStyle" select="$datatablesubHeaderStyle"/>
218
        </xsl:call-template>
219
      </td></tr>
220
    </xsl:for-each>
221
  </xsl:template>
222

    
223

    
224
  <xsl:template name="datatableattributeList">
225
    <xsl:param name="datatablefirstColStyle"/>
226
    <xsl:param name="datatablesubHeaderStyle"/>
227
    <xsl:param name="docid"/>
228
    <xsl:param name="entitytype">dataTable</xsl:param>
229
    <xsl:param name="entityindex"/>
230
    <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
231
        <xsl:text>Attribute(s) Info:</xsl:text>
232
    </td></tr>
233
    <tr><td colspan="2">
234
         <xsl:call-template name="attributelist">
235
           <xsl:with-param name="docid" select="$docid"/>
236
           <xsl:with-param name="entitytype" select="$entitytype"/>
237
           <xsl:with-param name="entityindex" select="$entityindex"/>
238
         </xsl:call-template>
239
       </td>
240
    </tr>
241
  </xsl:template>
242

    
243

    
244

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