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
                <link rel="stylesheet" type="text/css" href="./style/skins/knp/knp.css" media="all"/>
11
                <script language="JavaScript" type="text/JavaScript" src="./style/skins/knp/knp.js"/>
12
                <script language="JavaScript" type="text/JavaScript" src="./style/common/branding.js"/>
13
                <title>FGDC Identification and Metacat Data Package Information</title>
14
            </head>
15
            <body>
16
                <script language="JavaScript">
17
                    function getMapFrame() {
18
                    return document.getElementById('mapFrame');
19
                    }
20
                    insertTemplateOpening();
21
                </script>
22
                <div class="centerContentBorder">
23
                    <div class="templatecontentareaclass">
24
                        <xsl:apply-templates select="idinfo"/>
25
                        <xsl:apply-templates
26
                            select="distinfo/resdesc[text()=$docid]/ancestor::distinfo"/>
27
                    </div>
28
                </div>
29
                <script language="JavaScript">
30
                    insertTemplateClosing();
31
                </script>
32
            </body>
33
        </html>
34
    </xsl:template>
35

    
36
    <xsl:template match="idinfo">
37
        <table border="0" cellspacing="10">
38
            <tr>
39
                <td colspan="2" align="center">
40
                    <span class="greenbold">FGDC Identification Information</span>
41
                </td>
42
            </tr>
43
            <xsl:apply-templates select="citation"/>
44
            <xsl:apply-templates select="descript"/>
45
            <xsl:apply-templates select="spdom"/>
46
            <xsl:apply-templates select="keywords"/>
47
        </table>
48
    </xsl:template>
49

    
50
    <xsl:template match="citation">
51
        <xsl:apply-templates select="citeinfo"/>
52
    </xsl:template>
53

    
54
    <xsl:template match="citeinfo">
55
        <tr>
56
            <td colspan="2">
57
                <span class="greenbold">Citation Information </span>
58
            </td>
59
        </tr>
60

    
61
        <tr>
62
            <xsl:apply-templates select="title"/>
63
        </tr>
64
        <tr>
65
            <xsl:apply-templates select="origin"/>
66
        </tr>
67
        <tr>
68
            <xsl:apply-templates select="pubdate"/>
69
        </tr>
70
        <tr>
71
            <xsl:apply-templates select="edition"/>
72
        </tr>
73
        <tr>
74
            <xsl:apply-templates select="geoform"/>
75
        </tr>
76
        <tr>
77
            <xsl:apply-templates select="pubinfo"/>
78
        </tr>
79
        <tr>
80
            <xsl:apply-templates select="othercit"/>
81
        </tr>
82
    </xsl:template>
83

    
84
    <xsl:template match="descript">
85
        <tr>
86
            <td colspan="2">
87
                <span class="greenbold">Description</span>
88
            </td>
89
        </tr>
90
        <tr>
91
            <xsl:apply-templates select="abstract"/>
92
        </tr>
93
        <tr>
94
            <xsl:apply-templates select="purpose"/>
95
        </tr>
96
    </xsl:template>
97

    
98
    <xsl:template match="spdom">
99
        <tr>
100
            <xsl:apply-templates select="bounding"/>
101
        </tr>
102
    </xsl:template>
103

    
104
    <xsl:template match="keywords">
105
        <tr>
106
            <xsl:apply-templates select="theme"/>
107
        </tr>
108
        <tr>
109
            <xsl:apply-templates select="place"/>
110
        </tr>
111
    </xsl:template>
112

    
113
    <xsl:template match="theme">
114
        <td valign="top">Theme Keywords</td>
115
        <td>
116
            <xsl:apply-templates select="themekey[position()!=last()]">
117
                <xsl:with-param name="lastPlace">f</xsl:with-param>
118
            </xsl:apply-templates>
119
            <xsl:apply-templates select="themekey[position()=last()]">
120
                <xsl:with-param name="lastPlace">t</xsl:with-param>
121
            </xsl:apply-templates>
122
        </td>
123
    </xsl:template>
124

    
125
    <xsl:template match="place">
126
        <td valign="top">Place Keywords</td>
127
        <td>
128
            <xsl:apply-templates select="placekey[position()!=last()]">
129
                <xsl:with-param name="lastPlace">f</xsl:with-param>
130
            </xsl:apply-templates>
131
            <xsl:apply-templates select="placekey[position()=last()]">
132
                <xsl:with-param name="lastPlace">t</xsl:with-param>
133
            </xsl:apply-templates>
134
        </td>
135
    </xsl:template>
136

    
137
    <xsl:template match="themekey">
138
        <xsl:param name="lastPlace"/>
139
        <xsl:value-of select="."/>
140
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
141
    </xsl:template>
142

    
143
    <xsl:template match="placekey">
144
        <xsl:param name="lastPlace"/>
145
        <xsl:value-of select="."/>
146
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
147
    </xsl:template>
