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: 2002-02-02 00:56:13 -0800 (Sat, 02 Feb 2002) $'
11
  * '$Revision: 919 $'
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-attribute/identifier"/>
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
        </tr>
62

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

    
72
          <td><b><xsl:value-of select="attributeName"/></b>
73
              </td>
74
          <td><xsl:value-of select="attributeDefinition"/>
75
              </td>
76
          <td><xsl:value-of select="unit"/>
77
              </td>
78
          <td><xsl:value-of select="dataType"/>
79
              </td>
80
          <td><ul>
81
              <xsl:for-each select="attributeDomain/enumeratedDomain">
82
                <li><xsl:value-of select="code"/>
83
                    <xsl:text> - </xsl:text>
84
                    <xsl:value-of select="definition"/>
85
                </li>
86
              </xsl:for-each>
87
              </ul>
88
              </td>
89
          <td><ul>
90
              <xsl:for-each select="attributeDomain/numericDomain">
91
                <li><xsl:value-of select="minimum"/>
92
                    <xsl:text> - </xsl:text>
93
                    <xsl:value-of select="maximum"/>
94
                </li>
95
              </xsl:for-each>
96
              </ul>
97
              </td>
98
          <td><xsl:for-each select="missingValueCode">
99
                <xsl:value-of select="."/><br />
100
              </xsl:for-each>
101
              </td>
102
          <td><xsl:value-of select="precision"/>
103
              </td>
104
          </tr>
105
        </xsl:for-each>
106
        </table>
107

    
108
      </body>
109
    </html>
110
  </xsl:template>
111

    
112
  <xsl:template match="identifier">
113
    <table>
114
      <tr>
115
        <td class="highlight">
116
           <b><xsl:text>Metadata File ID:</xsl:text></b>
117
        </td>
118
        <td>
119
            <xsl:value-of select="."/>
120
        </td>
121
      </tr>
122
    </table>
123
  </xsl:template>
124
</xsl:stylesheet>
(4-4/15)