Project

General

Profile

1 1676 tao
<?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
  <xsl:output method="html" encoding="iso-8859-1"/>
36
  <!-- This module is for datatable module-->
37
38
  <xsl:template name="storedProcedure">
39
      <xsl:param name="storedprocedurefirstColStyle"/>
40
      <xsl:param name="storedproceduresubHeaderStyle"/>
41
      <xsl:param name="docid"/>
42
      <xsl:param name="entityindex"/>
43 1696 tao
      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
44 1676 tao
        <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="storedProcedureCommon">
50
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
51
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
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="storedProcedureCommon">
59
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
60
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
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="storedProcedureCommon">
70
    <xsl:param name="storedprocedurefirstColStyle"/>
71
    <xsl:param name="storedproceduresubHeaderStyle"/>
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="$storedprocedurefirstColStyle"/>
77
       </xsl:call-template>
78
    </xsl:for-each>
79
    <xsl:for-each select="alternateIdentifier">
80
       <xsl:call-template name="entityalternateIdentifier">
81
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
82
       </xsl:call-template>
83
    </xsl:for-each>
84
    <xsl:for-each select="entityDescription">
85
       <xsl:call-template name="entityDescription">
86
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
87
       </xsl:call-template>
88
    </xsl:for-each>
89
    <xsl:for-each select="additionalInfo">
90 1732 tao
       <xsl:call-template name="entityadditionalInfo">
91 1676 tao
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
92
       </xsl:call-template>
93
    </xsl:for-each>
94
    <!-- call physical moduel without show distribution(we want see it later)-->
95
    <xsl:if test="physical">
96 1681 tao
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
97 1711 tao
        Physical Structure Description:
98 1676 tao
      </td></tr>
99
    </xsl:if>
100 1696 tao
    <xsl:for-each select="physical">
101
       <tr><td colspan="2">
102 1676 tao
        <xsl:call-template name="physical">
103
         <xsl:with-param name="physicalfirstColStyle" select="$storedprocedurefirstColStyle"/>
104
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
105
        </xsl:call-template>
106 1696 tao
        </td></tr>
107
    </xsl:for-each>
108 1676 tao
    <xsl:if test="coverage">
109 1681 tao
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
110 1711 tao
        Coverage Description:
111 1676 tao
      </td></tr>
112
    </xsl:if>
113
    <xsl:for-each select="coverage">
114
      <tr><td colspan="2">
115
        <xsl:call-template name="coverage">
116
        </xsl:call-template>
117
      </td></tr>
118
    </xsl:for-each>
119
    <xsl:if test="method">
120 1681 tao
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
121 1711 tao
        Method Description:
122 1676 tao
      </td></tr>
123
    </xsl:if>
124
    <xsl:for-each select="method">
125
      <tr><td colspan="2">
126
        <xsl:call-template name="method">
127
          <xsl:with-param name="methodfirstColStyle" select="$storedprocedurefirstColStyle"/>
128 1681 tao
          <xsl:with-param name="methodsubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
129 1676 tao
        </xsl:call-template>
130
      </td></tr>
131
    </xsl:for-each>
132
    <xsl:if test="constraint">
133 1681 tao
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
134 1711 tao
        Constraint:
135 1676 tao
      </td></tr>
136
    </xsl:if>
137
    <xsl:for-each select="constraint">
138
      <tr><td colspan="2">
139
        <xsl:call-template name="constraint">
140
          <xsl:with-param name="constraintfirstColStyle" select="$storedprocedurefirstColStyle"/>
141
        </xsl:call-template>
142
      </td></tr>
143
    </xsl:for-each>
144
    <xsl:for-each select="parameter">
145 1681 tao
       <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
146 1711 tao
            Parameter:
147 1676 tao
            </td>
148 1706 tao
            <td width="{$secondColWidth}">
149 1696 tao
               <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
150 1676 tao
                  <xsl:for-each select="name">
151 1681 tao
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
152 1711 tao
                          Name:
153 1676 tao
                         </td>
154
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
155
                           <xsl:value-of select="."/>
156
                         </td>
157
                     </tr>
