Project

General

Profile

1 57 bojilova
<?xml version="1.0"?>
2
<!--
3
* eml-file-display.xsl
4
*
5 61 bojilova
*      Authors: Jivka Bojilova
6 57 bojilova
*    Copyright: 2000 Regents of the University of California and the
7
*               National Center for Ecological Analysis and Synthesis
8
*  For Details: http://www.nceas.ucsb.edu/
9
*      Created: 2000 April 17
10
*    File Info: '$Id$'
11
*
12
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
13 61 bojilova
* convert an XML file that is valid with respect to the eml-file.dtd
14 57 bojilova
* module of the Ecological Metadata Language (EML) into an HTML format
15
* suitable for rendering with modern web browsers.
16
-->
17 63 bojilova
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
18 57 bojilova
19 63 bojilova
  <xsl:output method="html" encoding="iso-8859-1"/>
20 57 bojilova
  <xsl:template match="/">
21
    <html>
22
      <head>
23
        <link rel="stylesheet" type="text/css" href="./rowcol.css" />
24
      </head>
25
      <body class="emlbody">
26
        <center>
27 61 bojilova
          <h2>File structure description</h2>
28
          <h4>Ecological Metadata Language</h4>
29 57 bojilova
        </center>
30
        <xsl:apply-templates select="eml-file/meta_file_id"/>
31 61 bojilova
        <table width="750" border="0" cellspacing="0" cellpadding="1" bgcolor="#C0D3E7">
32
	  <tr>
33
	    <td><b>Data Set File</b></td>
34
	  </tr>
35
	</table>
36
        <xsl:apply-templates select="eml-file/file"/>
37
38
      </body>
39
    </html>
40
  </xsl:template>
41
42
  <xsl:template match="file">
43
44
	<table width="750" border="1" cellspacing="0" cellpadding="1" bgcolor="fffcfc">
45
          <tr>
46 62 bojilova
            <th width="25%" align="left"><xsl:text>File Name</xsl:text></th>
47
            <td><xsl:value-of select="file_name"/>
48 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
49 57 bojilova
          </tr>
50 61 bojilova
          <tr>
51 62 bojilova
            <th align="left"><xsl:text>File Size</xsl:text></th>
52
            <td>
53 61 bojilova
		<xsl:value-of select="file_size/amount"/>
54
                <xsl:value-of select="file_size/unit"/>
55 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
56 61 bojilova
          </tr>
57
          <tr>
58 62 bojilova
            <th align="left"><xsl:text>File Format</xsl:text></th>
59
            <td><xsl:apply-templates select="format"/>
60 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
61 61 bojilova
          </tr>
62
          <tr>
63 62 bojilova
            <th align="left"><xsl:text>Orientation</xsl:text></th>
64
            <td><xsl:apply-templates select="orientation"/>
65 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
66 61 bojilova
          </tr>
67
          <tr>
68 62 bojilova
            <th align="left"><xsl:text>Header Lines</xsl:text></th>
69
            <td><xsl:value-of select="header_lines"/>
70 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
71 61 bojilova
          </tr>
72
          <tr>
73 62 bojilova
            <th align="left"><xsl:text>Case Sensitive</xsl:text></th>
74
            <td><xsl:apply-templates select="case_sensitive"/>
75 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
76 61 bojilova
          </tr>
77
          <tr>
78 62 bojilova
            <th align="left"><xsl:text>Geographic Coverage</xsl:text></th>
79
            <td>
80 61 bojilova
		<xsl:if test="geographic_coverage/paragraph/text() or geographic_coverage/coordinates/lattitude/text() or geographic_coverage/coordinates/longitude/text()"><ul>
81 57 bojilova
                <xsl:for-each select="geographic_coverage">
82
                <li><xsl:for-each select="paragraph">
83
                      <xsl:value-of select="."/><br/>
84
                    </xsl:for-each>
85
                    <xsl:for-each select="coordinates">
86 61 bojilova
                      <xsl:value-of select="lattitude"/>la -
87
                      <xsl:value-of select="longitude"/>lo<br/>
88 57 bojilova
                    </xsl:for-each>
