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: leinfelder $'
10
  *     '$Date: 2013-07-16 10:44:41 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 7999 $'
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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
36
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
37
              indent="yes" />  
38

    
39
   <xsl:template name="physical">
40
      <xsl:param name="docid"/>
41
      <xsl:param name="level">entity</xsl:param>
42
      <xsl:param name="entitytype"/>
43
      <xsl:param name="entityindex"/>
44
      <xsl:param name="physicalindex"/>
45
      <xsl:param name="distributionindex"/>
46
      <xsl:param name="physicalfirstColStyle"/>
47
      <xsl:param name="notshowdistribution"/>
48
      
49
      <div class="physicalContainer">
50
      
51
        <xsl:choose>
52
         <xsl:when test="references!=''">
53
          <xsl:variable name="ref_id" select="references"/>
54
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
55
          <xsl:for-each select="$references">
56
            <xsl:call-template name="physicalcommon">
57
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
58
              <xsl:with-param name="notshowdistribution" select="$notshowdistribution"/>
59
            </xsl:call-template>
60
          </xsl:for-each>
61
        </xsl:when>
62
        <xsl:otherwise>
63
          <xsl:call-template name="physicalcommon">
64
             <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
65
             <xsl:with-param name="notshowdistribution" select="$notshowdistribution"/>
66
          </xsl:call-template>
67
        </xsl:otherwise>
68
      </xsl:choose>
69
      
70
      </div>
71
      
72
  </xsl:template>
73

    
74
  <xsl:template name="physicalcommon">
75
    <xsl:param name="physicalfirstColStyle"/>
76
    <xsl:param name="notshowdistribution"/>
77
    <xsl:param name="docid"/>
78
    <xsl:param name="level">entity</xsl:param>
79
    <xsl:param name="entitytype"/>
80
    <xsl:param name="entityindex"/>
81
    <xsl:param name="physicalindex"/>
82
    <xsl:param name="distributionindex"/>
83

    
84
    <xsl:call-template name="physicalobjectName">
85
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
86
    </xsl:call-template>
87
    <xsl:if test="$notshowdistribution=''">
88
      <xsl:for-each select="distribution">
89
        <xsl:call-template name="distribution">
90
          <xsl:with-param name="disfirstColStyle" select="$physicalfirstColStyle"/>
91
          <xsl:with-param name="dissubHeaderStyle" select="$subHeaderStyle"/>
92
          <xsl:with-param name="docid" select="$docid"/>
93
          <xsl:with-param name="level">entitylevel</xsl:with-param>
94
          <xsl:with-param name="entitytype" select="$entitytype"/>
95
          <xsl:with-param name="entityindex" select="$entityindex"/>
96
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
97
          <xsl:with-param name="distributionindex" select="position()"/>
98
        </xsl:call-template>
99
      </xsl:for-each>
100
    </xsl:if>
101
    <xsl:call-template name="physicalsize">
102
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
103
    </xsl:call-template>
104
    <xsl:call-template name="physicalauthentication">
105
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
106
    </xsl:call-template>
107
    <xsl:call-template name="physicalcompressionMethod">
108
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
109
    </xsl:call-template>
110
    <xsl:call-template name="physicalencodingMethod">
111
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
112
    </xsl:call-template>
113
    <xsl:call-template name="physicalcharacterEncoding">
114
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
115
    </xsl:call-template>
116
    <xsl:call-template name="physicaltextFormat">
117
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
118
    </xsl:call-template>
119
    <xsl:call-template name="physicalexternallyDefinedFormat">
120
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
121
    </xsl:call-template>
122
    <xsl:call-template name="physicalbinaryRasterFormat">
123
      <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
124
    </xsl:call-template>
125

    
126
  </xsl:template>
127

    
128
  <xsl:template name="physicalobjectName">
129
    <xsl:param name="physicalfirstColStyle"/>
130
    <xsl:for-each select="objectName">
131
      <div class="control-group">
132
		<label class="control-label">Object Name</label>
133
        <div class="controls controls-well">
134
        	<xsl:value-of select="."/>
135
        </div>
136
      </div>
137
    </xsl:for-each>
138
  </xsl:template>
139

    
140
  <xsl:template name="physicalsize">
141
    <xsl:param name="physicalfirstColStyle"/>
142
    <xsl:for-each select="size">
143
      <div class="control-group">
144
		<label class="control-label">Size</label>
145
        <div class="controls controls-well">
146
        <xsl:value-of select="."/><xsl:text> </xsl:text><xsl:value-of select="./@unit"/></div>
147
      </div>
148
    </xsl:for-each>
149
  </xsl:template>