148

    
149
    <xsl:template match="bounding">
150
        <td valign="top">Bounding Coordinates</td>
151
        <td>
152
            <table>
153
                <tr>
154
                    <td align="right">West</td>
155
                    <td>
156
                        <xsl:value-of select="westbc"/>
157
                    </td>
158
                    <td align="right">East</td>
159
                    <td>
160
                        <xsl:value-of select="eastbc"/>
161
                    </td>
162
                </tr>
163
                <tr>
164
                    <td align="right">North</td>
165
                    <td>
166
                        <xsl:value-of select="northbc"/>
167
                    </td>
168
                    <td align="right">South</td>
169
                    <td>
170
                        <xsl:value-of select="southbc"/>
171
                    </td>
172
                </tr>
173
            </table>
174
        </td>
175
    </xsl:template>
176

    
177
    <xsl:template match="abstract">
178
        <td valign="top">Abstract</td>
179
        <td>
180
            <xsl:value-of select="."/>
181
        </td>
182
    </xsl:template>
183

    
184
    <xsl:template match="purpose">
185
        <td valign="top">Purpose</td>
186
        <td>
187
            <xsl:value-of select="."/>
188
        </td>
189
    </xsl:template>
190

    
191
    <xsl:template match="title">
192
        <td>Title</td>
193
        <td>
194
            <xsl:value-of select="."/>
195
        </td>
196
    </xsl:template>
197

    
198
    <xsl:template match="origin">
199
        <td>Originator </td>
200
        <td>
201
            <xsl:value-of select="."/>
202
        </td>
203
    </xsl:template>
204

    
205
    <xsl:template match="pubdate">
206
        <td>Publication Date</td>
207
        <td>
208
            <xsl:call-template name="long_date">
209
                <xsl:with-param name="date">
210
                    <xsl:value-of select="."/>
211
                </xsl:with-param>
212
            </xsl:call-template>
213
        </td>
214
    </xsl:template>
215

    
216
    <xsl:template match="edition">
217
        <td>Edition</td>
218
        <td>
219
            <xsl:value-of select="."/>
220
        </td>
221
    </xsl:template>
222

    
223
    <xsl:template match="geoform">
224
        <td valign="top">Geospatial Data Presentation Form</td>
225
        <td>
226
            <xsl:value-of select="."/>
227
        </td>
228
    </xsl:template>
229

    
230
    <xsl:template match="othercit">
231
        <td valign="top">Other Citation Details</td>
232
        <td>
233
            <xsl:value-of select="."/>
234
        </td>
235
    </xsl:template>
236

    
237
    <xsl:template match="pubinfo">
238
        <td valign="top"> Publication Information </td>
239
        <td>
240
            <table>
241
                <tr>
242
                    <xsl:apply-templates select="pubplace"/>
243
                </tr>
244
                <tr>
245
                    <xsl:apply-templates select="publish"/>
246
                </tr>
247
            </table>
248
        </td>
249
    </xsl:template>
250

    
251
    <xsl:template match="pubplace">
252
        <td>Publication Place</td>
253
        <td>
254
            <xsl:value-of select="."/>
255
        </td>
256
    </xsl:template>
257

    
258
    <xsl:template match="publish">
259
        <td>Publisher</td>
260
        <td>
261
            <xsl:value-of select="."/>
262
        </td>
263
    </xsl:template>
264

    
265
    <xsl:template match="distinfo">
266
        <table width="100%" border="0" cellspacing="10">
267
            <tr>
268
                <td colspan="3" align="center">
269
                    <span class="greenbold">Metacat Data Package Information</span>
270
                </td>
271
            </tr>
272
            <tr>
273
                <td>
274
                    <span class="greenbold">File type</span>
275
                </td>
276
                <td>
277
                    <span class="greenbold">File name (Doc Id)</span>
278
                </td>
279
                <xsl:if test="not($sessionid = 'null')">
280
                    <td align="center" colspan="3">
281
                        <span class="greenbold">Update with...</span>
282
                    </td>
283
                </xsl:if>
284
            </tr>
285
            <tr>
286
                <xsl:apply-templates select="resdesc"/>
287
            </tr>
288
            <xsl:apply-templates select="stdorder/digform/digtopt/onlinopt/computer/networka"/>
289
        </table>
290
    </xsl:template>
291

    
292
    <xsl:template match="resdesc">
293
        <td align="left">Metadata</td>
294
        <td align="left">
295
            <xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)</td>
296
        <xsl:if test="not($sessionid = 'null')">
297
            <td>
298
                <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
299
                    enctype="text/html">
300
                    <input name="action" value="Delete" type="submit"/>
301
                    <xsl:element name="input">
302
                        <xsl:attribute name="name">docid</xsl:attribute>
303
                        <xsl:attribute name="type">hidden</xsl:attribute>
304
                        <xsl:attribute name="value">
305
                            <xsl:value-of select="."/>
