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: tao $'
10
  *     '$Date: 2003-07-17 17:48:51 -0700 (Thu, 17 Jul 2003) $'
11
  * '$Revision: 1735 $'
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
  <!-- This module is for datatable module-->
37
  
38
  <xsl:template name="otherEntity">
39
      <xsl:param name="otherentityfirstColStyle"/>
40
      <xsl:param name="otherentitysubHeaderStyle"/>
41
      <xsl:param name="docid"/>
42
      <xsl:param name="entityindex"/>
43
      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
44
        <xsl:choose>
45
         <xsl:when test="references!=''">
46
          <xsl:variable name="ref_id" select="references"/>
47
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
48
          <xsl:for-each select="$references">
49
            <xsl:call-template name="otherEntityCommon">
50
             <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
51
             <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>  
52
             <xsl:with-param name="docid" select="$docid"/>
53
             <xsl:with-param name="entityindex" select="$entityindex"/>
54
            </xsl:call-template>
55
          </xsl:for-each>
56
        </xsl:when>
57
        <xsl:otherwise>
58
           <xsl:call-template name="otherEntityCommon">
59
             <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
60
             <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>  
61
             <xsl:with-param name="docid" select="$docid"/>
62
             <xsl:with-param name="entityindex" select="$entityindex"/>
63
            </xsl:call-template>
64
         </xsl:otherwise>
65
      </xsl:choose>
66
      </table>
67
  </xsl:template>
68
  
69
  <xsl:template name="otherEntityCommon">
70
    <xsl:param name="otherentityfirstColStyle"/>
71
    <xsl:param name="otherentitysubHeaderStyle"/>
72
    <xsl:param name="docid"/>
73
    <xsl:param name="entityindex"/>
74
    <xsl:for-each select="entityName">
75
       <xsl:call-template name="entityName">
76
          <xsl:with-param name="entityfirstColStyle" select="$otherentityfirstColStyle"/>
77
       </xsl:call-template>
78
    </xsl:for-each>
79
    <xsl:for-each select="entityType">
80
       <tr><td width="{$firstColWidth}" class="{$otherentityfirstColStyle}">
81
            Entity Type:
82
            </td>
83
            <td width="{$secondColWidth}" class="{$secondColStyle}">
84
            <xsl:value-of select="."/>
85
            </td>
86
       </tr>
87
    </xsl:for-each>
88
    <xsl:for-each select="alternateIdentifier">
89
       <xsl:call-template name="entityalternateIdentifier">
90
          <xsl:with-param name="entityfirstColStyle" select="$otherentityfirstColStyle"/>
91
       </xsl:call-template>
92
    </xsl:for-each>
93
    <xsl:for-each select="entityDescription">
94
       <xsl:call-template name="entityDescription">
95
          <xsl:with-param name="entityfirstColStyle" select="$otherentityfirstColStyle"/>
96
       </xsl:call-template>
97
    </xsl:for-each>
98
    <xsl:for-each select="additionalInfo">
99
       <xsl:call-template name="entityadditionalInfo">
100
          <xsl:with-param name="entityfirstColStyle" select="$otherentityfirstColStyle"/>
101
       </xsl:call-template>
102
    </xsl:for-each>
103
    <!-- call physical moduel without show distribution(we want see it later)-->
104
    <xsl:if test="physical">
105
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
106
        Physical Structure Description:
107
      </td></tr>
108
    </xsl:if>
109
    <xsl:for-each select="physical">
110
        <tr><td colspan="2">
111
        <xsl:call-template name="physical">
112
         <xsl:with-param name="physicalfirstColStyle" select="$otherentityfirstColStyle"/>
113
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
114
        </xsl:call-template>
115
         </td></tr>
116
     </xsl:for-each>
117
   
118
    <xsl:if test="coverage">
119
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
120
        Coverage Description:
121
      </td></tr>
122
    </xsl:if>
123
    <xsl:for-each select="coverage">
124
      <tr><td colspan="2">
125
        <xsl:call-template name="coverage">
126
        </xsl:call-template>
127
      </td></tr>
128
    </xsl:for-each>
129
    <xsl:if test="method">
