Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones
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: jones $'
10
  *     '$Date: 2001-09-13 16:22:00 -0700 (Thu, 13 Sep 2001) $'
11
  * '$Revision: 827 $'
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

    
36
  <xsl:template match="/">
37
    <html>
38
      <head>
39
        <link rel="stylesheet" type="text/css" 
40
              href="@style-path@/default.css" />
41
      </head>
42
      <body>
43
        <center>
44
          <h1>Attribute structure description</h1>
45
          <h3>Ecological Metadata Language</h3>
46
        </center>
47
        
48
        <xsl:apply-templates select="eml-variable/meta_file_id"/>
49

    
50
        <h3>Attributes in the Data Set:</h3>
51
        <table width="100%">
52
        <tr>
53
        <th class="tablehead"><xsl:text>Attribute Name</xsl:text></th>
54
        <th class="tablehead"><xsl:text>Attribute Definition</xsl:text></th>
55
        <th class="tablehead"><xsl:text>Unit</xsl:text></th>
56
        <th class="tablehead"><xsl:text>Type</xsl:text></th>
57
        <th class="tablehead"><xsl:text>Codes</xsl:text></th>
58
        <th class="tablehead"><xsl:text>Range</xsl:text></th>
59
        <th class="tablehead"><xsl:text>Missing</xsl:text></th>
60
        <th class="tablehead"><xsl:text>Precision</xsl:text></th>
61
        <th class="tablehead"><xsl:text>Format</xsl:text></th>
62
        </tr>
63

    
64
        <xsl:for-each select="eml-variable/variable">
65
          <tr valign="top">
66
            <xsl:attribute name="class">
67
              <xsl:choose>
68
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
69
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
70
              </xsl:choose>
71
            </xsl:attribute>
72

    
73
          <td><b><xsl:value-of select="variable_name"/></b>
74
              <xsl:text>&nbsp;</xsl:text></td>
75
          <td><xsl:value-of select="variable_definition"/>
76
              <xsl:text>&nbsp;</xsl:text></td>
77
          <td><xsl:value-of select="unit"/>
78
              <xsl:text>&nbsp;</xsl:text></td>
79
          <td><xsl:value-of select="storage_type"/>
80
              <xsl:text>&nbsp;</xsl:text></td>
81
          <td><ul>
82
              <xsl:for-each select="code_definition">
83
                <li><xsl:value-of select="code"/>
84
                    <xsl:text> - </xsl:text>
85
                    <xsl:value-of select="definition"/>
86
                </li>
87
              </xsl:for-each>
88
              </ul>
89
              <xsl:text>&nbsp;</xsl:text></td>
90
          <td><ul>
91
              <xsl:for-each select="numeric_range">
92
                <li><xsl:value-of select="minimum"/>
93
                    <xsl:text> - </xsl:text>
94
                    <xsl:value-of select="maximum"/>
95
                </li>
96
              </xsl:for-each>
97
              </ul>
98
              <xsl:text>&nbsp;</xsl:text></td>
99
          <td><xsl:for-each select="missing_value_code">
100
                <xsl:value-of select="."/><br />
101
              </xsl:for-each>
102
              <xsl:text>&nbsp;</xsl:text></td>
103
          <td><xsl:value-of select="precision"/>
104
              <xsl:text>&nbsp;</xsl:text></td>
105
          <td><xsl:apply-templates select="field_format"/>
106
              <xsl:text>&nbsp;</xsl:text></td>
107
          </tr>
108
        </xsl:for-each>
109
        </table>
110

    
111
      </body>
112
    </html>
113
  </xsl:template>
114

    
115
  <xsl:template match="meta_file_id">
116
    <table>
117
      <tr>
118
        <td class="highlight">
119
           <b><xsl:text>Metadata File ID:</xsl:text></b>
120
        </td>
121
        <td>
122
            <xsl:value-of select="."/>
123
        </td>
124
      </tr>
125
    </table>
126
  </xsl:template>
127

    
128
  <xsl:template match="field_format">
129
    <xsl:apply-templates/>
130
  </xsl:template>
131

    
132
  <xsl:template match="variable_format">
133
    <xsl:text>Variable: </xsl:text>
134
  </xsl:template>
135

    
136
  <xsl:template match="delimiter">
137
    <xsl:text>Variable </xsl:text>
138
    <xsl:text>(</xsl:text>
139
    <xsl:value-of select="."/>
140
    <xsl:text>)</xsl:text>
141
  </xsl:template>
142

    
143
  <xsl:template match="fixed_format">
144
    <xsl:text>Fixed</xsl:text>
145
  </xsl:template>
146

    
147
  <xsl:template match="field_width">
148
    <xsl:text>Fixed </xsl:text>
149
    <xsl:text>(</xsl:text>
150
    <xsl:value-of select="."/>
151
    <xsl:text>)</xsl:text>
152
  </xsl:template>
153

    
154
</xsl:stylesheet>
(8-8/15)