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 17:59:00 -0700 (Sat, 07 Jun 2003) $'
11
  * '$Revision: 1645 $'
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:template>
86
  
87
  <xsl:template name="physicalobjectName">
88
    <xsl:param name="physicalfirstColStyle"/>
89
    <xsl:for-each select="objectName">
90
      <tr>
91
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
92
        Object Name</td>
93
        <td class="{$secondColStyle}" width="{$secondColWidth}">
94
        <xsl:value-of select="."/></td>
95
      </tr>
96
    </xsl:for-each>
97
  </xsl:template>
98
  
99
  <xsl:template name="physicalsize">
100
    <xsl:param name="physicalfirstColStyle"/>
101
    <xsl:for-each select="size">
102
      <tr>
103
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
104
        Size</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="physicalauthentication">
112
    <xsl:param name="physicalfirstColStyle"/>
113
    <xsl:for-each select="authentication">
114
      <tr>
115
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
116
        Authentication</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="physicalcompressionMethod">
124
    <xsl:param name="physicalfirstColStyle"/>
125
    <xsl:for-each select="compressionMethod">
126
      <tr>
127
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
128
        Compression Method</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="physicalencodingMethod">
136
    <xsl:param name="physicalfirstColStyle"/>
137
    <xsl:for-each select="encodingMethod">
138
      <tr>
139
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
140
        Encoding 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="physicalcharacterEncoding">
148
    <xsl:param name="physicalfirstColStyle"/>
149
    <xsl:for-each select="characterEncoding">
150
      <tr>
151
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
152
        Character Encoding</td>
153
        <td class="{$secondColStyle}" width="{$secondColWidth}">
154
        <xsl:value-of select="."/></td>
155
      </tr>
156
    </xsl:for-each>
157
  </xsl:template>
158
  
159
  <!--***********************************************************
160
      TextFormat templates
161
      ***********************************************************-->
162
  
163
  <xsl:template name="physicaltextFormat">
164
   <xsl:param name="physicalfirstColStyle"/>
165
   <xsl:for-each select="dataFormat/textFormat">
166
      <tr>
167
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
168
        Text Format:</td>
169
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
170
        &#160;</td>
171
      </tr>
172
      <xsl:apply-templates>
173
        <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
174
      </xsl:apply-templates>
175
      <tr>
176
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">
177
        &#160;</td>
178
        <td class="{$physicalfirstColStyle}" width="{$secondColWidth}">
179
        &#160;</td>
180
      </tr>
181
   </xsl:for-each>
182
  
183
  </xsl:template>
184
  
185

    
186
  <xsl:template match="numHeaderLines">
187
        <xsl:param name="physicalfirstColStyle"/>
188
        <tr>
189
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Number of Header Lines</td>
190
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
191
        </tr>
192
  </xsl:template>
193

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

    
302
  <xsl:template match="quoteCharacter">
303
        <xsl:param name="physicalfirstColStyle"/>
304
        <tr>
305
        <td class="{$physicalfirstColStyle}" width="{$firstColWidth}">Quote Character</td>
306
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
307
        </tr>
308
  </xsl:template>
309

    
310
   <xsl:template match="literalCharacter">
311
       <xsl:param name="physicalfirstColStyle"/>
312
       <tr>
313
        <td class="{$firstColStyle}" width="{$firstColWidth}">Literal Character</td>
314
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
315
        </tr>
316
  </xsl:template>
317

    
318
  
319
  <xsl:template match="fieldDelimiter">
320
        <xsl:param name="physicalfirstColStyle"/>
321
        <tr>
322
        <td class="{$firstColStyle}" width="{$firstColWidth}">Field Delimeter</td>
323
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
324
        </tr>
325
  </xsl:template>
326

    
327
  <xsl:template match="fieldWidth">
328
        <xsl:param name="physicalfirstColStyle"/>
329
        <tr><td class="{$firstColStyle}" width="{$firstColWidth}">Field Width</td>
330
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
331
        </tr>
332
  </xsl:template>
333
  
334
  <xsl:template match="lineNumber">
335
        <xsl:param name="physicalfirstColStyle"/>
336
        <tr><td class="{$firstColStyle}" width="{$firstColWidth}">Line Number</td>
337
        <td class="{$secondColStyle}" width="{$secondColWidth}"><xsl:value-of select="."/></td>
338
        </tr>
339
  </xsl:template>
340

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