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="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
            Entity 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
    <xsl:if test="coverage">
122
       <tr><td class="{$otherentitysubHeaderStyle}" 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="{$otherentitysubHeaderStyle}" 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="$otherentityfirstColStyle"/>
141
          <xsl:with-param name="methodsubHeaderStyle" select="$otherentitysubHeaderStyle"/>
142
        </xsl:call-template>
143
      </td></tr>
144
    </xsl:for-each>
145
    <xsl:if test="constraint">
146
       <tr><td class="{$otherentitysubHeaderStyle}" 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="$otherentityfirstColStyle"/>
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="otherEntityAttributeList">
160
        <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
161
        <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
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
     <!-- Here to display distribution info-->
168
    <xsl:for-each select="physical">
169
       <xsl:call-template name="otherEntityShowDistribution">
170
          <xsl:with-param name="docid" select="$docid"/>
171
          <xsl:with-param name="entityindex" select="$entityindex"/>
172
          <xsl:with-param name="physicalindex" select="position()"/>
173
          <xsl:with-param name="otherentityfirstColStyle" select="$otherentityfirstColStyle"/>
174
          <xsl:with-param name="otherentitysubHeaderStyle" select="$otherentitysubHeaderStyle"/>
175
       </xsl:call-template>
176
    </xsl:for-each>
177
  </xsl:template>
178

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

    
203

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

    
223

    
224

    
225
</xsl:stylesheet>
(14-14/27)