Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matthew Brooke
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: tao $'
10
  *     '$Date: 2003-06-07 22:37:39 -0700 (Sat, 07 Jun 2003) $'
11
  * '$Revision: 1648 $'
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-variable.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
  <xsl:output method="html" encoding="iso-8859-1"/>
35

    
36
   <xsl:template name="physical">
37
      <xsl:param name="physicalfirstColStyle"/>
38
      <xsl:param name="notshowdistribution"/>
39
      <table class="tabledefault" width="100%">
40
        <xsl:choose>
41
         <xsl:when test="references!=''">
42
          <xsl:variable name="ref_id" select="references"/>
43
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
44
          <xsl:for-each select="$references">
45
            <xsl:call-template name="physicalcommon">
46
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
47
              <xsl:with-param name="notshowdistribution" select="$notshowdistribution"/>
48
            </xsl:call-template>
49
          </xsl:for-each>
50
        </xsl:when>
51
        <xsl:otherwise>
52
          <xsl:call-template name="physicalcommon">
53
             <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
54
             <xsl:with-param name="notshowdistribution" select="$notshowdistribution"/>
55
          </xsl:call-template>
56
        </xsl:otherwise>
57
      </xsl:choose>
58
      </table>
59
  </xsl:template>
60
  
61
  <xsl:template name="physicalcommon">
62
    <xsl:param name="physicalfirstColStyle"/>
63
    <xsl:param name="notshowdistribution"/>
64
    <xsl:call-template name="physicalobjectName">
65
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
66
    </xsl:call-template>
67
    <xsl:call-template name="physicalsize">
68
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
69
    </xsl:call-template>
70
    <xsl:call-template name="physicalauthentication">
71
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
72
    </xsl:call-template>
73
    <xsl:call-template name="physicalcompressionMethod">
74
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
75
    </xsl:call-template>
76
    <xsl:call-template name="physicalencodingMethod">
77
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
78
    </xsl:call-template>
79
    <xsl:call-template name="physicalcharacterEncoding">
80
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
81
    </xsl:call-template>
82
    <xsl:call-template name="physicaltextFormat">
83
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
84
    </xsl:call-template>
85
    <xsl:call-template name="physicalexternallyDefinedFormat">
86
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
87
    </xsl:call-template>
88
    <xsl:call-template name="physicalbinaryRasterFormat">
89
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
90
    </xsl:call-template>
91
    <xsl:if test="$notshowdistribution=''">
92
      <xsl:call-template name="distribution">
93
       <xsl:with-param name="disfirstColStyle" select="$physicalfirstColStyle"/>
94
       <xsl:with-param name="dissubHeaderStyle" select="$physicalsubHeaderStyle"/>
95
    </xsl:call-template>
96
    </xsl:if>
97
  </xsl:template>
98
  
99
  <xsl:template name="physicalobjectName">
100
    <xsl:param name="physicalfirstColStyle"/>
101
    <xsl:for-each select="objectName">
102
      <tr>
103
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
104
        Object Name</td>
105
        <td class="{$secondColStyle}" width="{$secondColWidth}">
106
        <xsl:value-of select="."/></td>
107
      </tr>
108
    </xsl:for-each>
109
  </xsl:template>
110
  
111
  <xsl:template name="physicalsize">
112
    <xsl:param name="physicalfirstColStyle"/>
113
    <xsl:for-each select="size">
114
      <tr>
115
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
116
        Size</td>
117
        <td class="{$secondColStyle}" width="{$secondColWidth}">
118
        <xsl:value-of select="."/></td>
119
      </tr>
120
    </xsl:for-each>
121
  </xsl:template>
122
  
123
  <xsl:template name="physicalauthentication">
124
    <xsl:param name="physicalfirstColStyle"/>
125
    <xsl:for-each select="authentication">
126
      <tr>
127
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
128
        Authentication</td>
129
        <td class="{$secondColStyle}" width="{$secondColWidth}">
130
        <xsl:value-of select="."/></td>
131
      </tr>
132
    </xsl:for-each>
133
  </xsl:template>
134
  
135
  <xsl:template name="physicalcompressionMethod">
136
    <xsl:param name="physicalfirstColStyle"/>
137
    <xsl:for-each select="compressionMethod">
138
      <tr>
139
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
140
        Compression Method</td>
141
        <td class="{$secondColStyle}" width="{$secondColWidth}">
142
        <xsl:value-of select="."/></td>
143
      </tr>
144
    </xsl:for-each>