150

    
151
  <xsl:template name="physicalauthentication">
152
    <xsl:param name="physicalfirstColStyle"/>
153
    <xsl:for-each select="authentication">
154
      <div class="control-group">
155
		<label class="control-label">Authentication</label>
156
        <div class="controls controls-well">
157
          <xsl:value-of select="."/><xsl:text> </xsl:text>
158
          <xsl:if test="./@method">
159
            Calculated By<xsl:text> </xsl:text><xsl:value-of select="./@method"/>
160
          </xsl:if>
161
        </div>
162
      </div>
163
    </xsl:for-each>
164
  </xsl:template>
165

    
166
  <xsl:template name="physicalcompressionMethod">
167
    <xsl:param name="physicalfirstColStyle"/>
168
    <xsl:for-each select="compressionMethod">
169
      <div class="control-group">
170
		<label class="control-label">Compression Method</label>
171
        <div class="controls controls-well">
172
        <xsl:value-of select="."/></div>
173
      </div>
174
    </xsl:for-each>
175
  </xsl:template>
176

    
177
  <xsl:template name="physicalencodingMethod">
178
    <xsl:param name="physicalfirstColStyle"/>
179
    <xsl:for-each select="encodingMethod">
180
      <div class="control-group">
181
		<label class="control-label">Encoding Method</label>
182
        <div class="controls controls-well">
183
        	<xsl:value-of select="."/>
184
        </div>
185
      </div>
186
    </xsl:for-each>
187
  </xsl:template>
188

    
189
  <xsl:template name="physicalcharacterEncoding">
190
    <xsl:param name="physicalfirstColStyle"/>
191
    <xsl:for-each select="characterEncoding">
192
      <div class="control-group">
193
		<label class="control-label">Character Encoding</label>
194
        <div class="controls controls-well">
195
        <xsl:value-of select="."/></div>
196
      </div>
197
    </xsl:for-each>
198
  </xsl:template>
199

    
200
  <!--***********************************************************
201
      TextFormat templates
202
      ***********************************************************-->
203

    
204
  <xsl:template name="physicaltextFormat">
205
   <xsl:param name="physicalfirstColStyle"/>
206
   <xsl:for-each select="dataFormat/textFormat">
207
      <div class="control-group">
208
		<label class="control-label">Text Format</label>
209
        <div class="controls controls-well">
210
          <table class="table table-striped">
211
            <xsl:apply-templates>
212
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
213
            </xsl:apply-templates>
214
          </table>
215
        </div>
216
      </div>
217

    
218
   </xsl:for-each>
219

    
220
  </xsl:template>
221

    
222

    
223
  <xsl:template match="numHeaderLines">
224
        <xsl:param name="physicalfirstColStyle"/>
225
        <tr>
226
	        <td class="{$physicalfirstColStyle}">Number of Header Lines</td>
227
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
228
        </tr>
229
  </xsl:template>
230

    
231
  <xsl:template match="numFooterLines">
232
        <xsl:param name="physicalfirstColStyle"/>
233
        <tr>
234
	        <td class="{$physicalfirstColStyle}">Number of Footer Lines</td>
235
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
236
        </tr>
237
  </xsl:template>
238

    
239
  <xsl:template match="recordDelimiter">
240
        <xsl:param name="physicalfirstColStyle"/>
241
        <tr>
242
	        <td class="{$physicalfirstColStyle}">Record Delimiter</td>
243
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
244
        </tr>
245
  </xsl:template>
246

    
247
  <xsl:template match="physicalLineDelimiter">
248
        <xsl:param name="physicalfirstColStyle"/>
249
        <tr>
250
	        <td class="{$physicalfirstColStyle}">Line Delimiter</td>
251
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
252
        </tr>
253
  </xsl:template>
254

    
255
  <xsl:template match="numPhysicalLinesPerRecord">
256
        <xsl:param name="physicalfirstColStyle"/>
257
        <tr>
258
	        <td class="{$physicalfirstColStyle}">Line Number For One Record</td>
259
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
260
        </tr>
261
  </xsl:template>
262

    
263
  <xsl:template match="maxRecordLength">
264
        <xsl:param name="physicalfirstColStyle"/>
265
        <tr>
266
	        <td class="{$physicalfirstColStyle}">Maximum Record Length</td>
267
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
268
        </tr>
269
  </xsl:template>
270

    
271
  <xsl:template match="attributeOrientation">
272
        <xsl:param name="physicalfirstColStyle"/>
273
        <tr>
274
	        <td class="{$physicalfirstColStyle}">Attribute Orientation</td>
275
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
276
        </tr>