89
                </li>
90
                </xsl:for-each>
91 61 bojilova
                </ul></xsl:if>
92 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
93 61 bojilova
          </tr>
94
          <tr>
95 62 bojilova
            <th align="left"><xsl:text>Temporal Coverage</xsl:text></th>
96
            <td>
97 61 bojilova
		<xsl:if test="temporal_coverage/*/*/*/text()"><ul>
98 57 bojilova
                <xsl:for-each select="temporal_coverage">
99
                <li><xsl:text>Start Date </xsl:text>
100
                    <xsl:apply-templates select="start_date/datetime"/>
101
                    <xsl:text> - Stop Date </xsl:text>
102
                    <xsl:apply-templates select="stop_date/datetime"/>
103
                </li>
104
                </xsl:for-each>
105 61 bojilova
                </ul></xsl:if>
106 63 bojilova
                <xsl:text>&nbsp;</xsl:text></td>
107 61 bojilova
          </tr>
108
          <tr>
109 62 bojilova
            <th align="left"><xsl:text>Authentication</xsl:text></th>
110
            <td><xsl:for-each select="authentication">
111 63 bojilova
                  <xsl:value-of select="."/><br/>
112
                </xsl:for-each></td>
113 61 bojilova
          </tr>
114
          <tr>
115 62 bojilova
            <th align="left"><xsl:text>Data Problem</xsl:text></th>
116
            <td><xsl:for-each select="data_problem">
117 61 bojilova
                  <xsl:for-each select="paragraph">
118 57 bojilova
                    <xsl:value-of select="."/><br/>
119
                  </xsl:for-each>
120 63 bojilova
                </xsl:for-each></td>
121 61 bojilova
          </tr>
122
123 57 bojilova
        </table>
124
  </xsl:template>
125
126
  <xsl:template match="meta_file_id">
127 61 bojilova
    <table border="0" cellspacing="0" cellpadding="1">
128 57 bojilova
      <tr>
129
        <td class="shaded">
130
          <b><xsl:text>Metadata File ID:</xsl:text></b>
131
        </td>
132
        <td>
133
          <xsl:value-of select="."/>
134
        </td>
135
      </tr>
136
    </table>
137
  </xsl:template>
138
139
  <xsl:template match="format">
140
    <xsl:choose>
141
       <xsl:when test="compressed">Compressed - <xsl:value-of select="compressed"/></xsl:when>
142
       <xsl:when test="encoded">Encoded - <xsl:value-of select="encoded"/></xsl:when>
143
       <xsl:when test="base_file_type/ASCII">ASCII file <xsl:value-of select="record_delimiter"/></xsl:when>
144
       <xsl:when test="base_file_type/binary">Binary file</xsl:when>
145
     </xsl:choose>
146
  </xsl:template>
147
148
  <xsl:template match="orientation">
149
    <xsl:choose>
150
      <xsl:when test="@columnorrow='columnmajor'">File column is major</xsl:when>
151
      <xsl:when test="@columnorrow='rowmajor'">File row is major</xsl:when>
152
     </xsl:choose>
153
  </xsl:template>
154
155
  <xsl:template match="case_sensitive">
156
    <xsl:choose>
157
      <xsl:when test="@yesorno='n'">No case sensitive fields</xsl:when>
158
      <xsl:when test="@yesorno='y'">Fields are case sensitive</xsl:when>
159
    </xsl:choose>
160
  </xsl:template>
161
162
  <xsl:template match="datetime">
163
    <xsl:value-of select="year"/><xsl:text>/</xsl:text>
164
    <xsl:value-of select="month"/><xsl:text>/</xsl:text>
165
    <xsl:value-of select="day"/><xsl:text> </xsl:text>
166
    <xsl:value-of select="hour"/><xsl:text>:</xsl:text>
167
    <xsl:value-of select="minute"/><xsl:text>:</xsl:text>
168
    <xsl:value-of select="second"/><xsl:text>:</xsl:text>
169
    <xsl:value-of select="second_fraction"/>
170
  </xsl:template>
171
172
</xsl:stylesheet>