145
  </xsl:template>
146
  
147
  <xsl:template name="physicalencodingMethod">
148
    <xsl:param name="physicalfirstColStyle"/>
149
    <xsl:for-each select="encodingMethod">
150
      <tr>
151
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
152
        Encoding Method</td>
153
        <td class="{$secondColStyle}" width="{$secondColWidth}">
154
        <xsl:value-of select="."/></td>
155
      </tr>
156
    </xsl:for-each>
157
  </xsl:template>
158
  
159
  <xsl:template name="physicalcharacterEncoding">
160
    <xsl:param name="physicalfirstColStyle"/>
161
    <xsl:for-each select="characterEncoding">
162
      <tr>
163
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
164
        Character Encoding</td>
165
        <td class="{$secondColStyle}" width="{$secondColWidth}">
166
        <xsl:value-of select="."/></td>
167
      </tr>
168
    </xsl:for-each>
169
  </xsl:template>
170
  
171
  <!--***********************************************************
172
      TextFormat templates
173
      ***********************************************************-->
174
  
175
  <xsl:template name="physicaltextFormat">
176
   <xsl:param name="physicalfirstColStyle"/>
177
   <xsl:for-each select="dataFormat/textFormat">
178
      <tr>
179
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
180
        Text Format:</td>
181
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
182
        &#160;</td>
183
      </tr>
184
      <xsl:apply-templates>
185
        <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
186
      </xsl:apply-templates>
187
      <tr>
188
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
189
        &#160;</td>
190
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
191
        &#160;</td>
192
      </tr>
193
   </xsl:for-each>
194
  
195
  </xsl:template>
196
  
197

    
198
  <xsl:template match="numHeaderLines">
199
        <xsl:param name="physicalfirstColStyle"/>
200
        <tr>
201
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Number of Header Lines</td>
202
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
203
        </tr>
204
  </xsl:template>
205

    
206
  <xsl:template match="numFooterLines">
207
        <xsl:param name="physicalfirstColStyle"/>
208
        <tr>
209
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Number of Foot Lines</td>
210
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
211
        </tr>
212
  </xsl:template>
213
  
214
  <xsl:template match="recordDelimiter">
215
        <xsl:param name="physicalfirstColStyle"/>
216
        <tr>
217
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Record Delimiter</td>
218
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
219
        </tr>
220
  </xsl:template>
221
  
222
  <xsl:template match="physicalLineDelimiter">
223
        <xsl:param name="physicalfirstColStyle"/>
224
        <tr>
225
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Line Delimiter</td>
226
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
227
        </tr>
228
  </xsl:template>
229
  
230
  <xsl:template match="numPhysicalLinePerRecord">
231
        <xsl:param name="physicalfirstColStyle"/>
232
        <tr>
233
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Line Number For One Record</td>
234
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
235
        </tr>
236
  </xsl:template>
237
  
238
  <xsl:template match="maxRecordLength">
239
        <xsl:param name="physicalfirstColStyle"/>
240
        <tr>
241
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Maximum Record Length</td>
242
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
243
        </tr>
244
  </xsl:template>
245
  
246
  <xsl:template match="attributeOrientation">
247
        <xsl:param name="physicalfirstColStyle"/>
248
        <tr>
249
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Maximum Record Length</td>
250
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
251
        </tr>
252
  </xsl:template>
253
  
254
  <xsl:template match="simpleDelimited">
255
        <xsl:param name="physicalfirstColStyle"/>
256
        <tr>
257
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Simple Delimited</td>
258
        <td  width="{$secondColWidth}">
259
          <table width="100%">
260
            <xsl:apply-templates>
261
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
262
            </xsl:apply-templates>
263
          </table>
264
        </td>
265
        </tr>
266
  </xsl:template>
267
  
268
  <xsl:template match="complex">
269
        <xsl:param name="physicalfirstColStyle"/>
270
        <tr>
271
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Complex Delimited</td>
272
        <td  width="{$secondColWidth}">
273
           <table width="100%">
274
             <xsl:call-template name="textFixed">
275
                <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
276
             </xsl:call-template>
277
             <xsl:call-template name="textDelimited">
278
               <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
279
             </xsl:call-template>
280
           </table>
281
         </td>
282
        </tr>
283
  </xsl:template>
284
  
285
  
286
  <xsl:template name="textFixed">
287
        <xsl:param name="physicalfirstColStyle"/>
288
        <tr>
289
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Text Fixed</td>
290
        <td  width="{$secondColWidth}">
