Project

General

Profile

1 553 tao
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
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 1631 tao
  <xsl:import href="eml-text-2.0.0.xsl"/>
36 553 tao
  <xsl:import href="eml-dataset-2.0.0.xsl"/>
37 1632 tao
  <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 553 tao
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 1632 tao
       <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 553 tao
   </xsl:template>
72
73 1632 tao
   <!--********************************************************
74
                             dataset part
75
       ********************************************************-->
76
77
   <xsl:template name="emldataset">
78
      <table class="tabledefault" width="100%">
79 553 tao
          <xsl:if test="$displaymodule='dataset'">
80 1632 tao
             <xsl:call-template name="datasetpart"/>
81 553 tao
          </xsl:if>
82 1632 tao
          <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 553 tao
   </xsl:template>
90
91 1632 tao
   <!--*************** Data set part *************-->
92
   <xsl:template name="datasetpart">
93
      <tr><td>
94
         <center>
95 1661 tao
            <h3>Data Set Description</h3>
96
           </center>
97 1632 tao
      </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 1661 tao
            <h3>Entity Description</h3>
118
           </center>
119 1632 tao
      </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 1661 tao
            <h3>Attributes Description</h3>
153 1632 tao
         </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 1661 tao
          <h3>Citation Description</h3>
185 553 tao
        </center>
186 1632 tao
        <table class="tabledefault" width="100%">
187
        <tr>
188
          <td width="100%">
189
            <xsl:call-template name="identifier">
190 553 tao
              <xsl:with-param name="packageID" select="../@packageId"/>
191
              <xsl:with-param name="system" select="../@system"/>
192 1632 tao
           </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 553 tao
   </xsl:template>
205
206 1632 tao
207
208
     <!--********************************************************
209
                    Software part
210
       ********************************************************-->
211
212
   <xsl:template name="emlsoftware">
213
     <center>
214 1661 tao
          <h3>Software Description</h3>
215 1632 tao
     </center>
216
     <table class="tabledefault" width="100%">
217
       <tr><td width="100%">
218
           <xsl:call-template name="identifier">
219 553 tao
              <xsl:with-param name="packageID" select="../@packageId"/>
220
              <xsl:with-param name="system" select="../@system"/>
221 1632 tao
           </xsl:call-template>
222
        </td></tr>
223
     </table>
224 553 tao
   </xsl:template>
225
226 1632 tao
227
     <!--********************************************************
228
                    Protocal part
229
       ********************************************************-->
230
231
   <xsl:template name="emlprotocol">
232
    <center>
233 1661 tao
          <h3>Protocol Description</h3>
234
    </center>
235 1632 tao
     <table class="tabledefault" width="100%">
236
       <tr><td width="100%">
237
          <xsl:call-template name="identifier">
238 553 tao
              <xsl:with-param name="packageID" select="../@packageId"/>
239
              <xsl:with-param name="system" select="../@system"/>
240 1632 tao
          </xsl:call-template>
241
       </td></tr>
242
     </table>
243 553 tao
   </xsl:template>
244
245
</xsl:stylesheet>