Project

General

Profile

1 34 jones
<?xml version="1.0"?>
2
<!--
3
  * eml-dataset-display.xsl
4
  *
5
  *      Authors: Matt Jones
6
  *    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 5
10
  *      Version: 0.01
11
  *    File Info: '$Id$'
12
  *
13
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
14
  * convert an XML file that is valid with respect to the eml-dataset.dtd
15
  * module of the Ecological Metadata Language (EML) into an HTML format
16
  * suitable for rendering with modern web browsers.
17
-->
18
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
19
20 65 bojilova
  <xsl:output method="html" encoding="iso-8859-1"/>
21 34 jones
22
  <xsl:template match="/">
23
    <html>
24
      <head>
25 85 jones
        <link rel="stylesheet" type="text/css" href="/xmltodb/xsqltest/rowcol.css" />
26 34 jones
      </head>
27 39 jones
      <body class="emlbody">
28 65 bojilova
        <center>
29 34 jones
          <h1>Data set description</h1>
30
          <h3>Ecological Metadata Language</h3>
31
        </center>
32
        <xsl:apply-templates/>
33
34
        <table width="100%">
35
        <tr><td class="rowodd">
36
        <b><xsl:text>Keywords:</xsl:text></b>
37
        </td></tr>
38
        <tr><td>
39
          <ul>
40
            <xsl:for-each select="//keyword_info/keyword">
41
              <li><xsl:value-of select="."/></li>
42
            </xsl:for-each>
43
          </ul>
44
        </td></tr>
45
        </table>
46
47
48
        <table width="100%">
49
        <tr><td class="rowodd">
50
        <b><xsl:text>Related Metadata and Data Files:</xsl:text></b>
51
        </td></tr>
52
        <tr><td>
53
        <ul>
54
          <xsl:for-each select="//relations">
55
            <li>
56
             <xsl:value-of select="@object"/>
57
             <xsl:text> </xsl:text>
58
             <xsl:value-of select="@relation"/>
59
             <xsl:text> </xsl:text>
60
             <xsl:value-of select="@target"/>
61
            </li>
62
          </xsl:for-each>
63
        </ul>
64
        </td></tr>
65
        </table>
66
67
      </body>
68
    </html>
69
  </xsl:template>
70
71
  <xsl:template match="meta_file_id">
72
    <table width="100%">
73
    <tr>
74
    <td class="rowodd"><b><xsl:text>Metadata File ID:</xsl:text></b></td>
75
    <td><xsl:value-of select="."/></td>
76
    </tr>
77
      <xsl:for-each select="//dataset_id|//title">
78
        <tr>
79
        <xsl:if test="name(.)='dataset_id'">
80
          <td class="rowodd"><b><xsl:text>Data set ID:</xsl:text></b></td>
81
        </xsl:if>
82
        <xsl:if test="name(.)='title'">
83
          <td class="rowodd"><b><xsl:text>Title:</xsl:text></b></td>
84
        </xsl:if>
85
        <td><xsl:value-of select="."/></td>
86
        </tr>
87
      </xsl:for-each>
88
    </table>
89
90
  </xsl:template>
91
92
  <xsl:template match="dataset_id"/>
93
  <xsl:template match="title"/>
94
95
  <xsl:template match="originator[1]">
96
      <table width="100%">
97
      <tr><td class="rowodd">
98
      <b><xsl:text>Data Set Owner(s):</xsl:text></b>
99
      </td></tr>
100
      </table>
101
  </xsl:template>
102
103
  <xsl:template match="party_org">
104
    <br><b><xsl:value-of select="."/></b></br>
105
  </xsl:template>
106
107
  <xsl:template match="party_individual">
108
    <br>
109
    <b>
110
       <xsl:value-of select="./salutation"/>
111
       <xsl:text> </xsl:text>
112
       <xsl:value-of select="./given_name"/>
113
       <xsl:text> </xsl:text>
114
       <xsl:value-of select="./surname"/>
115
    </b></br>
116
    <br><xsl:value-of select="./title"/></br>
117
  </xsl:template>
118
119
  <xsl:template match="meta_address">
120
    <table>
121
    <xsl:for-each select="./address">
122
      <tr>
123
      <td><xsl:value-of select="."/></td>
124
      </tr>
125
    </xsl:for-each>
126
    <tr>
127
    <td><xsl:value-of select="./city"/>
128
        <xsl:text>, </xsl:text>
129
        <xsl:value-of select="./admin_area"/>
130
        <xsl:text> </xsl:text>
131
        <xsl:value-of select="./postal_code"/>
132
    </td>
133
    </tr>
134
    <xsl:if test="./work_phone">
135
      <tr><td><xsl:text>Work: </xsl:text><xsl:value-of select="./work_phone"/>
136
       </td></tr>
137
    </xsl:if>
138
    <xsl:if test="./home_phone">
139
      <tr><td><xsl:text>Home: </xsl:text><xsl:value-of select="./home_phone"/>
140
       </td></tr>
141
    </xsl:if>
142
    <xsl:if test="./fax">
143
      <tr><td><xsl:text>Fax: </xsl:text><xsl:value-of select="./fax"/></td></tr>
144
    </xsl:if>
145
    <xsl:if test="./email">
146
      <tr><td><xsl:value-of select="./email"/></td></tr>
147
    </xsl:if>
148
    <xsl:if test="./resource_url">
149
      <tr><td><xsl:value-of select="./resource_url"/></td></tr>
150
    </xsl:if>
151
    </table>
152
  </xsl:template>
153
154
  <xsl:template match="abstract">
155
    <table width="100%">
156
    <tr>
157
    <td class="rowodd"><b><xsl:text>Abstract:</xsl:text></b></td>
158
    </tr>
159
    <tr>
160
    <td><xsl:value-of select="."/></td>
161
    </tr></table>
162
  </xsl:template>
163
164
  <xsl:template match="keyword_info"/>
165
  <xsl:template match="relations"/>
166
167 85 jones
</xsl:stylesheet>