130
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
131
        Method Description:
132
      </td></tr>
133
    </xsl:if>
134
    <xsl:for-each select="method">
135
      <tr><td colspan="2">
136
        <xsl:call-template name="method">
137
          <xsl:with-param name="methodfirstColStyle" select="$otherentityfirstColStyle"/>
138
          <xsl:with-param name="methodsubHeaderStyle" select="$otherentitysubHeaderStyle"/>
139
        </xsl:call-template>
140
      </td></tr>
141
    </xsl:for-each>
142
    <xsl:if test="constraint">
143
       <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
144
        Constraint:
145
      </td></tr>
146
    </xsl:if>
147
    <xsl:for-each select="constraint">
148
      <tr><td colspan="2">
149
        <xsl:call-template name="constraint">
150
          <xsl:with-param name="constraintfirstColStyle" select="$otherentityfirstColStyle"/>
151
        </xsl:call-template>
152
      </td></tr>
153
    </xsl:for-each>
154
    <xsl:for-each select="attributeList">
155
      <xsl:call-template name="otherEntityAttributeList">
156
        <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
157
        <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>  
158
        <xsl:with-param name="docid" select="$docid"/>
159
        <xsl:with-param name="entityindex" select="$entityindex"/>
160
      </xsl:call-template>
161
    </xsl:for-each>
162
     <!-- Here to display distribution info-->
163
    <xsl:for-each select="physical">
164
       <xsl:call-template name="otherEntityShowDistribution">
165
          <xsl:with-param name="docid" select="$docid"/>
166
          <xsl:with-param name="entityindex" select="$entityindex"/>
167
          <xsl:with-param name="physicalindex" select="position()"/>
168
          <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
169
          <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
170
       </xsl:call-template>
171
    </xsl:for-each>
172
  </xsl:template>
173
 
174
  <xsl:template name="otherEntityShowDistribution">
175
     <xsl:param name="otherentityfirstColStyle"/>
176
     <xsl:param name="otherentitysubHeaderStyle"/>
177
     <xsl:param name="docid"/>
178
     <xsl:param name="level">entitylevel</xsl:param>
179
     <xsl:param name="entitytype">otherEntity</xsl:param>
180
     <xsl:param name="entityindex"/>
181
     <xsl:param name="physicalindex"/>
182
     <xsl:for-each select="distribution">
183
      <tr><td colspan="2">
184
        <xsl:call-template name="distribution">
185
          <xsl:with-param name="docid" select="$docid"/>
186
          <xsl:with-param name="level" select="$level"/>
187
          <xsl:with-param name="entitytype" select="$entitytype"/>
188
          <xsl:with-param name="entityindex" select="$entityindex"/>
189
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
190
          <xsl:with-param name="distributionindex" select="position()"/>
191
          <xsl:with-param name="disfirstColStyle" select="$otherentityfirstColStyle"/>
192
          <xsl:with-param name="dissubHeaderStyle" select="$otherentitysubHeaderStyle"/>
193
        </xsl:call-template>
194
      </td></tr>
195
    </xsl:for-each>
196
  </xsl:template>
197
  
198
  
199
  <xsl:template name="otherEntityAttributeList">
200
    <xsl:param name="otherentityfirstColStyle"/>
201
    <xsl:param name="otherentitysubHeaderStyle"/>
202
    <xsl:param name="docid"/>
203
    <xsl:param name="entitytype">otherEntity</xsl:param>
204
    <xsl:param name="entityindex"/>
205
    <tr><td class="{$otherentitysubHeaderStyle}" colspan="2">
206
        <xsl:text>Attribute(s) Info:</xsl:text>
207
    </td></tr>
208
    <tr><td colspan="2">
209
         <xsl:call-template name="attributelist">
210
           <xsl:with-param name="docid" select="$docid"/>
211
           <xsl:with-param name="entitytype" select="$entitytype"/>
212
           <xsl:with-param name="entityindex" select="$entityindex"/>
213
         </xsl:call-template>
214
       </td>
215
    </tr>
216
  </xsl:template>
217
  
218
  
219

    
220
</xsl:stylesheet>
(17-17/30)