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: tao $'
10
  *     '$Date: 2003-06-05 18:45:35 -0700 (Thu, 05 Jun 2003) $'
11
  * '$Revision: 1635 $'
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-dataset.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:import href="eml-resource-2.0.0.xsl"/>
35
  <xsl:import href="eml-party-2.0.0.xsl"/>
36
  <xsl:import href="eml-distribution-2.0.0.xsl"/>
37
  <xsl:import href="eml-coverage-2.0.0.xsl"/>
38
  <xsl:import href="eml-access-2.0.0.xsl"/>
39
  
40
  <xsl:output method="html" encoding="iso-8859-1"/>
41
  
42
  <xsl:template match="dataset" mode="dataset">
43
    <table class="tabledefault" width="100%">
44
      <xsl:call-template name="datasetresource"/>
45
      <xsl:call-template name="datasetaccess"/>
46
      <xsl:call-template name="datasetpurpose"/>
47
      <xsl:call-template name="datasetmaintenance"/>
48
      <xsl:call-template name="datasetcontact"/>
49
      <xsl:call-template name="datasetpublisher"/>
50
      <xsl:call-template name="datasetpubplace"/>
51
    </table>
52
    
53
  </xsl:template>
54
  
55
  <xsl:template name="datasetresource">
56
     <tr>
57
        <td colspan="2" width="100%">
58
          <xsl:call-template name="resource">
59
            <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
60
            <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
61
          </xsl:call-template>
62
       </td>
63
     </tr>
64
  </xsl:template>
65
  
66
 
67
  
68
  <xsl:template name="datasetpurpose">
69
    <xsl:for-each select="purpose">
70
       <tr>
71
            <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
72
            Purpose:
73
            </td>
74
            <td width="{$secondColWidth}" class="{$secondColStyle}" >
75
             &#160;
76
            </td>
77
       </tr>
78
       <tr>
79
        <td colspan="2" width="100%">
80
        <xsl:call-template name="text">
81
          <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
82
          <xsl:with-param name="textsubHeaderStyle" select="$subHeaderStyle"/>
83
        </xsl:call-template>
84
        </td>
85
      </tr>
86
    </xsl:for-each>
87
  </xsl:template>
88
  
89
  <xsl:template name="datasetmaintenance">
90
    <xsl:for-each select="maintenance">
91
      <tr><td class="{$subHeaderStyle}" colspan="2">
92
        <xsl:text>Maintenance:</xsl:text>
93
     </td></tr>
94
     <xsl:call-template name="mantenancedescription"/>
95
      <tr>
96
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
97
          Frequency:
98
          </td>
99
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
100
           <xsl:value-of select="maintenanceUpdateFrequency"/>
101
          </td>
102
     </tr>
103
     <xsl:call-template name="changehistory"/>
104
   </xsl:for-each>
105
  </xsl:template>
106
  
107
  <xsl:template name="maintenancedescription">
108
   <xsl:for-each select="description">
109
     <tr>
110
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
111
          Description:
112
          </td>
113
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
114
           &#160;
115
          </td>
116
     </tr>
117
     <tr>
118
        <td colspan="2" width="100%">
119
        <xsl:call-template name="text">
120
          <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
121
          <xsl:with-param name="textsubHeaderStyle" select="$subHeaderStyle"/>
122
        </xsl:call-template>
123
        </td>
124
      </tr>
125
    </xsl:for-each>
126
  </xsl:template>
127
  
128
   <xsl:template name="datasetchangehistory">
129
   <xsl:if test="changeHistory">
130
     <tr>
131
          <td width="{$firstColWidth}" align="right" class="{$firstColStyle}">
132
          History:
133
          </td>
134
          <td width="{$secondColWidth}" class="{$secondColStyle}" >
135
            <table width="100%">
136
              <xsl:for-each select="changeHistory">
137
                <xsl:call-template name="historydetails"/>
138
              </xsl:for-each>
139
            </table>
140
          </td>
141
     </tr>
142
     </xsl:if>
143
   </xsl:template>
144
   
145
   <xsl:template name="historydetails">
146
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
147
            scope:</td>
148
            <td width="{$secondColWidth}" class="{$secondColStyle}">
149
            <xsl:value-of select="changeScope"/>
150
        </td></tr>
151
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
152
            old value:</td>
153
            <td width="{$secondColWidth}" class="{$secondColStyle}">
154
            <xsl:value-of select="oldValue"/>
155
        </td></tr>
156
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
157
            change date:</td>
158
            <td width="{$secondColWidth}" class="{$secondColStyle}">
159
            <xsl:value-of select="changeDate"/>
160
        </td></tr>
161
        <xsl:if test="comment and normalize-space(comment)!=''">
162
          <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
163
            comment:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
164
            <xsl:value-of select="comment"/>
165
          </td></tr>
166
        </xsl:if>
167
  </xsl:template>
168
  
169
  <xsl:template name="datasetcontact">
170
    <tr><td class="{$subHeaderStyle}" colspan="2">
171
        <xsl:text>Contact:</xsl:text>
172
     </td></tr>
173
    <xsl:for-each select="contact">
174
     <tr><td colspan="2">
175
       <xsl:call-template name="party">
176
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
177
       </xsl:call-template>
178
     </td></tr>
179
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
180
      <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
181
    </xsl:for-each>
182
  </xsl:template>
183
  
184
  <xsl:template name="datasetpublisher">
185
   <xsl:for-each select="publisher">
186
     <tr><td class="{$subHeaderStyle}" colspan="2">
187
        <xsl:text>Publisher:</xsl:text>
188
     </td></tr>
189
     <tr><td colspan="2">
190
       <xsl:call-template name="party">
191
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
192
       </xsl:call-template>
193
     </td></tr>
194
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
195
      <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td></tr>
196
   </xsl:for-each>
197
  </xsl:template>
198
  
199
  <xsl:template name="datasetpubplace">
200
    <xsl:for-each select="pubPlace">
201
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
202
           Publish Place:</td>
203
          <td width="{$secondColWidth}" class="{$secondColStyle}">
204
          <xsl:value-of select="."/>
205
          </td>
206
      </tr>
207
   </xsl:for-each>
208
  </xsl:template>
209
   
210
   <xsl:template name="datasetaccess">
211
    <xsl:for-each select="access">
212
      <tr>
213
        <td colspan="2" width="100%">
214
        <xsl:call-template name="access">
215
          <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
216
          <xsl:with-param name="accesssubHeaderStyle" select="$subHeaderStyle"/>
217
        </xsl:call-template>
218
        </td>
219
      </tr>
220
    </xsl:for-each>
221
  </xsl:template>
222
  
223
  <xsl:template match="text()" mode="dataset" />
224
  <xsl:template match="text()" mode="resource" />
225

    
226
</xsl:stylesheet>
(10-10/26)