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
    <xsl:param name="qformat"/>
7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
290
    <xsl:template match="resdesc">
291
        <td align="left">Metadata</td>
292
        <td align="left">
293
            <xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)</td>
294
        <xsl:if test="not($sessionid = 'null')">
295
            <td>
296
                <form method="post" action="./style/common/ClientViewHelper.jspx"
297
                    enctype="text/html">
298
                    <input name="action" value="Delete" type="submit"/>
299
                    <input name="docid" type="hidden" value="{.}"/>
300
                    <input name="qformat" type="hidden" value="{$qformat}"/>
301
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
302
                </form>
303
            </td>
304
            <td>
305
                <form method="post" action="./style/common/ClientViewHelper.jspx"
306
                    enctype="multipart/form-data">
307
                    <input name="action" value="Update Metadata" type="submit"/>
308
                    <input name="docid" type="hidden" value="{.}"/>
309
                    <input name="qformat" type="hidden" value="{$qformat}"/>
310
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
311
                    <input name="updateFile" type="file"/>
312
                </form>
313
            </td>
314
        </xsl:if>
315
    </xsl:template>
316

    
317
    <xsl:template match="networka">
318
        <tr>
319
            <xsl:apply-templates select="networkr"/>
320
        </tr>
321
    </xsl:template>
322

    
323
    <xsl:template match="networkr">
324
        <td align="right">Data</td>
325
        <td align="center">
326
            <xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."
327
            />) </td>
328
        <xsl:if test="not($sessionid = 'null')">
329
            <td>
330
                <form method="get" action="./style/common/ClientViewHelper.jspx"
331
                    enctype="text/html">
332
                    <input name="action" value="Delete" type="submit"/>
333
                    <input name="docid" type="hidden" value="{.}"/>
334
                    <input name="qformat" type="hidden" value="{$qformat}"/>
335
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
336
                </form>
337
            </td>
338
            <td>
339
                <form method="post" action="./style/common/ClientViewHelper.jspx"
340
                    enctype="multipart/form-data">
341
                    <input name="action" value="Update Data" type="submit"/>
342
                    <input name="docid" type="hidden" value="{.}"/>
343
                    <input name="qformat" type="hidden" value="{$qformat}"/>
344
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
345
                    <input name="updateFile" type="file"/>
346
                </form>
347
            </td>
348
        </xsl:if>
349
    </xsl:template>
350

    
351
    <xsl:template name="long_date">
352
        <xsl:param name="date"/>
353
        <!-- Day -->
354
        <xsl:value-of select="number(substring($date, 7, 2))"/>
355
        <xsl:text> </xsl:text>
356
        <!-- Month -->
357
        <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
358
        <xsl:choose>
359
            <xsl:when test="$month=1">January</xsl:when>
360
            <xsl:when test="$month=2">February</xsl:when>
361
            <xsl:when test="$month=3">March</xsl:when>
362
            <xsl:when test="$month=4">April</xsl:when>
363
            <xsl:when test="$month=5">May</xsl:when>
364
            <xsl:when test="$month=6">June</xsl:when>
365
            <xsl:when test="$month=7">July</xsl:when>
366
            <xsl:when test="$month=8">August</xsl:when>
367
            <xsl:when test="$month=9">September</xsl:when>
368
            <xsl:when test="$month=10">October</xsl:when>
369
            <xsl:when test="$month=11">November</xsl:when>
370
            <xsl:when test="$month=12">December</xsl:when>
371
            <xsl:otherwise>INVALID MONTH</xsl:otherwise>
372
        </xsl:choose>
373
        <xsl:text> </xsl:text>
374
        <!-- Year -->
375
        <xsl:value-of select="substring($date, 1, 4)"/>
376
    </xsl:template>
377

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