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-11 20:06:56 -0700 (Wed, 11 Jun 2003) $'
11
  * '$Revision: 1661 $'
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
  <xsl:import href="eml-settings-2.0.0.xsl"/>
34
  <xsl:import href="eml-identifier-2.0.0.xsl"/>
35
  <xsl:import href="eml-text-2.0.0.xsl"/>
36
  <xsl:import href="eml-dataset-2.0.0.xsl"/>
37
  <xsl:import href="eml-entity-2.0.0.xsl"/>
38
  <xsl:import href="eml-physical-2.0.0.xsl"/>
39
  <xsl:import href="eml-datatable-2.0.0.xsl"/>
40
  <xsl:import href="eml-attribute-2.0.0.xsl"/>
41

    
42
  <xsl:output method="html" encoding="iso-8859-1"/>
43
  <!-- global variables to store id node set in case to be referenced-->
44
  <xsl:variable name="ids" select="//*[@id!='']"/>
45
  
46
  <xsl:template match="/">
47
    <html>
48
      <head>
49
        <link rel="stylesheet" type="text/css" 
50
              href="{$stylePath}/{$qformat}.css" />
51
      </head>
52
      <body>
53
        <xsl:apply-templates select="*[local-name()='eml']"/>
54
      </body>
55
    </html>
56
   </xsl:template>
57
   
58
   <xsl:template match="*[local-name()='eml']">
59
       <xsl:for-each select="dataset">
60
         <xsl:call-template name="emldataset"/>
61
       </xsl:for-each>
62
       <xsl:for-each select="citation">
63
         <xsl:call-template name="emlcitation"/>
64
       </xsl:for-each>
65
       <xsl:for-each select="software">
66
         <xsl:call-template name="emlsoftware"/>
67
       </xsl:for-each>
68
       <xsl:for-each select="protocol">
69
         <xsl:call-template name="emlprotocol"/>
70
       </xsl:for-each>
71
   </xsl:template>
72
   
73
   <!--********************************************************
74
                             dataset part
75
       ********************************************************-->
76
   
77
   <xsl:template name="emldataset">
78
      <table class="tabledefault" width="100%">
79
          <xsl:if test="$displaymodule='dataset'">
80
             <xsl:call-template name="datasetpart"/>  
81
          </xsl:if>
82
          <xsl:if test="$displaymodule='entity'">
83
             <xsl:call-template name="entitypart"/>
84
          </xsl:if>
85
          <xsl:if test="$displaymodule='attribute'">
86
             <xsl:call-template name="attributepart"/>
87
          </xsl:if>
88
     </table>
89
   </xsl:template>
90
   
91
   <!--*************** Data set part *************-->
92
   <xsl:template name="datasetpart">
93
      <tr><td>
94
         <center>
95
            <h3>Data Set Description</h3>
96
           </center>
97
      </td></tr>
98
      <tr>
99
          <td width="100%">
100
             <xsl:call-template name="identifier">
101
                <xsl:with-param name="packageID" select="../@packageId"/>
102
                <xsl:with-param name="system" select="../@system"/>
103
             </xsl:call-template>
104
          </td>
105
      </tr>
106
      <tr>
107
           <td width="100%">
108
              <xsl:apply-templates select="." mode="dataset"/>
109
           </td>
110
      </tr>  
111
   </xsl:template>
112
   
113
   <!--************ Entity part *****************-->
114
    <xsl:template name="entitypart">
115
      <tr><td>
116
         <center>
117
            <h3>Entity Description</h3>
118
           </center>
119
      </td></tr>
120
      <tr>
121
          <td width="100%">
122
             <xsl:call-template name="identifier">
123
                <xsl:with-param name="packageID" select="../@packageId"/>
124
                <xsl:with-param name="system" select="../@system"/>
125
             </xsl:call-template>
126
          </td>
127
      </tr>
128
      <tr>
