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

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

    
247

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

    
267

    
268

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