306
                        </xsl:attribute>
307
                    </xsl:element>
308
                    <xsl:element name="input">
309
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
310
                        <xsl:attribute name="type">hidden</xsl:attribute>
311
                        <xsl:attribute name="value">
312
                            <xsl:value-of select="$docid"/>
313
                        </xsl:attribute>
314
                    </xsl:element>
315
                </form>
316
            </td>
317
            <td>
318
                <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
319
                    enctype="multipart/form-data">
320
                    <input name="action" value="Update Metadata" type="submit"/>
321
                    <xsl:element name="input">
322
                        <xsl:attribute name="name">docid</xsl:attribute>
323
                        <xsl:attribute name="type">hidden</xsl:attribute>
324
                        <xsl:attribute name="value">
325
                            <xsl:value-of select="."/>
326
                        </xsl:attribute>
327
                    </xsl:element>
328
                    <xsl:element name="input">
329
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
330
                        <xsl:attribute name="type">hidden</xsl:attribute>
331
                        <xsl:attribute name="value">
332
                            <xsl:value-of select="$docid"/>
333
                        </xsl:attribute>
334
                    </xsl:element>
335
                    <input name="updateFile" type="file"/>
336
                </form>
337
            </td>
338
        </xsl:if>
339
    </xsl:template>
340

    
341
    <xsl:template match="networka">
342
        <tr>
343
            <xsl:apply-templates select="networkr"/>
344
        </tr>
345
    </xsl:template>
346

    
347
    <xsl:template match="networkr">
348
        <td align="right">Data</td>
349
        <td align="center">
350
            <xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."
351
            />) </td>
352
        <xsl:if test="not($sessionid = 'null')">
353
            <td>
354
                <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
355
                    enctype="text/html">
356
                    <input name="action" value="Delete" type="submit"/>
357
                    <xsl:element name="input">
358
                        <xsl:attribute name="name">docid</xsl:attribute>
359
                        <xsl:attribute name="type">hidden</xsl:attribute>
360
                        <xsl:attribute name="value">
361
                            <xsl:value-of select="."/>
362
                        </xsl:attribute>
363
                    </xsl:element>
364
                    <xsl:element name="input">
365
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
366
                        <xsl:attribute name="type">hidden</xsl:attribute>
367
                        <xsl:attribute name="value">
368
                            <xsl:value-of select="$docid"/>
369
                        </xsl:attribute>
370
                    </xsl:element>
371
                </form>
372
            </td>
373
            <td>
374
                <form method="post" action="./style/common/fgdc/ClientViewHelper.jspx"
375
                    enctype="multipart/form-data">
376
                    <input name="action" value="Update Data" type="submit"/>
377
                    <xsl:element name="input">
378
                        <xsl:attribute name="name">docid</xsl:attribute>
379
                        <xsl:attribute name="type">hidden</xsl:attribute>
380
                        <xsl:attribute name="value">
381
                            <xsl:value-of select="."/>
382
                        </xsl:attribute>
383
                    </xsl:element>
384
                    <xsl:element name="input">
385
                        <xsl:attribute name="name">metadataDocId</xsl:attribute>
386
                        <xsl:attribute name="type">hidden</xsl:attribute>
387
                        <xsl:attribute name="value">
388
                            <xsl:value-of select="$docid"/>
389
                        </xsl:attribute>
390
                    </xsl:element>
391
                    <input name="updateFile" type="file"/>
392
                </form>
393
            </td>
394
        </xsl:if>
395
    </xsl:template>
396

    
397
    <xsl:template name="long_date">
398
        <xsl:param name="date"/>
399
        <!-- Day -->
400
        <xsl:value-of select="number(substring($date, 7, 2))"/>
401
        <xsl:text> </xsl:text>
402
        <!-- Month -->
403
        <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
404
        <xsl:choose>
405
            <xsl:when test="$month=1">January</xsl:when>
406
            <xsl:when test="$month=2">February</xsl:when>
407
            <xsl:when test="$month=3">March</xsl:when>
408
            <xsl:when test="$month=4">April</xsl:when>
409
            <xsl:when test="$month=5">May</xsl:when>
410
            <xsl:when test="$month=6">June</xsl:when>
411
            <xsl:when test="$month=7">July</xsl:when>
412
            <xsl:when test="$month=8">August</xsl:when>
413
            <xsl:when test="$month=9">September</xsl:when>
414
            <xsl:when test="$month=10">October</xsl:when>
415
            <xsl:when test="$month=11">November</xsl:when>
416
            <xsl:when test="$month=12">December</xsl:when>
417
            <xsl:otherwise>INVALID MONTH</xsl:otherwise>
418
        </xsl:choose>
419
        <xsl:text> </xsl:text>
420
        <!-- Year -->
421
        <xsl:value-of select="substring($date, 1, 4)"/>
422
    </xsl:template>
423

    
424
</xsl:stylesheet>
(2-2/3)