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:54:57 -0700 (Fri, 20 Jun 2003) $'
11
  * '$Revision: 1677 $'
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="view">
39
      <xsl:param name="viewfirstColStyle"/>
40
      <xsl:param name="viewsubHeaderStyle"/>
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="viewCommon">
50
             <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
51
             <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>  
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="viewCommon">
59
             <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
60
             <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>  
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="viewCommon">
70
    <xsl:param name="viewfirstColStyle"/>
71
    <xsl:param name="viewsubHeaderStyle"/>
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="$viewfirstColStyle"/>
77
       </xsl:call-template>
78
    </xsl:for-each>
79
    <xsl:for-each select="queryStatement">
80
       <tr><td width="{$firstColWidth}" class="{$spatialfirstColStyle}">
81
            Query Statement
82
            </td>
83
            <td width="{$secondColWidth}" class="{$secondColStyle}">
84
            <xsl:value-of select="."/>
85
            </td>
86
       </tr>
87
    </xsl:for-each>
88
    <xsl:for-each select="alternateIdentifier">
89
       <xsl:call-template name="entityalternateIdentifier">
90
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
91
       </xsl:call-template>
92
    </xsl:for-each>
93
    <xsl:for-each select="entityDescription">
94
       <xsl:call-template name="entityDescription">
95
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
96
       </xsl:call-template>
97
    </xsl:for-each>
98
    <xsl:for-each select="additionalInfo">
99
       <xsl:call-template name="entityDescription">
100
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
101
       </xsl:call-template>
102
    </xsl:for-each>
103
    <!-- call physical moduel without show distribution(we want see it later)-->
104
    <xsl:if test="physical">
105
       <tr><td class="{$spatialrasterHeaderStyle}" colspan="2">
106
        Physical Structure Description
107
      </td></tr>
108
    </xsl:if>
109
    <tr><td colspan="2">
110
      <xsl:for-each select="physical">
111
        <xsl:call-template name="physical">
112
         <xsl:with-param name="physicalfirstColStyle" select="$viewfirstColStyle"/>
113
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
114
        </xsl:call-template>
115
      </xsl:for-each>
116
    </td></tr>
117
    <xsl:if test="coverage">
118
       <tr><td class="{$spatialrasterHeaderStyle}" colspan="2">
119
        Coverage Description
120
      </td></tr>
121
    </xsl:if>
122
    <xsl:for-each select="coverage">
123
      <tr><td colspan="2">
124
        <xsl:call-template name="coverage">
125
        </xsl:call-template>
126
      </td></tr>
127
    </xsl:for-each>
128
    <xsl:if test="method">
129
       <tr><td class="{$spatialrasterHeaderStyle}" colspan="2">
130
        Method Description
131
      </td></tr>
132
    </xsl:if>
133
    <xsl:for-each select="method">
134
      <tr><td colspan="2">
135
        <xsl:call-template name="method">
136
          <xsl:with-param name="methodfirstColStyle" select="$viewfirstColStyle"/>
137
          <xsl:with-param name="methodsubHeaderStyle" select="$datatablesubHeaderStyle"/>
138
        </xsl:call-template>
139
      </td></tr>
140
    </xsl:for-each>
141
    <xsl:if test="constraint">
142
       <tr><td class="{$spatialrasterHeaderStyle}" colspan="2">
143
        Constraint
144
      </td></tr>
145
    </xsl:if>
146
    <xsl:for-each select="constraint">
147
      <tr><td colspan="2">
148
        <xsl:call-template name="constraint">
149
          <xsl:with-param name="constraintfirstColStyle" select="$viewfirstColStyle"/>
150
        </xsl:call-template>
151
      </td></tr>
152
    </xsl:for-each>
153
    <xsl:for-each select="attributeList">
154
      <xsl:call-template name="viewAttributeList">
155
        <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
156
        <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>  
157
        <xsl:with-param name="docid" select="$docid"/>
158
        <xsl:with-param name="entityindex" select="$entityindex"/>
159
      </xsl:call-template>
160
    </xsl:for-each>
161
     <!-- Here to display distribution info-->
162
    <xsl:for-each select="physical">
163
       <xsl:call-template name="viewShowDistribution">
164
          <xsl:with-param name="docid" select="$docid"/>
165
          <xsl:with-param name="entityindex" select="$entityindex"/>
166
          <xsl:with-param name="physicalindex" select="position()"/>
167
          <xsl:with-param name="disfirstColStyle" select="$viewfirstColStyle"/>
168
          <xsl:with-param name="dissubHeaderStyle" select="$spatialrasterHeaderStyle"/>
169
       </xsl:call-template>
170
    </xsl:for-each>
171
  </xsl:template>
172
 
173
  <xsl:template name="viewShowDistribution">
174
     <xsl:param name="viewfirstColStyle"/>
175
     <xsl:param name="storedprocedureHeaderStyle"/>
176
     <xsl:param name="docid"/>
177
     <xsl:param name="level">entitylevel</xsl:param>
178
     <xsl:param name="entitytype">view</xsl:param>
179
     <xsl:param name="entityindex"/>
180
     <xsl:param name="physicalindex"/>
181
     <xsl:for-each select="distribution">
182
      <tr><td colspan="2">
183
        <xsl:call-template name="distribution">
184
          <xsl:with-param name="docid" select="$docid"/>
185
          <xsl:with-param name="level" select="$level"/>
186
          <xsl:with-param name="entitytype" select="$entitytype"/>
187
          <xsl:with-param name="entityindex" select="$entityindex"/>
188
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
189
          <xsl:with-param name="distributionindex" select="position()"/>
190
          <xsl:with-param name="disfirstColStyle" select="$viewfirstColStyle"/>
191
          <xsl:with-param name="dissubHeaderStyle" select="$spatialrasterHeaderStyle"/>
192
        </xsl:call-template>
193
      </td></tr>
194
    </xsl:for-each>
195
  </xsl:template>
196
  
197
  
198
  <xsl:template name="viewAttributeList">
199
    <xsl:param name="viewfirstColStyle"/>
200
    <xsl:param name="viewsubHeaderStyle"/>
201
    <xsl:param name="docid"/>
202
    <xsl:param name="entitytype">view</xsl:param>
203
    <xsl:param name="entityindex"/>
204
    <tr><td class="{$spatialrasterHeaderStyle}" colspan="2">
205
        <xsl:text>Attribute Info:</xsl:text>
206
    </td></tr>
207
    <tr><td colspan="2">
208
         <xsl:call-template name="attributelist">
209
           <xsl:with-param name="docid" select="$docid"/>
210
           <xsl:with-param name="entitytype" select="$entitytype"/>
211
           <xsl:with-param name="entityindex" select="$entityindex"/>
212
         </xsl:call-template>
213
       </td>
214
    </tr>
215
  </xsl:template>
216
  
217
  
218

    
219
</xsl:stylesheet>
(30-30/33)