277
  </xsl:template>
278

    
279
  <xsl:template match="simpleDelimited">
280
        <xsl:param name="physicalfirstColStyle"/>
281
        <tr>
282
        	<th colspan="2">Simple Text</th>
283
        </tr>
284
        <xsl:apply-templates>
285
           <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
286
         </xsl:apply-templates>
287
  </xsl:template>
288

    
289
  <xsl:template match="complex">
290
        <xsl:param name="physicalfirstColStyle"/>
291
        <tr>
292
        	<th colspan="2">Complex Delimited</th>
293
        </tr>
294
        <xsl:call-template name="textFixed">
295
           <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
296
        </xsl:call-template>
297
        <xsl:call-template name="textDelimited">
298
          <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
299
        </xsl:call-template>
300
           
301
  </xsl:template>
302

    
303

    
304
  <xsl:template name="textFixed">
305
        <xsl:param name="physicalfirstColStyle"/>
306
        <tr>
307
        	<th colspan="2">Text Fixed</th>
308
        </tr>
309
        <xsl:apply-templates>
310
          <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
311
        </xsl:apply-templates>
312
          
313
  </xsl:template>
314

    
315
  <xsl:template name="textDelimited">
316
        <xsl:param name="physicalfirstColStyle"/>
317
        <tr>
318
        	<th colspan="2">Text Delimited</th>
319
        </tr>
320
        <xsl:apply-templates>
321
          <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
322
        </xsl:apply-templates>
323
  </xsl:template>
324

    
325
  <xsl:template match="quoteCharacter">
326
        <xsl:param name="physicalfirstColStyle"/>
327
        <tr>
328
	        <td class="{$firstColStyle}">Quote Character</td>
329
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
330
        </tr>
331
  </xsl:template>
332

    
333
   <xsl:template match="literalCharacter">
334
       <xsl:param name="physicalfirstColStyle"/>
335
       <tr>
336
	        <td class="{$firstColStyle}">Literal Character</td>
337
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
338
        </tr>
339
  </xsl:template>
340

    
341

    
342
  <xsl:template match="fieldDelimiter">
343
        <xsl:param name="physicalfirstColStyle"/>
344
        <tr>
345
	        <td class="{$firstColStyle}">Field Delimeter</td>
346
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
347
        </tr>
348
  </xsl:template>
349

    
350
  <xsl:template match="fieldWidth">
351
        <xsl:param name="physicalfirstColStyle"/>
352
        <tr>
353
        	<td class="{$firstColStyle}">Field Width</td>
354
        	<td class="{$secondColStyle}"><xsl:value-of select="."/></td>
355
        </tr>
356
  </xsl:template>
357

    
358
  <xsl:template match="lineNumber">
359
        <xsl:param name="physicalfirstColStyle"/>
360
        <tr>
361
	        <td class="{$firstColStyle}">Line Number</td>
362
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
363
        </tr>
364
  </xsl:template>
365

    
366
  <xsl:template match="fieldStartColumn">
367
        <xsl:param name="physicalfirstColStyle"/>
368
        <tr>
369
	        <td class="{$firstColStyle}">Field Start Column</td>
370
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
371
        </tr>
372
  </xsl:template>
373

    
374

    
375
  <!--***********************************************************
376
      externallyDefinedFormat templates
377
      ***********************************************************-->
378
 <xsl:template name="physicalexternallyDefinedFormat">
379
    <xsl:param name="physicalfirstColStyle"/>
380
    <xsl:for-each select="dataFormat/externallyDefinedFormat">
381
      <div class="control-group">
382
		<label class="control-label">Externally Defined Format</label>
383
        <div class="controls controls-well">
384
          <table class="table table-striped">
385
            <xsl:apply-templates>
386
              <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
387
            </xsl:apply-templates>
388
          </table>
389
        </div>
390
      </div>
391
    </xsl:for-each>
392
  </xsl:template>
393
  <xsl:template match="formatName">
394
    <xsl:param name="physicalfirstColStyle"/>
395
    <xsl:if test="normalize-space(.)!=''">
396
        <tr>
397
	        <td class="{$firstColStyle}">Format Name</td>
398
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
399
        </tr>
400
    </xsl:if>
401
  </xsl:template>
402

    
403
  <xsl:template match="formatVersion">
404
        <xsl:param name="physicalfirstColStyle"/>
405
        <tr>
406
	        <td class="{$firstColStyle}">Format Version</td>
407
	        <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
408
        </tr>
409
  </xsl:template>
410

    
411
  <xsl:template match="citation">
412
        <xsl:param name="physicalfirstColStyle"/>
