Project

General

Profile

1 7982 leinfelder
<?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$'
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-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 8005 leinfelder
  <xsl:output method="html" encoding="UTF-8"
36 7982 leinfelder
              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="otherEntity">
42
      <xsl:param name="otherentityfirstColStyle"/>
43
      <xsl:param name="otherentitysubHeaderStyle"/>
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="otherEntityCommon">
53
             <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
54
             <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
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="otherEntityCommon">
62
             <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
63
             <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
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="otherEntityCommon">
73
    <xsl:param name="otherentityfirstColStyle"/>
74
    <xsl:param name="otherentitysubHeaderStyle"/>
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="$otherentityfirstColStyle"/>
80
       </xsl:call-template>
81
    </xsl:for-each>
82
    <xsl:for-each select="entityType">
83
       <tr><td class="{$otherentityfirstColStyle}">
84
            Data Object Type:
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="$otherentityfirstColStyle"/>
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="$otherentityfirstColStyle"/>
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="$otherentityfirstColStyle"/>
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="{$otherentitysubHeaderStyle}" 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="$otherentityfirstColStyle"/>
116
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
117
        </xsl:call-template>
118
         </td></tr>
119
     </xsl:for-each>
120
121
    <!-- Here to display distribution info-->
122
    <xsl:for-each select="physical">
123
       <xsl:call-template name="otherEntityShowDistribution">
124
          <xsl:with-param name="docid" select="$docid"/>
125
          <xsl:with-param name="entityindex" select="$entityindex"/>
126
          <xsl:with-param name="physicalindex" select="position()"/>
127
          <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
128
          <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
129
       </xsl:call-template>
130
    </xsl:for-each>
131
132
    <xsl:if test="coverage">
133
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
134
        Coverage Description:
135
      </td></tr>
136
    </xsl:if>
137
    <xsl:for-each select="coverage">
138
      <tr><td colspan="2">
139
        <xsl:call-template name="coverage">
140
        </xsl:call-template>
141
      </td></tr>
142
    </xsl:for-each>
143
    <xsl:if test="method">
144
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
145
        Method Description:
146
      </td></tr>
147
    </xsl:if>
148
    <xsl:for-each select="method">
149
      <tr><td colspan="2">
150
        <xsl:call-template name="method">
151
          <xsl:with-param name="methodfirstColStyle" select="$otherentityfirstColStyle"/>
152
          <xsl:with-param name="methodsubHeaderStyle" select="$otherentitysubHeaderStyle"/>
153
        </xsl:call-template>
154
      </td></tr>
155
    </xsl:for-each>
156
    <xsl:if test="constraint">
157
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
158
        Constraint:
159
      </td></tr>
160
    </xsl:if>
161
    <xsl:for-each select="constraint">
162
      <tr><td colspan="2">
163
        <xsl:call-template name="constraint">
164
          <xsl:with-param name="constraintfirstColStyle" select="$otherentityfirstColStyle"/>
165
        </xsl:call-template>
166
      </td></tr>
167
    </xsl:for-each>
168
    <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
169
    <xsl:for-each select="attributeList">
170
      <xsl:call-template name="otherEntityAttributeList">
171
        <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
172
        <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
173
        <xsl:with-param name="docid" select="$docid"/>
174
        <xsl:with-param name="entityindex" select="$entityindex"/>
175
      </xsl:call-template>
176
    </xsl:for-each>
177
    </xsl:if>
178
179
  </xsl:template>
180
181
  <xsl:template name="otherEntityShowDistribution">
182
     <xsl:param name="otherentityfirstColStyle"/>
183
     <xsl:param name="otherentitysubHeaderStyle"/>
184
     <xsl:param name="docid"/>
185
     <xsl:param name="level">entitylevel</xsl:param>
186
     <xsl:param name="entitytype">otherEntity</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="$otherentityfirstColStyle"/>
199
          <xsl:with-param name="dissubHeaderStyle" select="$otherentitysubHeaderStyle"/>
200
        </xsl:call-template>
201
      </td></tr>
202
    </xsl:for-each>
203
  </xsl:template>
204
205
206
  <xsl:template name="otherEntityAttributeList">
207
    <xsl:param name="otherentityfirstColStyle"/>
208
    <xsl:param name="otherentitysubHeaderStyle"/>
209
    <xsl:param name="docid"/>
210
    <xsl:param name="entitytype">otherEntity</xsl:param>
211
    <xsl:param name="entityindex"/>
212
    <tr><td class="{$otherentitysubHeaderStyle}" 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>