Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
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: cjones $'
10
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
11
  * '$Revision: 3094 $'
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-file.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

    
35
  <xsl:output method="html" encoding="iso-8859-1"
36
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
37
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
38
              indent="yes" />  
39
  <!-- This module is for datatable module-->
40

    
41
  <xsl:template name="view">
42
      <xsl:param name="viewfirstColStyle"/>
43
      <xsl:param name="viewsubHeaderStyle"/>
44
      <xsl:param name="docid"/>
45
      <xsl:param name="entityindex"/>
46
      <table class="{$tabledefaultStyle}">
47
        <xsl:choose>
48
         <xsl:when test="references!=''">
49
          <xsl:variable name="ref_id" select="references"/>
50
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
51
          <xsl:for-each select="$references">
52
            <xsl:call-template name="viewCommon">
53
             <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
54
             <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
55
             <xsl:with-param name="docid" select="$docid"/>
56
             <xsl:with-param name="entityindex" select="$entityindex"/>
57
            </xsl:call-template>
58
          </xsl:for-each>
59
        </xsl:when>
60
        <xsl:otherwise>
61
           <xsl:call-template name="viewCommon">
62
             <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
63
             <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
64
             <xsl:with-param name="docid" select="$docid"/>
65
             <xsl:with-param name="entityindex" select="$entityindex"/>
66
            </xsl:call-template>
67
         </xsl:otherwise>
68
      </xsl:choose>
69
      </table>
70
  </xsl:template>
71

    
72
  <xsl:template name="viewCommon">
73
    <xsl:param name="viewfirstColStyle"/>
74
    <xsl:param name="viewsubHeaderStyle"/>
75
    <xsl:param name="docid"/>
76
    <xsl:param name="entityindex"/>
77
    <xsl:for-each select="entityName">
78
       <xsl:call-template name="entityName">
79
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
80
       </xsl:call-template>
81
    </xsl:for-each>
82
    <xsl:for-each select="queryStatement">
83
       <tr><td class="{$viewfirstColStyle}">
84
            Query Statement:
85
            </td>
86
            <td class="{$secondColStyle}">
87
            <xsl:value-of select="."/>
88
            </td>
89
       </tr>
90
    </xsl:for-each>
91
    <xsl:for-each select="alternateIdentifier">
92
       <xsl:call-template name="entityalternateIdentifier">
93
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
94
       </xsl:call-template>
95
    </xsl:for-each>
96
    <xsl:for-each select="entityDescription">
97
       <xsl:call-template name="entityDescription">
98
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
99
       </xsl:call-template>
100
    </xsl:for-each>
101
    <xsl:for-each select="additionalInfo">
102
       <xsl:call-template name="entityadditionalInfo">
103
          <xsl:with-param name="entityfirstColStyle" select="$viewfirstColStyle"/>
104
       </xsl:call-template>
105
    </xsl:for-each>
106
    <!-- call physical moduel without show distribution(we want see it later)-->
107
    <xsl:if test="physical">
108
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
109
        Physical Structure Description:
110
      </td></tr>
111
    </xsl:if>
112
    <xsl:for-each select="physical">
113
       <tr><td colspan="2">
114
        <xsl:call-template name="physical">
115
         <xsl:with-param name="physicalfirstColStyle" select="$viewfirstColStyle"/>
116
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
117
        </xsl:call-template>
118
        </td></tr>
119
    </xsl:for-each>
120

    
121
    <xsl:if test="coverage">
122
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
123
        Coverage Description:
124
      </td></tr>
125
    </xsl:if>
126
    <xsl:for-each select="coverage">
127
      <tr><td colspan="2">
128
        <xsl:call-template name="coverage">
129
        </xsl:call-template>
130
      </td></tr>
131
    </xsl:for-each>
132
    <xsl:if test="method">
133
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
134
        Method Description:
135
      </td></tr>
136
    </xsl:if>
137
    <xsl:for-each select="method">
138
      <tr><td colspan="2">
139
        <xsl:call-template name="method">
