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="spatialVector">
42
      <xsl:param name="spatialvectorfirstColStyle"/>
43
      <xsl:param name="spatialvectorsubHeaderStyle"/>
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="spatialVectorcommon">
53
             <xsl:with-param name="spatialvectorfirstColStyle" select="$spatialvectorfirstColStyle"/>
54
             <xsl:with-param name="spatialvectorsubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
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="spatialVectorcommon">
62
             <xsl:with-param name="spatialvectorfirstColStyle" select="$spatialvectorfirstColStyle"/>
63
             <xsl:with-param name="spatialvectorsubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
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="spatialVectorcommon">
73
    <xsl:param name="spatialvectorfirstColStyle"/>
74
    <xsl:param name="spatialvectorsubHeaderStyle"/>
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="$spatialvectorfirstColStyle"/>
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="$spatialvectorfirstColStyle"/>
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="$spatialvectorfirstColStyle"/>
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="$spatialvectorfirstColStyle"/>
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="{$spatialvectorsubHeaderStyle}" 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="$spatialvectorfirstColStyle"/>
107
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
108
        </xsl:call-template>
109
        </td></tr>
110
     </xsl:for-each>
111

    
112
    <xsl:if test="coverage">
113
       <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
114
        Coverage Description:
115
      </td></tr>
116
    </xsl:if>
117
    <xsl:for-each select="coverage">
118
      <tr><td colspan="2">
119
        <xsl:call-template name="coverage">
120
        </xsl:call-template>
121
      </td></tr>
122
    </xsl:for-each>
123
    <xsl:if test="method">
124
       <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
125
        Method Description:
126
      </td></tr>
127
    </xsl:if>
128
    <xsl:for-each select="method">
129
      <tr><td colspan="2">
130
        <xsl:call-template name="method">
131
          <xsl:with-param name="methodfirstColStyle" select="$spatialvectorfirstColStyle"/>
132
          <xsl:with-param name="methodsubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
133
        </xsl:call-template>
134
      </td></tr>
135
    </xsl:for-each>
136
    <xsl:if test="constraint">
137
       <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
138
        Constraint:
139
      </td></tr>
140
    </xsl:if>
141
    <xsl:for-each select="constraint">
142
      <tr><td colspan="2">
143
        <xsl:call-template name="constraint">
144
          <xsl:with-param name="constraintfirstColStyle" select="$spatialvectorfirstColStyle"/>
145
        </xsl:call-template>
146
      </td></tr>
147
    </xsl:for-each>
148
    <xsl:for-each select="geometry">
149
       <tr><td class="{$spatialvectorfirstColStyle}">
150
            Geometry:
151
            </td>
152
            <td class="{$secondColStyle}">
153
              <xsl:value-of select="."/>
154
            </td>
155
       </tr>
156
    </xsl:for-each>
157
    <xsl:for-each select="geometricObjectCount">
158
       <tr><td class="{$spatialvectorfirstColStyle}">
159
            Number of Geometric Objects:
160
            </td>
161
            <td class="{$secondColStyle}">
162
              <xsl:value-of select="."/>
163
            </td>
164
       </tr>
165
    </xsl:for-each>
166
    <xsl:for-each select="topologyLevel">
167
       <tr><td class="{$spatialvectorfirstColStyle}">
168
           Topolgy Level:
169
            </td>
170
            <td class="{$secondColStyle}">
171
              <xsl:value-of select="."/>
172
            </td>
173
       </tr>
174
    </xsl:for-each>
175
    <xsl:for-each select="spatialReference">
176
       <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
177
        Spatial Reference:
178
      </td></tr>
179
      <xsl:call-template name="spatialReference">
180
        <xsl:with-param name="spatialrasterfirstColStyle" select="$spatialvectorfirstColStyle"/>
181
      </xsl:call-template>
182
    </xsl:for-each>
183
    <xsl:for-each select="horizontalAccuracy">
184
      <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
185
        Horizontal Accuracy:
186
      </td></tr>
187
      <xsl:call-template name="dataQuality">