291
          <table width="100%">
292
            <xsl:apply-templates>
293
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
294
            </xsl:apply-templates>
295
          </table>
296
        </td>
297
        </tr>
298
  </xsl:template>
299
  
300
  <xsl:template name="textDelimited">
301
        <xsl:param name="physicalfirstColStyle"/>
302
        <tr>
303
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Text Delimited</td>
304
        <td  width="{$secondColWidth}">
305
          <table width="100%">
306
            <xsl:apply-templates>
307
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
308
            </xsl:apply-templates>
309
          </table>
310
        </td>
311
        </tr>
312
  </xsl:template>
313

    
314
  <xsl:template match="quoteCharacter">
315
        <xsl:param name="physicalfirstColStyle"/>
316
        <tr>
317
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Quote Character</td>
318
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
319
        </tr>
320
  </xsl:template>
321

    
322
   <xsl:template match="literalCharacter">
323
       <xsl:param name="physicalfirstColStyle"/>
324
       <tr>
325
        <td class="{$firstColStyle}" width="{$firstColWidth}">Literal Character</td>
326
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
327
        </tr>
328
  </xsl:template>
329

    
330
  
331
  <xsl:template match="fieldDelimiter">
332
        <xsl:param name="physicalfirstColStyle"/>
333
        <tr>
334
        <td class="{$firstColStyle}" width="{$firstColWidth}">Field Delimeter</td>
335
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
336
        </tr>
337
  </xsl:template>
338

    
339
  <xsl:template match="fieldWidth">
340
        <xsl:param name="physicalfirstColStyle"/>
341
        <tr><td class="{$firstColStyle}" width="{$firstColWidth}">Field Width</td>
342
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
343
        </tr>
344
  </xsl:template>
345
  
346
  <xsl:template match="lineNumber">
347
        <xsl:param name="physicalfirstColStyle"/>
348
        <tr><td class="{$firstColStyle}" width="{$firstColWidth}">Line Number</td>
349
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
350
        </tr>
351
  </xsl:template>
352

    
353
  <xsl:template match="fieldStartColumn">
354
        <xsl:param name="physicalfirstColStyle"/>
355
        <tr>
356
        <td class="{$firstColStyle}" width="{$firstColWidth}">Field Start Column</td>
357
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
358
        </tr>
359
  </xsl:template>
360
  
361
  
362
  <!--***********************************************************
363
      externallyDefinedFormat templates
364
      ***********************************************************-->
365
 <xsl:template name="physicalexternallyDefinedFormat">
366
    <xsl:param name="physicalfirstColStyle"/>
367
    <xsl:for-each select="dataFormat/externallyDefinedFormat">
368
      <tr>
369
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
370
        Externally Defined Format:</td>
371
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
372
        &#160;</td>
373
      </tr>
374
      <xsl:apply-templates>
375
        <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
376
      </xsl:apply-templates>
377
      <tr>
378
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
379
        &#160;</td>
380
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
381
        &#160;</td>
382
      </tr>
383
    </xsl:for-each>
384
  </xsl:template>
385
  
386
  <xsl:template match="formatName">
387
        <xsl:param name="physicalfirstColStyle"/>
388
        <tr>
389
        <td class="{$firstColStyle}" width="{$firstColWidth}">Format Name</td>
390
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
391
        </tr>
392
  </xsl:template>
393
  
394
  <xsl:template match="formatVersion">
395
        <xsl:param name="physicalfirstColStyle"/>
396
        <tr>
397
        <td class="{$firstColStyle}" width="{$firstColWidth}">Format Version</td>
398
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
399
        </tr>
400
  </xsl:template>
401
  
402
  <xsl:template match="citation">
403
        <xsl:param name="physicalfirstColStyle"/>
404
        <tr>
405
        <td class="{$firstColStyle}" width="{$firstColWidth}">Citation</td>
406
        <td class="{$secondColStyle}" width="{$secondColWidth}">
407
          <xsl:call-template name="citation">
408
            <xsl:with-param name="citationfirstColStyle" select="physicalfirstColStyle"/>
409
          </xsl:call-template>
410
        </td>
411
        </tr>
412
  </xsl:template>
413
  
414
  <!--***********************************************************
415
      binaryRasterFormat templates
416
      ***********************************************************-->
417
  <xsl:template name="physicalbinaryRasterFormat">
418
    <xsl:param name="physicalfirstColStyle"/>
419
    <xsl:for-each select="dataFormat/binaryRasterFormat">
