Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile: eml-storedprocedure-2.0.0.xsl,v $'
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: 2004/10/05 23:50:34 $'
11
  * '$Revision: 1.1 $'
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="storedProcedure">
42
      <xsl:param name="storedprocedurefirstColStyle"/>
43
      <xsl:param name="storedproceduresubHeaderStyle"/>
44
      <xsl:param name="docid"/>
45
      <xsl:param name="entityindex"/>
46
      <table xsl:use-attribute-sets="cellspacing" 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="storedProcedureCommon">
53
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
54
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
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="storedProcedureCommon">
62
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
63
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
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="storedProcedureCommon">
73
    <xsl:param name="storedprocedurefirstColStyle"/>
74
    <xsl:param name="storedproceduresubHeaderStyle"/>
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="$storedprocedurefirstColStyle"/>
80
       </xsl:call-template>
81
    </xsl:for-each>
82
    <xsl:for-each select="alternateIdentifier">
83
       <xsl:call-template name="entityalternateIdentifier">
84
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
85
       </xsl:call-template>
86
    </xsl:for-each>
87
    <xsl:for-each select="entityDescription">
88
       <xsl:call-template name="entityDescription">
89
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
90
       </xsl:call-template>
91
    </xsl:for-each>
92
    <xsl:for-each select="additionalInfo">
93
       <xsl:call-template name="entityadditionalInfo">
94
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
95
       </xsl:call-template>
96
    </xsl:for-each>
97
    <!-- call physical moduel without show distribution(we want see it later)-->
98
    <xsl:if test="physical">
99
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
100
        Physical Structure Description:
101
      </td></tr>
102
    </xsl:if>
103
    <xsl:for-each select="physical">
104
       <tr><td colspan="2">
105
        <xsl:call-template name="physical">
106
         <xsl:with-param name="physicalfirstColStyle" select="$storedprocedurefirstColStyle"/>
107
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
108
        </xsl:call-template>
109
        </td></tr>
110
    </xsl:for-each>
111
    <xsl:if test="coverage">
112
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
113
        Coverage Description:
114
      </td></tr>
115
    </xsl:if>
116
    <xsl:for-each select="coverage">
117
      <tr><td colspan="2">
118
        <xsl:call-template name="coverage">
119
        </xsl:call-template>
120
      </td></tr>
121
    </xsl:for-each>
122
    <xsl:if test="method">
123
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
124
        Method Description:
125
      </td></tr>
126
    </xsl:if>
127
    <xsl:for-each select="method">
128
      <tr><td colspan="2">
129
        <xsl:call-template name="method">
130
          <xsl:with-param name="methodfirstColStyle" select="$storedprocedurefirstColStyle"/>
131
          <xsl:with-param name="methodsubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
132
        </xsl:call-template>
133
      </td></tr>
134
    </xsl:for-each>
135
    <xsl:if test="constraint">
136
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
137
        Constraint:
138
      </td></tr>
139
    </xsl:if>
140
    <xsl:for-each select="constraint">
141
      <tr><td colspan="2">
142
        <xsl:call-template name="constraint">
143
          <xsl:with-param name="constraintfirstColStyle" select="$storedprocedurefirstColStyle"/>
144
        </xsl:call-template>
145
      </td></tr>
146
    </xsl:for-each>
147
    <xsl:for-each select="parameter">
148
       <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
149
            Parameter:
150
            </td>
151
            <td width="{$secondColWidth}">
152
               <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
153
                  <xsl:for-each select="name">
154
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
155
                          Name:
156
                         </td>
157
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
158
                           <xsl:value-of select="."/>
159
                         </td>
160
                     </tr>
161
                  </xsl:for-each>
162
                  <xsl:for-each select="domainDescription">
163
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
164
                          Domain:
165
                         </td>
166
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
167
                           <xsl:value-of select="."/>
168
                         </td>
169
                     </tr>
170
                  </xsl:for-each>
171
                  <xsl:for-each select="required">
172
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
173
                          Required:
174
                         </td>
175
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
176
                           <xsl:value-of select="."/>
177
                         </td>
178
                     </tr>
179
                  </xsl:for-each>
180
                  <xsl:for-each select="repeats">
181
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
182
                         Repeatable:
183
                         </td>
184
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
185
                           <xsl:value-of select="."/>
186
                         </td>
187
                     </tr>
188
                  </xsl:for-each>
189
               </table>
190
            </td>
191
       </tr>
192
    </xsl:for-each>
193
    <xsl:if test="$withAttributes='1'">
194
    <xsl:for-each select="attributeList">
195
      <xsl:call-template name="storedProcedureAttributeList">
196
        <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
197
        <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
198
        <xsl:with-param name="docid" select="$docid"/>
199
        <xsl:with-param name="entityindex" select="$entityindex"/>
200
      </xsl:call-template>
201
    </xsl:for-each>
202
    </xsl:if>
203
     <!-- Here to display distribution info-->
204
    <xsl:for-each select="physical">
205
       <xsl:call-template name="storedProcedureShowDistribution">
206
          <xsl:with-param name="docid" select="$docid"/>
207
          <xsl:with-param name="entityindex" select="$entityindex"/>
208
          <xsl:with-param name="physicalindex" select="position()"/>
209
          <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
210
          <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
211
       </xsl:call-template>
212
    </xsl:for-each>
213
  </xsl:template>
214

    
215
  <xsl:template name="storedProcedureShowDistribution">
216
     <xsl:param name="storedprocedurefirstColStyle"/>
217
     <xsl:param name="storedproceduresubHeaderStyle"/>
218
     <xsl:param name="docid"/>
219
     <xsl:param name="level">entitylevel</xsl:param>
220
     <xsl:param name="entitytype">storedProcedure</xsl:param>
221
     <xsl:param name="entityindex"/>
222
     <xsl:param name="physicalindex"/>
223
     <xsl:for-each select="distribution">
224
      <tr><td colspan="2">
225
        <xsl:call-template name="distribution">
226
          <xsl:with-param name="docid" select="$docid"/>
227
          <xsl:with-param name="level" select="$level"/>
228
          <xsl:with-param name="entitytype" select="$entitytype"/>
229
          <xsl:with-param name="entityindex" select="$entityindex"/>
230
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
231
          <xsl:with-param name="distributionindex" select="position()"/>
232
          <xsl:with-param name="disfirstColStyle" select="$storedprocedurefirstColStyle"/>
233
          <xsl:with-param name="dissubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
234
        </xsl:call-template>
235
      </td></tr>
236
    </xsl:for-each>
237
  </xsl:template>
238

    
239

    
240
  <xsl:template name="storedProcedureAttributeList">
241
    <xsl:param name="storedprocedurefirstColStyle"/>
242
    <xsl:param name="storedproceduresubHeaderStyle"/>
243
    <xsl:param name="docid"/>
244
    <xsl:param name="entitytype">storedProcedure</xsl:param>
245
    <xsl:param name="entityindex"/>
246
    <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
247
        <xsl:text>Attribute(s) Info:</xsl:text>
248
    </td></tr>
249
    <tr><td colspan="2">
250
         <xsl:call-template name="attributelist">
251
           <xsl:with-param name="docid" select="$docid"/>
252
           <xsl:with-param name="entitytype" select="$entitytype"/>
253
           <xsl:with-param name="entityindex" select="$entityindex"/>
254
         </xsl:call-template>
255
       </td>
256
    </tr>
257
  </xsl:template>
258

    
259

    
260

    
261
</xsl:stylesheet>
(52-52/58)