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-06-20 10:51:59 -0700 (Fri, 20 Jun 2003) $'
11
  * '$Revision: 1673 $'
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 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="entityDescription">
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
    <tr><td colspan="2">
101
      <xsl:for-each select="physical">
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
      </xsl:for-each>
107
    </td></tr>
108
    <xsl:for-each select="caseSensitive">
109
       <xsl:call-template name="datatablecaseSensitive">
110
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
111
       </xsl:call-template>
112
    </xsl:for-each>
113
    <xsl:for-each select="numberOfRecords">
114
       <xsl:call-template name="datatablenumberOfRecords">
115
          <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
116
       </xsl:call-template>
117
    </xsl:for-each>
118
    <xsl:if test="coverage">
119
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
120
        Coverage Description
121
      </td></tr>
122
    </xsl:if>
123
    <xsl:for-each select="coverage">
124
      <tr><td colspan="2">
125
        <xsl:call-template name="coverage">
126
        </xsl:call-template>
127
      </td></tr>
128
    </xsl:for-each>
129
    <xsl:if test="method">
130
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
131
        Method Description
132
      </td></tr>
133
    </xsl:if>
134
    <xsl:for-each select="method">
135
      <tr><td colspan="2">
136
        <xsl:call-template name="method">
137
          <xsl:with-param name="methodfirstColStyle" select="$datatablefirstColStyle"/>
138
          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
139
        </xsl:call-template>
140
      </td></tr>
141
    </xsl:for-each>
142
    <xsl:if test="constraint">
143
       <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
144
        Constraint
145
       </td></tr>
146
    </xsl:if>
147
    <xsl:for-each select="constraint">
148
      <tr><td colspan="2">
149
        <xsl:call-template name="constraint">
150
          <xsl:with-param name="constraintfirstColStyle" select="$datatablefirstColStyle"/>
151
        </xsl:call-template>
152
      </td></tr>
153
    </xsl:for-each>
154
     <xsl:for-each select="attributeList">
155
      <xsl:call-template name="datatableattributeList">
156
        <xsl:with-param name="datatablefirstColStyle" select="$datatablefirstColStyle"/>
157
        <xsl:with-param name="datatablesubHeaderStyle" select="$datatablesubHeaderStyle"/>  
158
        <xsl:with-param name="docid" select="$docid"/>
159
        <xsl:with-param name="entityindex" select="$entityindex"/>
160
      </xsl:call-template>
161
    </xsl:for-each>
162
     <!-- Here to display distribution info-->
163
    <xsl:for-each select="physical">
164
       <xsl:call-template name="showdistribution">
165
          <xsl:with-param name="docid" select="$docid"/>
166
          <xsl:with-param name="entityindex" select="$entityindex"/>
167
          <xsl:with-param name="physicalindex" select="position()"/>
168
          <xsl:with-param name="disfirstColStyle" select="$datatablefirstColStyle"/>
169
          <xsl:with-param name="dissubHeaderStyle" select="$datatablesubHeaderStyle"/>
170
       </xsl:call-template>
171
    </xsl:for-each>
172
  </xsl:template>
173

    
174

    
175
  
176

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

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

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

    
239
</xsl:stylesheet>
(11-11/33)