Project

General

Profile

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 40 jones
  <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 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
59 40 jones
          <td><xsl:value-of select="variable_definition"/>
60 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
61 40 jones
          <td><xsl:value-of select="unit"/>
62 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
63 40 jones
          <td><xsl:value-of select="storage_type"/>
64 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
65 40 jones
          <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 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
74 40 jones
          <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 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
83 40 jones
          <td><xsl:for-each select="missing_value_code">
84
                <xsl:value-of select="."/><br />
85
              </xsl:for-each>
86 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
87 40 jones
          <td><xsl:value-of select="precision"/>
88 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
89 40 jones
          <td><xsl:apply-templates select="field_format"/>
90 41 jones
              <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
91 40 jones
          </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 38 jones
</xsl:stylesheet>