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

    
172

    
173
  
174

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

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

    
190
  <xsl:template name="showdistribution">
191
     <xsl:param name="datatablefirstColStyle"/>
192
     <xsl:param name="datatablesubHeaderStyle"/>
193
     <xsl:param name="docid"/>
194
     <xsl:param name="level">entitylevel</xsl:param>
195
     <xsl:param name="entitytype">dataTable</xsl:param>
196
     <xsl:param name="entityindex"/>
197
     <xsl:param name="physicalindex"/>
198
     
199
    <xsl:for-each select="distribution">
200
      <tr><td colspan="2">
201
        <xsl:call-template name="distribution">
202
          <xsl:with-param name="docid" select="$docid"/>
203
          <xsl:with-param name="level" select="$level"/>
204
          <xsl:with-param name="entitytype" select="$entitytype"/>
205
          <xsl:with-param name="entityindex" select="$entityindex"/>
206
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
207
          <xsl:with-param name="distributionindex" select="position()"/>
208
          <xsl:with-param name="disfirstColStyle" select="$datatablefirstColStyle"/>
209
          <xsl:with-param name="dissubHeaderStyle" select="$datatablesubHeaderStyle"/>
210
        </xsl:call-template>
211
      </td></tr>
212
    </xsl:for-each>
213
  </xsl:template>
214
  
215
  
216
  <xsl:template name="datatableattributeList">
217
    <xsl:param name="datatablefirstColStyle"/>
218
    <xsl:param name="datatablesubHeaderStyle"/>
219
    <xsl:param name="docid"/>
220
    <xsl:param name="entitytype">dataTable</xsl:param>
221
    <xsl:param name="entityindex"/>
222
    <tr><td class="{$datatablesubHeaderStyle}" colspan="2">
223
        <xsl:text>Attribute Info:</xsl:text>
224
    </td></tr>
225
    <tr><td width="{$firstColWidth}" class="{$datatablefirstColStyle}">
226
          <xsl:text>&#160;</xsl:text></td>
227
        <td width="{$secondColWidth}" class="{$secondColStyle}">
228
         <a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=attribute&amp;entitytype=<xsl:value-of select="$entitytype"/>&amp;entityindex=<xsl:value-of select="$entityindex"/></xsl:attribute>
229
         <br>Attribute List</br></a>
230
       </td>
231
    </tr>
232
  </xsl:template>
233
  
234
  
235

    
236
</xsl:stylesheet>
(11-11/27)