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