420
      <tr>
421
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
422
        Binary Raster Format:</td>
423
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
424
        &#160;</td>
425
      </tr>
426
      <xsl:apply-templates>
427
        <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
428
      </xsl:apply-templates>
429
      <tr>
430
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
431
        &#160;</td>
432
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
433
        &#160;</td>
434
      </tr>
435
    </xsl:for-each>
436
  </xsl:template>
437
  
438
  <xsl:template match="rowColumnOrientation">
439
        <xsl:param name="physicalfirstColStyle"/>
440
        <tr>
441
        <td class="{$firstColStyle}" width="{$firstColWidth}">Orientation</td>
442
        <td class="{$secondColStyle}" width="{$secondColWidth}">
443
          <xsl:value-of select="."/>
444
        </td>
445
        </tr>
446
  </xsl:template>
447
  
448
  <xsl:template match="multiBand">
449
        <xsl:param name="physicalfirstColStyle"/>
450
        <tr>
451
        <td class="{$firstColStyle}" width="{$firstColWidth}">Multiple Bands</td>
452
        <td class="{$secondColStyle}" width="{$secondColWidth}">
453
         <table width="100%">
454
            <tr>
455
                <td class="{$firstColStyle}" width="{$firstColWidth}">Number of Spectral Bands</td>
456
                <td class="{$secondColStyle}" width="{$secondColWidth}">
457
                <xsl:value-of select="./nbands"/>
458
              </td>
459
            </tr>
460
            <tr>
461
               <td class="{$firstColStyle}" width="{$firstColWidth}">Layout</td>
462
               <td class="{$secondColStyle}" width="{$secondColWidth}">
463
               <xsl:value-of select="./layout"/>
464
               </td>
465
           </tr>
466
        </table>
467
        </td>
468
        </tr>
469
  </xsl:template>
470
  
471
  
472
  <xsl:template match="nbits">
473
        <xsl:param name="physicalfirstColStyle"/>
474
        <tr>
475
        <td class="{$firstColStyle}" width="{$firstColWidth}">Number of Bits (/pixel/band)</td>
476
        <td class="{$secondColStyle}" width="{$secondColWidth}">
477
          <xsl:value-of select="."/>
478
        </td>
479
        </tr>
480
  </xsl:template>
481
  
482
  <xsl:template match="byteorder">
483
        <xsl:param name="physicalfirstColStyle"/>
484
        <tr>
485
        <td class="{$firstColStyle}" width="{$firstColWidth}">Byte Order</td>
486
        <td class="{$secondColStyle}" width="{$secondColWidth}">
487
          <xsl:value-of select="."/>
488
        </td>
489
        </tr>
490
  </xsl:template>
491
  
492
  <xsl:template match="skipbytes">
493
        <xsl:param name="physicalfirstColStyle"/>
494
        <tr>
495
        <td class="{$firstColStyle}" width="{$firstColWidth}">Skipped Bytes</td>
496
        <td class="{$secondColStyle}" width="{$secondColWidth}">
497
          <xsl:value-of select="."/>
498
        </td>
499
        </tr>
500
  </xsl:template>
501
  
502
  <xsl:template match="bandrowbytes">
503
        <xsl:param name="physicalfirstColStyle"/>
504
        <tr>
505
        <td class="{$firstColStyle}" width="{$firstColWidth}">Number of Bytes (/band/row)</td>
506
        <td class="{$secondColStyle}" width="{$secondColWidth}">
507
          <xsl:value-of select="."/>
508
        </td>
509
        </tr>
510
  </xsl:template>
511
  
512
  <xsl:template match="totalrowbytes">
513
        <xsl:param name="physicalfirstColStyle"/>
514
        <tr>
515
        <td class="{$firstColStyle}" width="{$firstColWidth}">Total Number of Byte (/row)</td>
516
        <td class="{$secondColStyle}" width="{$secondColWidth}">
517
          <xsl:value-of select="."/>
518
        </td>
519
        </tr>
520
  </xsl:template>
521
  
522
  <xsl:template match="bandgapbytes">
523
        <xsl:param name="physicalfirstColStyle"/>
524
        <tr>
525
        <td class="{$firstColStyle}" width="{$firstColWidth}">Number of Bytes between Bands</td>
526
        <td class="{$secondColStyle}" width="{$secondColWidth}">
527
          <xsl:value-of select="."/>
528
        </td>
529
        </tr>
530
  </xsl:template>
531
  
532
</xsl:stylesheet>
(17-17/27)