Project

General

Profile

1
<?xml version="1.0"?> 
2
<!--   
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
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-file.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
  <xsl:template match="/">
36
    <html>       
37
      <head> 	
38
        <link rel="stylesheet" type="text/css" 
39
              href="@style-path@/default.css" />
40
      </head>   
41
      <body> 	
42
        <center>           
43
          <h2>Table structure description</h2>           
44
          <h4>Ecological Metadata Language</h4>         
45
        </center>
46

    
47
        <table width="750" border="0" cellspacing="0" cellpadding="1" 
48
               class="tablehead">
49
          <tr>         
50
            <th width="25%" align="left"><xsl:text>Table Name</xsl:text></th>
51
            <td><xsl:value-of select="table-entity/entityName"/></td>
52
          </tr>          
53
	</table>         
54

    
55
	<table width="750" border="0" cellspacing="0" cellpadding="1">
56
          <tr>         
57
            <th width="25%" align="left"><xsl:text>Metadata ID</xsl:text></th>
58
            <td><xsl:value-of select="table-entity/identifier"/></td>
59
          </tr>          
60
          <tr>         
61
            <th width="25%" align="left"><xsl:text>Table Description</xsl:text></th>
62
            <td><xsl:value-of select="table-entity/entityDescription"/></td>
63
          </tr>          
64
          <tr>          
65
            <th align="left"><xsl:text>Orientation</xsl:text></th>         
66
            <td><xsl:apply-templates select="table-entity/orientation"/>               
67
                </td>
68
          </tr>          
69
          <tr>          
70
            <th align="left"><xsl:text>Case Sensitive</xsl:text></th>         
71
            <td><xsl:apply-templates select="table-entity/caseSensitive"/>               
72
                </td>
73
          </tr>          
74
          <tr>          
75
            <th align="left"><xsl:text>Number of Records</xsl:text></th>         
76
            <td><xsl:apply-templates select="table-entity/numberOfRecords"/>               
77
                </td>
78
          </tr>          
79
<!-- Removed for now until we have a better style for displaying coverage
80
          <tr>          
81
            <th align="left"><xsl:text>Geographic Coverage</xsl:text></th>         
82
            <td>
83
		<xsl:if test="geographic_coverage/paragraph/text() or geographic_coverage/coordinates/lattitude/text() or geographic_coverage/coordinates/longitude/text()"><ul>
84
                <xsl:for-each select="geographic_coverage">
85
                <li><xsl:for-each select="paragraph">
86
                      <xsl:value-of select="."/><br/>
87
                    </xsl:for-each>                     
88
                    <xsl:for-each select="coordinates">                        
89
                      <xsl:value-of select="lattitude"/>la -                         
90
                      <xsl:value-of select="longitude"/>lo<br/>
91
                    </xsl:for-each>                 
92
                </li>               
93
                </xsl:for-each>               
94
                </ul></xsl:if>
95
                </td>
96
          </tr>          
97
-->
98
<!-- Removed for now until we have a better style for displaying coverage
99
          <tr>          
100
            <th align="left"><xsl:text>Temporal Coverage</xsl:text></th>         
101
            <td>
102
		<xsl:if test="temporal_coverage/*/*/*/text()"><ul>
103
                <xsl:for-each select="temporal_coverage">                 
104
                <li><xsl:text>Start Date </xsl:text>
105
                    <xsl:apply-templates select="start_date/datetime"/> 
106
                    <xsl:text> - Stop Date </xsl:text>
107
                    <xsl:apply-templates select="stop_date/datetime"/>
108
                </li>
109
                </xsl:for-each>
110
                </ul></xsl:if>
111
                </td>
112
          </tr>          
113
-->
114

    
115
        </table>
116
      </body>
117
    </html>
118
  </xsl:template>
119

    
120
  <xsl:template match="table-entity/identifier">
121
    <table border="0" cellspacing="0" cellpadding="1">
122
      <tr>
123
        <td class="highlight">
124
          <b><xsl:text>Metadata ID:</xsl:text></b>
125
        </td>
126
        <td>
127
          <xsl:value-of select="."/>
128
        </td>
129
      </tr>
130
    </table>
131
  </xsl:template>
132

    
133
  <xsl:template match="orientation">
134
      <xsl:value-of select="@columnorrow"/>
135
  </xsl:template>
136

    
137
  <xsl:template match="caseSensitive">
138
    <xsl:choose>
139
      <xsl:when test="@yesorno='no'">No case sensitive fields</xsl:when>
140
      <xsl:when test="@yesorno='yes'">Fields are case sensitive</xsl:when>
141
    </xsl:choose>
142
  </xsl:template>
143

    
144
  <xsl:template match="datetime">
145
    <xsl:value-of select="year"/><xsl:text>/</xsl:text>
146
    <xsl:value-of select="month"/><xsl:text>/</xsl:text>
147
    <xsl:value-of select="day"/><xsl:text> </xsl:text>
148
    <xsl:value-of select="hour"/><xsl:text>:</xsl:text>
149
    <xsl:value-of select="minute"/><xsl:text>:</xsl:text>
150
    <xsl:value-of select="second"/><xsl:text>:</xsl:text>
151
    <xsl:value-of select="second_fraction"/>
152
  </xsl:template>
153

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