188
        <xsl:with-param name="spatialrasterfirstColStyle" select="$spatialvectorfirstColStyle"/>
189
      </xsl:call-template>
190
    </xsl:for-each>
191
    <xsl:for-each select="verticalAccuracy">
192
      <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
193
        Vertical Accuracy:
194
      </td></tr>
195
      <xsl:call-template name="dataQuality">
196
        <xsl:with-param name="spatialrasterfirstColStyle" select="$spatialvectorfirstColStyle"/>
197
      </xsl:call-template>
198
    </xsl:for-each>
199
    <xsl:if test="$withAttributes='1'">
200
    <xsl:for-each select="attributeList">
201
      <xsl:call-template name="spatialVectorAttributeList">
202
        <xsl:with-param name="spatialvectorfirstColStyle" select="$spatialvectorfirstColStyle"/>
203
        <xsl:with-param name="spatialvectorsubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
204
        <xsl:with-param name="docid" select="$docid"/>
205
        <xsl:with-param name="entityindex" select="$entityindex"/>
206
      </xsl:call-template>
207
    </xsl:for-each>
208
    </xsl:if>
209
     <!-- Here to display distribution info-->
210
    <xsl:for-each select="physical">
211
       <xsl:call-template name="spatialVectorShowDistribution">
212
          <xsl:with-param name="docid" select="$docid"/>
213
          <xsl:with-param name="entityindex" select="$entityindex"/>
214
          <xsl:with-param name="physicalindex" select="position()"/>
215
          <xsl:with-param name="spatialvectorfirstColStyle" select="$spatialvectorfirstColStyle"/>
216
          <xsl:with-param name="spatialvectorsubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
217
       </xsl:call-template>
218
    </xsl:for-each>
219
  </xsl:template>
220

    
221
  <xsl:template name="spatialVectorShowDistribution">
222
     <xsl:param name="spatialvectorfirstColStyle"/>
223
     <xsl:param name="spatialvectorsubHeaderStyle"/>
224
     <xsl:param name="docid"/>
225
     <xsl:param name="level">entitylevel</xsl:param>
226
     <xsl:param name="entitytype">spatialVector</xsl:param>
227
     <xsl:param name="entityindex"/>
228
     <xsl:param name="physicalindex"/>
229
     <xsl:for-each select="distribution">
230
      <tr><td colspan="2">
231
        <xsl:call-template name="distribution">
232
          <xsl:with-param name="docid" select="$docid"/>
233
          <xsl:with-param name="level" select="$level"/>
234
          <xsl:with-param name="entitytype" select="$entitytype"/>
235
          <xsl:with-param name="entityindex" select="$entityindex"/>
236
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
237
          <xsl:with-param name="distributionindex" select="position()"/>
238
          <xsl:with-param name="disfirstColStyle" select="$spatialvectorfirstColStyle"/>
239
          <xsl:with-param name="dissubHeaderStyle" select="$spatialvectorsubHeaderStyle"/>
240
        </xsl:call-template>
241
      </td></tr>
242
    </xsl:for-each>
243
  </xsl:template>
244

    
245

    
246
  <xsl:template name="spatialVectorAttributeList">
247
    <xsl:param name="spatialvectorfirstColStyle"/>
248
    <xsl:param name="spatialvectorsubHeaderStyle"/>
249
    <xsl:param name="docid"/>
250
    <xsl:param name="entitytype">spatialVector</xsl:param>
251
    <xsl:param name="entityindex"/>
252
    <tr><td class="{$spatialvectorsubHeaderStyle}" colspan="2">
253
        <xsl:text>Attribute(s) Info:</xsl:text>
254
    </td></tr>
255
    <tr><td colspan="2">
256
         <xsl:call-template name="attributelist">
257
           <xsl:with-param name="docid" select="$docid"/>
258
           <xsl:with-param name="entitytype" select="$entitytype"/>
259
           <xsl:with-param name="entityindex" select="$entityindex"/>
260
         </xsl:call-template>
261
       </td>
262
    </tr>
263
  </xsl:template>
264

    
265

    
266

    
267
</xsl:stylesheet>
(23-23/27)