413
        <tr>
414
	        <td class="{$physicalfirstColStyle}">Citation</td>
415
	        <td>
416
	          <xsl:call-template name="citation">
417
	            <xsl:with-param name="citationfirstColStyle" select="$physicalfirstColStyle"/>
418
	             <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
419
	          </xsl:call-template>
420
	        </td>
421
        </tr>
422
  </xsl:template>
423

    
424
  <!--***********************************************************
425
      binaryRasterFormat templates
426
      ***********************************************************-->
427
  <xsl:template name="physicalbinaryRasterFormat">
428
    <xsl:param name="physicalfirstColStyle"/>
429
    <xsl:for-each select="dataFormat/binaryRasterFormat">
430
      <div class="control-group">
431
		<label class="control-label">Binary Raster Format</label>
432
        <div class="controls controls-well">
433
           <table class="table table-striped">
434
             <xsl:apply-templates>
435
               <xsl:with-param name="physicalfirstColStyle" select="$physicalfirstColStyle"/>
436
             </xsl:apply-templates>
437
           </table>
438
        </div>
439
      </div>
440

    
441
   </xsl:for-each>
442
  </xsl:template>
443

    
444
  <xsl:template match="rowColumnOrientation">
445
        <xsl:param name="physicalfirstColStyle"/>
446
        <tr>
447
	        <td class="{$firstColStyle}">Orientation</td>
448
	        <td class="{$secondColStyle}">
449
	          <xsl:value-of select="."/>
450
	        </td>
451
        </tr>
452
  </xsl:template>
453

    
454
  <xsl:template match="multiBand">
455
        <xsl:param name="physicalfirstColStyle"/>
456
        <tr>
457
        	<th colspan="2">Multiple Bands</th>
458
        </tr>
459
        <tr>
460
            <td class="{$firstColStyle}">Number of Spectral Bands</td>
461
            <td class="{$secondColStyle}">
462
            	<xsl:value-of select="./nbands"/>
463
          	</td>
464
        </tr>
465
        <tr>
466
           <td class="{$firstColStyle}">Layout</td>
467
           <td class="{$secondColStyle}">
468
           	<xsl:value-of select="./layout"/>
469
           </td>
470
       </tr>
471

    
472
  </xsl:template>
473

    
474

    
475
  <xsl:template match="nbits">
476
        <xsl:param name="physicalfirstColStyle"/>
477
        <tr>
478
	        <td class="{$firstColStyle}">Number of Bits (/pixel/band)</td>
479
	        <td class="{$secondColStyle}">
480
	          <xsl:value-of select="."/>
481
	        </td>
482
        </tr>
483
  </xsl:template>
484

    
485
  <xsl:template match="byteorder">
486
        <xsl:param name="physicalfirstColStyle"/>
487
        <tr>
488
	        <td class="{$firstColStyle}">Byte Order</td>
489
	        <td class="{$secondColStyle}">
490
	          <xsl:value-of select="."/>
491
	        </td>
492
        </tr>
493
  </xsl:template>
494

    
495
  <xsl:template match="skipbytes">
496
        <xsl:param name="physicalfirstColStyle"/>
497
        <tr>
498
	        <td class="{$firstColStyle}">Skipped Bytes</td>
499
	        <td class="{$secondColStyle}">
500
	          <xsl:value-of select="."/>
501
	        </td>
502
        </tr>
503
  </xsl:template>
504

    
505
  <xsl:template match="bandrowbytes">
506
        <xsl:param name="physicalfirstColStyle"/>
507
        <tr>
508
	        <td class="{$firstColStyle}">Number of Bytes (/band/row)</td>
509
	        <td class="{$secondColStyle}">
510
	          <xsl:value-of select="."/>
511
	        </td>
512
        </tr>
513
  </xsl:template>
514

    
515
  <xsl:template match="totalrowbytes">
516
        <xsl:param name="physicalfirstColStyle"/>
517
        <tr>
518
	        <td class="{$firstColStyle}">Total Number of Byte (/row)</td>
519
	        <td class="{$secondColStyle}">
520
	          <xsl:value-of select="."/>
521
	        </td>
522
        </tr>
523
  </xsl:template>
524

    
525
  <xsl:template match="bandgapbytes">
526
        <xsl:param name="physicalfirstColStyle"/>
527
        <tr>
528
	        <td class="{$firstColStyle}">Number of Bytes between Bands</td>
529
	        <td class="{$secondColStyle}">
530
	          <xsl:value-of select="."/>
531
	        </td>
532
        </tr>
533
  </xsl:template>
534

    
535
</xsl:stylesheet>
(16-16/27)