129
           <td width="100%">
130
             <!-- find the subtree to process -->
131
             <xsl:if test="$entitytype='dataTable'">
132
               <xsl:for-each select="dataTable">
133
                  <xsl:if test="position()=$entityindex">
134
                     <xsl:call-template name="dataTable">
135
                         <xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
136
                         <xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>  
137
                         <xsl:with-param name="docid" select="$docid"/>
138
                         <xsl:with-param name="entitytype" select="$entitytype"/>
139
                         <xsl:with-param name="entityindex" select="$entityindex"/>
140
                     </xsl:call-template>
141
                  </xsl:if>
142
              </xsl:for-each>
143
            </xsl:if>
144
          </td>
145
      </tr>  
146
   </xsl:template>
147
   
148
   <!--************ Attribute part *****************-->
149
    <xsl:template name="attributepart">
150
      <tr><td>
151
         <center>
152
            <h3>Attributes Description</h3>
153
         </center>
154
      </td></tr>
155
      <tr>
156
           <td width="100%">
157
              <!-- find the subtree to process -->
158
            <xsl:if test="$entitytype='dataTable'">
159
              <xsl:for-each select="dataTable">
160
                  <xsl:if test="position()=$entityindex">
161
                      <xsl:for-each select="attributeList">
162
                         <xsl:call-template name="attributelist">
163
                            <xsl:with-param name="docid" select="$docid"/>
164
                            <xsl:with-param name="entitytype" select="$entitytype"/>
165
                            <xsl:with-param name="entityindex" select="$entityindex"/>
166
                         </xsl:call-template>
167
                      </xsl:for-each>
168
                  </xsl:if>
169
              </xsl:for-each>
170
            </xsl:if>
171
          </td>
172
      </tr>  
173
   </xsl:template>
174
   
175
   
176
   
177
   
178
   
179
     <!--********************************************************
180
                     Citation part
181
       ********************************************************-->
182
   <xsl:template name="emlcitation">
183
       <center>
184
          <h3>Citation Description</h3>
185
        </center>
186
        <table class="tabledefault" width="100%">
187
        <tr>
188
          <td width="100%">
189
            <xsl:call-template name="identifier">
190
              <xsl:with-param name="packageID" select="../@packageId"/>
191
              <xsl:with-param name="system" select="../@system"/>
192
           </xsl:call-template>
193
          </td>
194
        </tr>
195
        <tr>
196
          <td width="100%">
197
            <xsl:call-template name="citation">
198
               <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
199
               <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
200
           </xsl:call-template>
201
          </td>
202
        </tr>
203
     </table>
204
   </xsl:template>
205
   
206
   
207
      
208
     <!--********************************************************
209
                    Software part
210
       ********************************************************-->
211
   
212
   <xsl:template name="emlsoftware">
213
     <center>
214
          <h3>Software Description</h3>
215
     </center>
216
     <table class="tabledefault" width="100%">
217
       <tr><td width="100%">
218
           <xsl:call-template name="identifier">
219
              <xsl:with-param name="packageID" select="../@packageId"/>
220
              <xsl:with-param name="system" select="../@system"/>
221
           </xsl:call-template>
222
        </td></tr>
223
     </table>
224
   </xsl:template>
225
   
226
     
227
     <!--********************************************************
228
                    Protocal part
229
       ********************************************************-->
230
   
231
   <xsl:template name="emlprotocol">
232
    <center>
233
          <h3>Protocol Description</h3>
234
    </center>
235
     <table class="tabledefault" width="100%">
236
       <tr><td width="100%">
237
          <xsl:call-template name="identifier">
238
              <xsl:with-param name="packageID" select="../@packageId"/>
239
              <xsl:with-param name="system" select="../@system"/>
240
          </xsl:call-template>
241
       </td></tr>
242
     </table>
243
   </xsl:template>
244
    
245
</xsl:stylesheet>
(2-2/27)