Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
    <xsl:output indent="yes" method="html"/>
4
    <xsl:param name="docid"/>
5
    <xsl:param name="sessionid" select="public"/>
6

    
7
    <xsl:template match="/metadata">
8
        <html>
9
            <head>
10
                <title>FGDC Identification and Metacat Data Package Information</title>
11
            </head>
12
            <body>
13
                <xsl:apply-templates select="idinfo"/>
14
                <xsl:apply-templates select="distinfo/resdesc[text()=$docid]/ancestor::distinfo"/>
15
            </body>
16
        </html>
17
    </xsl:template>
18

    
19
    <xsl:template match="idinfo">
20
        <table width="700" border="0" cellspacing="10">
21
            <tr>
22
                <td colspan="2" align="center">
23
                    <b>FGDC Identification Information</b>
24
                </td>
25
            </tr>
26
            <xsl:apply-templates select="citation"/>
27
            <xsl:apply-templates select="descript"/>
28
            <xsl:apply-templates select="spdom"/>
29
            <xsl:apply-templates select="keywords"/>
30
        </table>
31
    </xsl:template>
32

    
33
    <xsl:template match="citation">
34
        <xsl:apply-templates select="citeinfo"/>
35
    </xsl:template>
36

    
37
    <xsl:template match="citeinfo">
38
        <tr>
39
            <td colspan="2">
40
                <b>Citation Information </b>
41
            </td>
42
        </tr>
43

    
44
        <tr>
45
            <xsl:apply-templates select="title"/>
46
        </tr>
47
        <tr>
48
            <xsl:apply-templates select="origin"/>
49
        </tr>
50
        <tr>
51
            <xsl:apply-templates select="pubdate"/>
52
        </tr>
53
        <tr>
54
            <xsl:apply-templates select="edition"/>
55
        </tr>
56
        <tr>
57
            <xsl:apply-templates select="geoform"/>
58
        </tr>
59
        <tr>
60
            <xsl:apply-templates select="pubinfo"/>
61
        </tr>
62
        <tr>
63
            <xsl:apply-templates select="othercit"/>
64
        </tr>
65
    </xsl:template>
66

    
67
    <xsl:template match="descript">
68
        <tr>
69
            <td colspan="2">
70
                <b>Description</b>
71
            </td>
72
        </tr>
73
        <tr>
74
            <xsl:apply-templates select="abstract"/>
75
        </tr>
76
        <tr>
77
            <xsl:apply-templates select="purpose"/>
78
        </tr>
79
    </xsl:template>
80

    
81
    <xsl:template match="spdom">
82
        <tr>
83
            <xsl:apply-templates select="bounding"/>
84
        </tr>
85
    </xsl:template>
86

    
87
    <xsl:template match="keywords">
88
        <tr>
89
            <xsl:apply-templates select="theme"/>
90
        </tr>
91
        <tr>
92
            <xsl:apply-templates select="place"/>
93
        </tr>
94
    </xsl:template>
95

    
96
    <xsl:template match="theme">
97
        <td valign="top">Theme Keywords</td>
98
        <td>
99
            <xsl:apply-templates select="themekey[position()!=last()]">
100
                <xsl:with-param name="lastPlace">f</xsl:with-param>
101
            </xsl:apply-templates>
102
            <xsl:apply-templates select="themekey[position()=last()]">
103
                <xsl:with-param name="lastPlace">t</xsl:with-param>
104
            </xsl:apply-templates>
105
        </td>
106
    </xsl:template>
107

    
108
    <xsl:template match="place">
109
        <td valign="top">Place Keywords</td>
110
        <td>
111
            <xsl:apply-templates select="placekey[position()!=last()]">
112
                <xsl:with-param name="lastPlace">f</xsl:with-param>
113
            </xsl:apply-templates>
114
            <xsl:apply-templates select="placekey[position()=last()]">
115
                <xsl:with-param name="lastPlace">t</xsl:with-param>
116
            </xsl:apply-templates>
117
        </td>
118
    </xsl:template>
119

    
120
    <xsl:template match="themekey">