158
                  </xsl:for-each>
159
                  <xsl:for-each select="domainDescription">
160 1681 tao
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
161 1711 tao
                          Domain:
162 1676 tao
                         </td>
163
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
164
                           <xsl:value-of select="."/>
165
                         </td>
166
                     </tr>
167
                  </xsl:for-each>
168
                  <xsl:for-each select="required">
169 1681 tao
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
170 1711 tao
                          Required:
171 1676 tao
                         </td>
172
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
173
                           <xsl:value-of select="."/>
174
                         </td>
175
                     </tr>
176
                  </xsl:for-each>
177
                  <xsl:for-each select="repeats">
178 1681 tao
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
179 1711 tao
                         Repeatable:
180 1676 tao
                         </td>
181
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
182
                           <xsl:value-of select="."/>
183
                         </td>
184
                     </tr>
185
                  </xsl:for-each>
186
               </table>
187
            </td>
188
       </tr>
189
    </xsl:for-each>
190
    <xsl:for-each select="attributeList">
191
      <xsl:call-template name="storedProcedureAttributeList">
192
        <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
193
        <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
194
        <xsl:with-param name="docid" select="$docid"/>
195
        <xsl:with-param name="entityindex" select="$entityindex"/>
196
      </xsl:call-template>
197
    </xsl:for-each>
198
     <!-- Here to display distribution info-->
199
    <xsl:for-each select="physical">
200
       <xsl:call-template name="storedProcedureShowDistribution">
201
          <xsl:with-param name="docid" select="$docid"/>
202
          <xsl:with-param name="entityindex" select="$entityindex"/>
203
          <xsl:with-param name="physicalindex" select="position()"/>
204 1735 tao
          <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
205
          <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
206 1676 tao
       </xsl:call-template>
207
    </xsl:for-each>
208
  </xsl:template>
209
210
  <xsl:template name="storedProcedureShowDistribution">
211
     <xsl:param name="storedprocedurefirstColStyle"/>
212 1681 tao
     <xsl:param name="storedproceduresubHeaderStyle"/>
213 1676 tao
     <xsl:param name="docid"/>
214
     <xsl:param name="level">entitylevel</xsl:param>
215
     <xsl:param name="entitytype">storedProcedure</xsl:param>
216
     <xsl:param name="entityindex"/>
217
     <xsl:param name="physicalindex"/>
218
     <xsl:for-each select="distribution">
219
      <tr><td colspan="2">
220
        <xsl:call-template name="distribution">
221
          <xsl:with-param name="docid" select="$docid"/>
222
          <xsl:with-param name="level" select="$level"/>
223
          <xsl:with-param name="entitytype" select="$entitytype"/>
224
          <xsl:with-param name="entityindex" select="$entityindex"/>
225
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
226
          <xsl:with-param name="distributionindex" select="position()"/>
227
          <xsl:with-param name="disfirstColStyle" select="$storedprocedurefirstColStyle"/>
228 1681 tao
          <xsl:with-param name="dissubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
229 1676 tao
        </xsl:call-template>
230
      </td></tr>
231
    </xsl:for-each>
232
  </xsl:template>
233
234
235
  <xsl:template name="storedProcedureAttributeList">
236
    <xsl:param name="storedprocedurefirstColStyle"/>
237
    <xsl:param name="storedproceduresubHeaderStyle"/>
238
    <xsl:param name="docid"/>
239
    <xsl:param name="entitytype">storedProcedure</xsl:param>
240
    <xsl:param name="entityindex"/>
241 1681 tao
    <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
242 1713 tao
        <xsl:text>Attribute(s) Info:</xsl:text>
243 1676 tao
    </td></tr>
244
    <tr><td colspan="2">
245
         <xsl:call-template name="attributelist">
246
           <xsl:with-param name="docid" select="$docid"/>
247
           <xsl:with-param name="entitytype" select="$entitytype"/>
248
           <xsl:with-param name="entityindex" select="$entityindex"/>
249
         </xsl:call-template>
250
       </td>
251
    </tr>
252
  </xsl:template>
253
254
255
256
</xsl:stylesheet>