Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-view.xsl @ 7987

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: leinfelder $'
10
  *     '$Date: 2013-07-15 10:37:09 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7982 $'
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="$withAttributes='1'">
122
     <!-- Here to display distribution info-->
123
    <xsl:for-each select="physical">
124
       <xsl:call-template name="viewShowDistribution">
125
          <xsl:with-param name="docid" select="$docid"/>
126
          <xsl:with-param name="entityindex" select="$entityindex"/>
127
          <xsl:with-param name="physicalindex" select="position()"/>
128
          <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
129
          <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
130
       </xsl:call-template>
131
    </xsl:for-each>
132
   </xsl:if>
133

    
134
    <xsl:if test="coverage">
135
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
136
        Coverage Description:
137
      </td></tr>
138
    </xsl:if>
139
    <xsl:for-each select="coverage">
140
      <tr><td colspan="2">
141
        <xsl:call-template name="coverage">
142
        </xsl:call-template>
143
      </td></tr>
144
    </xsl:for-each>
145
    <xsl:if test="method">
146
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
147
        Method Description:
148
      </td></tr>
149
    </xsl:if>
150
    <xsl:for-each select="method">
151
      <tr><td colspan="2">
152
        <xsl:call-template name="method">
153
          <xsl:with-param name="methodfirstColStyle" select="$viewfirstColStyle"/>
154
          <xsl:with-param name="methodsubHeaderStyle" select="$viewsubHeaderStyle"/>
155
        </xsl:call-template>
156
      </td></tr>
157
    </xsl:for-each>
158
    <xsl:if test="constraint">
159
       <tr><td class="{$viewsubHeaderStyle}" colspan="2">
160
        Constraint:
161
      </td></tr>
162
    </xsl:if>
163
    <xsl:for-each select="constraint">
164
      <tr><td colspan="2">
165
        <xsl:call-template name="constraint">
166
          <xsl:with-param name="constraintfirstColStyle" select="$viewfirstColStyle"/>
167
        </xsl:call-template>
168
      </td></tr>
169
    </xsl:for-each>
170
    <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
171
     <xsl:for-each select="attributeList">
172
       <xsl:call-template name="viewAttributeList">
173
         <xsl:with-param name="viewfirstColStyle" select="$viewfirstColStyle"/>
174
         <xsl:with-param name="viewsubHeaderStyle" select="$viewsubHeaderStyle"/>
175
         <xsl:with-param name="docid" select="$docid"/>
176
         <xsl:with-param name="entityindex" select="$entityindex"/>
177
       </xsl:call-template>
178
     </xsl:for-each>
179
    </xsl:if>
180
    
181
  </xsl:template>
182

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

    
207

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

    
227

    
228

    
229
</xsl:stylesheet>