121
        <xsl:param name="lastPlace"/>
122
        <xsl:value-of select="."/>
123
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
124
    </xsl:template>
125

    
126
    <xsl:template match="placekey">
127
        <xsl:param name="lastPlace"/>
128
        <xsl:value-of select="."/>
129
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
130
    </xsl:template>
131

    
132
    <xsl:template match="bounding">
133
        <td valign="top">Bounding Coordinates</td>
134
        <td>
135
            <table>
136
                <tr>
137
                    <td align="right">West</td>
138
                    <td>
139
                        <xsl:value-of select="westbc"/>
140
                    </td>
141
                    <td align="right">East</td>
142
                    <td>
143
                        <xsl:value-of select="eastbc"/>
144
                    </td>
145
                </tr>
146
                <tr>
147
                    <td align="right">North</td>
148
                    <td>
149
                        <xsl:value-of select="northbc"/>
150
                    </td>
151
                    <td align="right">South</td>
152
                    <td>
153
                        <xsl:value-of select="southbc"/>
154
                    </td>
155
                </tr>
156
            </table>
157
        </td>
158
    </xsl:template>
159

    
160
    <xsl:template match="abstract">
161
        <td valign="top">Abstract</td>
162
        <td>
163
            <xsl:value-of select="."/>
164
        </td>
165
    </xsl:template>
166

    
167
    <xsl:template match="purpose">
168
        <td valign="top">Purpose</td>
169
        <td>
170
            <xsl:value-of select="."/>
171
        </td>
172
    </xsl:template>
173

    
174
    <xsl:template match="title">
175
        <td>Title</td>
176
        <td>
177
            <xsl:value-of select="."/>
178
        </td>
179
    </xsl:template>
180

    
181
    <xsl:template match="origin">
182
        <td>Originator </td>
183
        <td>
184
            <xsl:value-of select="."/>
185
        </td>
186
    </xsl:template>
187

    
188
    <xsl:template match="pubdate">
189
        <td>Publication Date</td>
190
        <td>
191
            <xsl:call-template name="long_date">
192
                <xsl:with-param name="date">
193
                    <xsl:value-of select="."/>
194
                </xsl:with-param>
195
            </xsl:call-template>
196
        </td>
197
    </xsl:template>
198

    
199
    <xsl:template match="edition">
200
        <td>Edition</td>
201
        <td>
202
            <xsl:value-of select="."/>
203
        </td>
204
    </xsl:template>
205

    
206
    <xsl:template match="geoform">
207
        <td valign="top">Geospatial Data Presentation Form</td>
208
        <td>
209
            <xsl:value-of select="."/>
210
        </td>
211
    </xsl:template>
212

    
213
    <xsl:template match="othercit">
214
        <td valign="top">Other Citation Details</td>
215
        <td>
216
            <xsl:value-of select="."/>
217
        </td>
218
    </xsl:template>
219

    
220
    <xsl:template match="pubinfo">
221
        <td valign="top"> Publication Information </td>
222
        <td>
223
            <table>
224
                <tr>
225
                    <xsl:apply-templates select="pubplace"/>
226
                </tr>
227
                <tr>
228
                    <xsl:apply-templates select="publish"/>
229
                </tr>
230
            </table>
231
        </td>
232
    </xsl:template>
233

    
234
    <xsl:template match="pubplace">
235
        <td>Publication Place</td>
236
        <td>
237
            <xsl:value-of select="."/>
238
        </td>
239
    </xsl:template>
240

    
241
    <xsl:template match="publish">
242
        <td>Publisher</td>
243
        <td>
244
            <xsl:value-of select="."/>
245
        </td>
246
    </xsl:template>
247

    
248
    <xsl:template match="distinfo">
249
        <table width="100%" border="0" cellspacing="10">
250
            <tr>
251
                <td colspan="3" align="center">
252
                    <b>Metacat Data Package Information</b>
253
                </td>
254
            </tr>
255
            <tr>
256
                <td>
257
                    <b>File type</b>
258
                </td>
259
                <td>
260
                    <b>File name (Doc Id)</b>
261
                </td>
