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 64 bojilova
  <xsl:output method="html" encoding="iso-8859-1"/>
20 40 jones
21
  <xsl:template match="/">
22
    <html>
23
      <head>
24 365 jones
        <link rel="stylesheet" type="text/css" href="@html-path@/style/rowcol.css" />
25 40 jones
      </head>
26
      <body class="emlbody">
27 64 bojilova
        <center>
28 40 jones
          <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 497 jones
        <tr>
37
        <th class="sectionhead"><xsl:text>Attribute Name</xsl:text></th>
38
        <th class="sectionhead"><xsl:text>Attribute Definition</xsl:text></th>
39
        <th class="sectionhead"><xsl:text>Unit</xsl:text></th>
40
        <th class="sectionhead"><xsl:text>Type</xsl:text></th>
41
        <th class="sectionhead"><xsl:text>Codes</xsl:text></th>
42
        <th class="sectionhead"><xsl:text>Range</xsl:text></th>
43
        <th class="sectionhead"><xsl:text>Missing</xsl:text></th>
44
        <th class="sectionhead"><xsl:text>Precision</xsl:text></th>
45
        <th class="sectionhead"><xsl:text>Format</xsl:text></th>
46 40 jones
        </tr>
47
48
        <xsl:for-each select="eml-variable/variable">
49
          <tr valign="top">
50
            <xsl:attribute name="class">
51
              <xsl:choose>
52 497 jones
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
53
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
54 40 jones
              </xsl:choose>
55
            </xsl:attribute>
56
57
          <td><b><xsl:value-of select="variable_name"/></b>
58 73 jones
              <xsl:text>&nbsp;</xsl:text></td>
59 40 jones
          <td><xsl:value-of select="variable_definition"/>
60 73 jones
              <xsl:text>&nbsp;</xsl:text></td>
61 40 jones
          <td><xsl:value-of select="unit"/>
62 73 jones
              <xsl:text>&nbsp;</xsl:text></td>
63 40 jones
          <td><xsl:value-of select="storage_type"/>
64 73 jones
              <xsl:text>&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 73 jones
              <xsl:text>&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 73 jones
              <xsl:text>&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 73 jones
              <xsl:text>&nbsp;</xsl:text></td>
87 40 jones
          <td><xsl:value-of select="precision"/>
88 73 jones
              <xsl:text>&nbsp;</xsl:text></td>
89 40 jones
          <td><xsl:apply-templates select="field_format"/>
90 73 jones
              <xsl:text>&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 497 jones
        <td class="highlight">
103 40 jones
           <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 73 jones
</xsl:stylesheet>