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: tao $'
10
  *     '$Date: 2003-07-16 17:53:03 -0700 (Wed, 16 Jul 2003) $'
11
  * '$Revision: 1732 $'
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
  <!-- This module is for datatable module-->
37
  
38
  <xsl:template name="dataTable">
39
      <xsl:param name="datatablefirstColStyle"/>
40
      <xsl:param name="datatablesubHeaderStyle"/>
41
      <xsl:param name="docid"/>
42
      <xsl:param name="entityindex"/>
43
      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
44
        <xsl:choose>
45
         <xsl:when test="references!=''">
46
          <xsl:variable name="ref_id" select="references"/>
47
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
48
          <xsl:for-each select="$references">
49
            <xsl:call-template name="datatablecommon">
50
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
51
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>  
52
             <xsl:with-param name="docid" select="$docid"/>
53
             <xsl:with-param name="entityindex" select="$entityindex"/>
54
            </xsl:call-template>
55
          </xsl:for-each>
56
        </xsl:when>
57
        <xsl:otherwise>
58
          <xsl:call-template name="datatablecommon">
59
             <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
60
             <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>  
61
             <xsl:with-param name="docid" select="$docid"/>
62
             <xsl:with-param name="entityindex" select="$entityindex"/>
63
          </xsl:call-template>
64
         </xsl:otherwise>
65
      </xsl:choose>
66
      </table>
67
  </xsl:template>
68
  
69
  <xsl:template name="datatablecommon">
70
    <xsl:param name="datatablefirstColStyle"/>
71
    <xsl:param name="datatablesubHeaderStyle"/>
72
    <xsl:param name="docid"/>
73
    <xsl:param name="entityindex"/>
74
    <xsl:for-each select="entityName">
75
       <xsl:call-template name="entityName">
76
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
77
       </xsl:call-template>
78
    </xsl:for-each>
79
    <xsl:for-each select="alternateIdentifier">
80
       <xsl:call-template name="entityalternateIdentifier">
81
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
82
       </xsl:call-template>
83
    </xsl:for-each>
84
    <xsl:for-each select="entityDescription">
85
       <xsl:call-template name="entityDescription">
86
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
87
       </xsl:call-template>
88
    </xsl:for-each>
89
    <xsl:for-each select="additionalInfo">
90
       <xsl:call-template name="entityadditionalInfo">
91
          <xsl:with-param name="entityfirstColStyle" select="$datatablefirstColStyle"/>
92
       </xsl:call-template>
93
    </xsl:for-each>
94
    <!-- call physical moduel without show distribution(we want see it later)-->
95
    <xsl:if test="physical">
96
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
97
        Physical Structure Description:
98
      </td></tr>
99
    </xsl:if>
100
    <xsl:for-each select="physical">
101
       <tr><td colspan="2">
102
        <xsl:call-template name="physical">
103
         <xsl:with-param name="physicalfirstColStyle" select="$datatablefirstColStyle"/>
104
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
105
        </xsl:call-template>
106
       </td></tr>
107
    </xsl:for-each>
108
 
109
    <xsl:for-each select="caseSensitive">
110
       <xsl:call-template name="datatablecaseSensitive">
111
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
112
       </xsl:call-template>
113
    </xsl:for-each>
114
    <xsl:for-each select="numberOfRecords">
115
       <xsl:call-template name="datatablenumberOfRecords">
116
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
117
       </xsl:call-template>
118
    </xsl:for-each>
119
    <xsl:if test="coverage">
120
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
121
        Coverage Description:
122
      </td></tr>
123
    </xsl:if>
124
    <xsl:for-each select="coverage">
125
      <tr><td colspan="2">
126
        <xsl:call-template name="coverage">
127
        </xsl:call-template>
128
      </td></tr>
129
    </xsl:for-each>
130
    <xsl:if test="method">
131
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
132
        Method Description:
133
      </td></tr>
134
    </xsl:if>
135
    <xsl:for-each select="method">
136
      <tr><td colspan="2">
137
        <xsl:call-template name="method">
138
          <xsl:with-param name="methodfirstColStyle" select="$datatablefirstColStyle"/>
139
          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
140
        </xsl:call-template>
141
      </td></tr>
142
    </xsl:for-each>