262
                <xsl:if test="not($sessionid = 'null')">
263
                    <td align="center" colspan="3">
264
                        <b>Update with...</b>
265
                    </td>
266
                </xsl:if>
267
            </tr>
268
            <tr>
269
                <xsl:apply-templates select="resdesc"/>
270
            </tr>
271
            <xsl:apply-templates select="stdorder/digform/digtopt/onlinopt/computer/networka"/>
272
        </table>
273
    </xsl:template>
274

    
275
    <xsl:template match="resdesc">
276
        <td align="left">Metadata</td>
277
        <td align="left">
278
            <xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)</td>
279
        <xsl:if test="not($sessionid = 'null')">
280
            <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
281
                enctype="multipart/form-data">
282
                <td align="right">
283
                    <input name="action" value="Update Metadata" type="submit"/>
284
                    <xsl:element name="input">
285
                        <xsl:attribute name="name">docid</xsl:attribute>
286
                        <xsl:attribute name="type">hidden</xsl:attribute>
287
                        <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
288
                    </xsl:element>
289
                    <xsl:element name="input">
290
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
291
                        <xsl:attribute name="type">hidden</xsl:attribute>
292
                        <xsl:attribute name="value"><xsl:value-of select="$docid"/></xsl:attribute>
293
                    </xsl:element>
294
                </td>
295
                <td>
296
                    <input name="updateFile" type="file"/>
297
                </td>
298
            </form>
299
        </xsl:if>
300
    </xsl:template>
301

    
302
    <xsl:template match="networka">
303
        <tr>
304
            <xsl:apply-templates select="networkr"/>
305
        </tr>
306
    </xsl:template>
307

    
308
    <xsl:template match="networkr">
309
        <td align="right">Data</td>
310
        <td align="center">
311
            <xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."
312
            />) </td>
313
        <xsl:if test="not($sessionid = 'null')">
314
            <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
315
                enctype="multipart/form-data">
316
                <td align="right">
317
                    <input name="action" value="Update Data" type="submit"/>
318
                    <xsl:element name="input">
319
                        <xsl:attribute name="name">docid</xsl:attribute>
320
                        <xsl:attribute name="type">hidden</xsl:attribute>
321
                        <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
322
                    </xsl:element>
323
                    <xsl:element name="input">
324
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
325
                        <xsl:attribute name="type">hidden</xsl:attribute>
326
                        <xsl:attribute name="value"><xsl:value-of select="$docid"/></xsl:attribute>
327
                    </xsl:element>
328
                </td>
329
                <td>
330
                    <input name="updateFile" type="file"/>
331
                </td>
332
            </form>
333
        </xsl:if>
334
    </xsl:template>
335

    
336
    <xsl:template name="long_date">
337
        <xsl:param name="date"/>
338
        <!-- Day -->
339
        <xsl:value-of select="number(substring($date, 7, 2))"/>
340
        <xsl:text> </xsl:text>
341
        <!-- Month -->
342
        <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
343
        <xsl:choose>
344
            <xsl:when test="$month=1">January</xsl:when>
345
            <xsl:when test="$month=2">February</xsl:when>
346
            <xsl:when test="$month=3">March</xsl:when>
347
            <xsl:when test="$month=4">April</xsl:when>
348
            <xsl:when test="$month=5">May</xsl:when>
349
            <xsl:when test="$month=6">June</xsl:when>
350
            <xsl:when test="$month=7">July</xsl:when>
351
            <xsl:when test="$month=8">August</xsl:when>
352
            <xsl:when test="$month=9">September</xsl:when>
353
            <xsl:when test="$month=10">October</xsl:when>
354
            <xsl:when test="$month=11">November</xsl:when>
355
            <xsl:when test="$month=12">December</xsl:when>
356
            <xsl:otherwise>INVALID MONTH</xsl:otherwise>
357
        </xsl:choose>
358
        <xsl:text> </xsl:text>
359
        <!-- Year -->
360
        <xsl:value-of select="substring($date, 1, 4)"/>
361
    </xsl:template>
362

    
363
</xsl:stylesheet>
(1-1/2)