1
|
<?xml version="1.0"?>
|
2
|
<!--
|
3
|
* eml-variable-display2.xsl
|
4
|
*
|
5
|
* Authors: Matt Jones
|
6
|
* Copyright: 2000 Regents of the University of California and the
|
7
|
* National Center for Ecological Analysis and Synthesis
|
8
|
* For Details: http://www.nceas.ucsb.edu/
|
9
|
* Created: 2000 April 5
|
10
|
* File Info: '$Id: eml-variable-display.xsl 41 2000-04-14 03:30:21Z jones $'
|
11
|
*
|
12
|
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
|
13
|
* convert an XML file that is valid with respect to the eml-variable.dtd
|
14
|
* module of the Ecological Metadata Language (EML) into an HTML format
|
15
|
* suitable for rendering with modern web browsers.
|
16
|
-->
|
17
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
18
|
|
19
|
<xsl:output method="html"/>
|
20
|
|
21
|
<xsl:template match="/">
|
22
|
<html>
|
23
|
<head>
|
24
|
<link rel="stylesheet" type="text/css" href="./rowcol.css" />
|
25
|
</head>
|
26
|
<body class="emlbody">
|
27
|
<center>
|
28
|
<h1>Attribute structure description</h1>
|
29
|
<h3>Ecological Metadata Language</h3>
|
30
|
</center>
|
31
|
|
32
|
<xsl:apply-templates select="eml-variable/meta_file_id"/>
|
33
|
|
34
|
<h3>Attributes in the Data Set:</h3>
|
35
|
<table width="100%">
|
36
|
<tr class="rowodd">
|
37
|
<th><xsl:text>Attribute Name</xsl:text></th>
|
38
|
<th><xsl:text>Attribute Definition</xsl:text></th>
|
39
|
<th><xsl:text>Unit</xsl:text></th>
|
40
|
<th><xsl:text>Type</xsl:text></th>
|
41
|
<th><xsl:text>Codes</xsl:text></th>
|
42
|
<th><xsl:text>Range</xsl:text></th>
|
43
|
<th><xsl:text>Missing</xsl:text></th>
|
44
|
<th><xsl:text>Precision</xsl:text></th>
|
45
|
<th><xsl:text>Format</xsl:text></th>
|
46
|
</tr>
|
47
|
|
48
|
<xsl:for-each select="eml-variable/variable">
|
49
|
<tr valign="top">
|
50
|
<xsl:attribute name="class">
|
51
|
<xsl:choose>
|
52
|
<xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
|
53
|
<xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
|
54
|
</xsl:choose>
|
55
|
</xsl:attribute>
|
56
|
|
57
|
<td><b><xsl:value-of select="variable_name"/></b>
|
58
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
59
|
<td><xsl:value-of select="variable_definition"/>
|
60
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
61
|
<td><xsl:value-of select="unit"/>
|
62
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
63
|
<td><xsl:value-of select="storage_type"/>
|
64
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
65
|
<td><ul>
|
66
|
<xsl:for-each select="code_definition">
|
67
|
<li><xsl:value-of select="code"/>
|
68
|
<xsl:text> - </xsl:text>
|
69
|
<xsl:value-of select="definition"/>
|
70
|
</li>
|
71
|
</xsl:for-each>
|
72
|
</ul>
|
73
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
74
|
<td><ul>
|
75
|
<xsl:for-each select="numeric_range">
|
76
|
<li><xsl:value-of select="minimum"/>
|
77
|
<xsl:text> - </xsl:text>
|
78
|
<xsl:value-of select="maximum"/>
|
79
|
</li>
|
80
|
</xsl:for-each>
|
81
|
</ul>
|
82
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
83
|
<td><xsl:for-each select="missing_value_code">
|
84
|
<xsl:value-of select="."/><br />
|
85
|
</xsl:for-each>
|
86
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
87
|
<td><xsl:value-of select="precision"/>
|
88
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
89
|
<td><xsl:apply-templates select="field_format"/>
|
90
|
<xsl:text><![CDATA[ ]]></xsl:text></td>
|
91
|
</tr>
|
92
|
</xsl:for-each>
|
93
|
</table>
|
94
|
|
95
|
</body>
|
96
|
</html>
|
97
|
</xsl:template>
|
98
|
|
99
|
<xsl:template match="meta_file_id">
|
100
|
<table>
|
101
|
<tr>
|
102
|
<td class="shaded">
|
103
|
<b><xsl:text>Metadata File ID:</xsl:text></b>
|
104
|
</td>
|
105
|
<td>
|
106
|
<xsl:value-of select="."/>
|
107
|
</td>
|
108
|
</tr>
|
109
|
</table>
|
110
|
</xsl:template>
|
111
|
|
112
|
<xsl:template match="field_format">
|
113
|
<xsl:apply-templates/>
|
114
|
</xsl:template>
|
115
|
|
116
|
<xsl:template match="variable_format">
|
117
|
<xsl:text>Variable: </xsl:text>
|
118
|
</xsl:template>
|
119
|
|
120
|
<xsl:template match="delimiter">
|
121
|
<xsl:text>Variable </xsl:text>
|
122
|
<xsl:text>(</xsl:text>
|
123
|
<xsl:value-of select="."/>
|
124
|
<xsl:text>)</xsl:text>
|
125
|
</xsl:template>
|
126
|
|
127
|
<xsl:template match="fixed_format">
|
128
|
<xsl:text>Fixed</xsl:text>
|
129
|
</xsl:template>
|
130
|
|
131
|
<xsl:template match="field_width">
|
132
|
<xsl:text>Fixed </xsl:text>
|
133
|
<xsl:text>(</xsl:text>
|
134
|
<xsl:value-of select="."/>
|
135
|
<xsl:text>)</xsl:text>
|
136
|
</xsl:template>
|
137
|
|
138
|
</xsl:stylesheet>
|