143
    <xsl:if test="constraint">
144
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
145
        Constraint:
146
       </td></tr>
147
    </xsl:if>
148
    <xsl:for-each select="constraint">
149
      <tr><td colspan="2">
150
        <xsl:call-template name="constraint">
151
          <xsl:with-param name="constraintfirstColStyle" select="$datatablefirstColStyle"/>
152
        </xsl:call-template>
153
      </td></tr>
154
    </xsl:for-each>
155
     <xsl:for-each select="attributeList">
156
      <xsl:call-template name="datatableattributeList">
157
        <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
158
        <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>  
159
        <xsl:with-param name="docid" select="$docid"/>
160
        <xsl:with-param name="entityindex" select="$entityindex"/>
161
      </xsl:call-template>
162
    </xsl:for-each>
163
     <!-- Here to display distribution info-->
164
    <xsl:for-each select="physical">
165
       <xsl:call-template name="showdistribution">
166
          <xsl:with-param name="docid" select="$docid"/>
167
          <xsl:with-param name="entityindex" select="$entityindex"/>
168
          <xsl:with-param name="physicalindex" select="position()"/>
169
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
170
          <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>
171
       </xsl:call-template>
172
    </xsl:for-each>
173
  </xsl:template>
174

    
175

    
176
  
177

    
178
  <xsl:template name="datatablecaseSensitive">
179
       <xsl:param name="datatablefirstColStyle"/>
180
       <tr><td width="{$firstColWidth}" class="{$datatablefirstColStyle}">
181
       Case Sensitive?</td><td width="{$secondColWidth}" class="{$secondColStyle}">
182
       <xsl:value-of select="."/></td></tr>
183
      
184
  </xsl:template>
185

    
186
  <xsl:template name="datatablenumberOfRecords">
187
       <xsl:param name="datatablefirstColStyle"/>
188
       <tr><td width="{$firstColWidth}" class="{$datatablefirstColStyle}">
189
            Number Of Records:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
190
       <xsl:value-of select="."/></td></tr>
191
  </xsl:template>
192

    
193
  <xsl:template name="showdistribution">
194
     <xsl:param name="datatablefirstColStyle"/>
195
     <xsl:param name="datatablesubHeaderStyle"/>
196
     <xsl:param name="docid"/>
197
     <xsl:param name="level">entitylevel</xsl:param>
198
     <xsl:param name="entitytype">dataTable</xsl:param>
199
     <xsl:param name="entityindex"/>
200
     <xsl:param name="physicalindex"/>
201
     
202
    <xsl:for-each select="distribution">
203
      <tr><td colspan="2">
204
        <xsl:call-template name="distribution">
205
          <xsl:with-param name="docid" select="$docid"/>
206
          <xsl:with-param name="level" select="$level"/>
207
          <xsl:with-param name="entitytype" select="$entitytype"/>
208
          <xsl:with-param name="entityindex" select="$entityindex"/>
209
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
210
          <xsl:with-param name="distributionindex" select="position()"/>
211
          <xsl:with-param name="disfirstColStyle" select="$datatablefirstColStyle"/>
212
          <xsl:with-param name="dissubHeaderStyle" select="$datatablesubHeaderStyle"/>
213
        </xsl:call-template>
214
      </td></tr>
215
    </xsl:for-each>
216
  </xsl:template>
217
  
218
  
219
  <xsl:template name="datatableattributeList">
220
    <xsl:param name="datatablefirstColStyle"/>
221
    <xsl:param name="datatablesubHeaderStyle"/>
222
    <xsl:param name="docid"/>
223
    <xsl:param name="entitytype">dataTable</xsl:param>
224
    <xsl:param name="entityindex"/>
225
    <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
226
        <xsl:text>Attribute(s) Info:</xsl:text>
227
    </td></tr>
228
    <tr><td colspan="2">
229
         <xsl:call-template name="attributelist">
230
           <xsl:with-param name="docid" select="$docid"/>
231
           <xsl:with-param name="entitytype" select="$entitytype"/>
232
           <xsl:with-param name="entityindex" select="$entityindex"/>
233
         </xsl:call-template>
234
       </td>
235
    </tr>
236
  </xsl:template>
237
  
238
  
239

    
240
</xsl:stylesheet>
(11-11/30)