140
          <xsl:with-param name="methodfirstColStyle" select="$viewfirstColStyle"/>
141
          <xsl:with-param name="methodsubHeaderStyle" select="$viewsubHeaderStyle"/>
142
        </xsl:call-template>
143
      </td></tr>
144
    </xsl:for-each>
145
    <xsl:if test="constraint">
146
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
147
        Constraint:
148
      </td></tr>
149
    </xsl:if>
150
    <xsl:for-each select="constraint">
151
      <tr><td colspan="2">
152
        <xsl:call-template name="constraint">
153
          <xsl:with-param name="constraintfirstColStyle" select="$viewfirstColStyle"/>
154
        </xsl:call-template>
155
      </td></tr>
156
    </xsl:for-each>
157
    <xsl:if test="$withAttributes='1'">
158
     <xsl:for-each select="attributeList">
159
       <xsl:call-template name="viewAttributeList">
160
         <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
161
         <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
162
         <xsl:with-param name="docid" select="$docid"/>
163
         <xsl:with-param name="entityindex" select="$entityindex"/>
164
       </xsl:call-template>
165
     </xsl:for-each>
166
    </xsl:if>
167
    <xsl:if test="$withAttributes='1'">
168
     <!-- Here to display distribution info-->
169
    <xsl:for-each select="physical">
170
       <xsl:call-template name="viewShowDistribution">
171
          <xsl:with-param name="docid" select="$docid"/>
172
          <xsl:with-param name="entityindex" select="$entityindex"/>
173
          <xsl:with-param name="physicalindex" select="position()"/>
174
          <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
175
          <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
176
       </xsl:call-template>
177
    </xsl:for-each>
178
   </xsl:if>
179
  </xsl:template>
180

    
181
  <xsl:template name="viewShowDistribution">
182
     <xsl:param name="viewfirstColStyle"/>
183
     <xsl:param name="viewsubHeaderStyle"/>
184
     <xsl:param name="docid"/>
185
     <xsl:param name="level">entitylevel</xsl:param>
186
     <xsl:param name="entitytype">view</xsl:param>
187
     <xsl:param name="entityindex"/>
188
     <xsl:param name="physicalindex"/>
189
     <xsl:for-each select="distribution">
190
      <tr><td colspan="2">
191
        <xsl:call-template name="distribution">
192
          <xsl:with-param name="docid" select="$docid"/>
193
          <xsl:with-param name="level" select="$level"/>
194
          <xsl:with-param name="entitytype" select="$entitytype"/>
195
          <xsl:with-param name="entityindex" select="$entityindex"/>
196
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
197
          <xsl:with-param name="distributionindex" select="position()"/>
198
          <xsl:with-param name="disfirstColStyle" select="$viewfirstColStyle"/>
199
          <xsl:with-param name="dissubHeaderStyle" select="$viewsubHeaderStyle"/>
200
        </xsl:call-template>
201
      </td></tr>
202
    </xsl:for-each>
203
  </xsl:template>
204

    
205

    
206
  <xsl:template name="viewAttributeList">
207
    <xsl:param name="viewfirstColStyle"/>
208
    <xsl:param name="viewsubHeaderStyle"/>
209
    <xsl:param name="docid"/>
210
    <xsl:param name="entitytype">view</xsl:param>
211
    <xsl:param name="entityindex"/>
212
    <tr><td class="{$viewsubHeaderStyle}" colspan="2">
213
        <xsl:text>Attribute(s) Info:</xsl:text>
214
    </td></tr>
215
    <tr><td colspan="2">
216
         <xsl:call-template name="attributelist">
217
           <xsl:with-param name="docid" select="$docid"/>
218
           <xsl:with-param name="entitytype" select="$entitytype"/>
219
           <xsl:with-param name="entityindex" select="$entityindex"/>
220
         </xsl:call-template>
221
       </td>
222
    </tr>
223
  </xsl:template>
224

    
225

    
226

    
227
</xsl:stylesheet>
(26-26/27)