Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *    Copyright: 2000 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *  For Details: http://www.nceas.ucsb.edu/
7
  *
8
  *   '$Author: tao $'
9
  *     '$Date: 2003-06-30 15:12:58 -0700 (Mon, 30 Jun 2003) $'
10
  * '$Revision: 1706 $'
11
  *
12
  * This program is free software; you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License as published by
14
  * the Free Software Foundation; either version 2 of the License, or
15
  * (at your option) any later version.
16
  *
17
  * This program is distributed in the hope that it will be useful,
18
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
  * GNU General Public License for more details.
21
  *
22
  * You should have received a copy of the GNU General Public License
23
  * along with this program; if not, write to the Free Software
24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
  *
26
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
27
  * convert an XML file that is valid with respect to the eml-variable.dtd
28
  * module of the Ecological Metadata Language (EML) into an HTML format
29
  * suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32
 
33
  <xsl:output method="html" encoding="iso-8859-1"/>
34
  
35
   <xsl:template name="nonNumericDomain">
36
     <xsl:param name="nondomainfirstColStyle"/>
37
     <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
38
        <xsl:choose>
39
         <xsl:when test="references!=''">
40
          <xsl:variable name="ref_id" select="references"/>
41
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
42
          <xsl:for-each select="$references">
43
            <xsl:call-template name="nonNumericDomainCommon">
44
             <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
45
            </xsl:call-template>
46
          </xsl:for-each>
47
        </xsl:when>
48
        <xsl:otherwise>
49
          <xsl:call-template name="nonNumericDomainCommon">
50
             <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
51
           </xsl:call-template>
52
        </xsl:otherwise>
53
      </xsl:choose>
54
    </table>
55
  </xsl:template>
56

    
57
  
58
  <xsl:template name="nonNumericDomainCommon">
59
    <xsl:param name="nondomainfirstColStyle"/>
60
    <xsl:for-each select="enumeratedDomain">
61
      <xsl:call-template name="enumeratedDomain">
62
        <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
63
      </xsl:call-template>
64
    </xsl:for-each>
65
    <xsl:for-each select="textDomain">
66
      <xsl:call-template name="enumeratedDomain">
67
        <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
68
      </xsl:call-template>
69
    </xsl:for-each>
70
  </xsl:template>
71
  
72
  <xsl:template name="textDomain">
73
       <xsl:param name="nondomainfirstColStyle"/>
74
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Text Domain</b></td>
75
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
76
            </td>
77
       </tr> 
78
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Definition</td>
79
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="definition"/>
80
            </td>
81
        </tr>
82
        <xsl:for-each select="parttern">
83
          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Pattern</td>
84
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="."/>
85
            </td>
86
          </tr>
87
        </xsl:for-each>
88
        <xsl:if test="source">
89
          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Source</td>
90
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="source"/>
91
            </td>
92
          </tr>
93
        </xsl:if>
94
  </xsl:template>
95

    
96
  <xsl:template name="enumeratedDomain">
97
     <xsl:param name="nondomainfirstColStyle"/>
98
     <xsl:if test="codeDefinition">
99
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Enumerated Domain</b></td>
100
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
101
            </td>
102
       </tr>
103
       <xsl:for-each select="codeDefinition">
104
              <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Code Definition</td>
105
                   <td width="{$secondColWidth}">
106
                      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
107
                          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
108
                               Code
109
                              </td>
110
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="code"/></td>
111
                              
112
                           </tr>
113
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
114
                               Definition
115
                              </td>
116
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="definition"/></td>
117
                               
118
                           </tr>
119
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
120
                               Source
121
                              </td>
122
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="source"/></td>
123
                          </tr>
124
                      </table>
125
                   </td>
126
               </tr> 
127
         </xsl:for-each>
128
     </xsl:if>  
129
     <xsl:if test="externalCodeSet">
130
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Enumerated Domain(External Set)</b></td>
131
            <td width="{$secondColWidth}">&#160;
132
           </td>
133
        </tr>
134
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Set Name:</td>
135
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="externalCodeSet/codesetName"/>
136
           </td>
137
        </tr>
138
        <xsl:for-each select="externalCodeSet/citation">
139
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Citation:</td>
140
               <td width="{$secondColWidth}">
141
                  <xsl:call-template name="citation">
142
                      <xsl:with-param name="citationfirstColStyle" select="$nondomainfirstColStyle"/>
143
                   </xsl:call-template>
144
               </td>
145
           </tr>
146
        </xsl:for-each>
147
        <xsl:for-each select="externalCodeSet/codesetURL">
148
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">URL</td>
149
               <td width="{$secondColWidth}" class="{$secondColStyle}">
150
                 <a><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute><xsl:value-of select="."/></a>
151
              </td>
152
           </tr>
153
        </xsl:for-each>
154
     </xsl:if>
155
     <xsl:if test="entityCodeList">
156
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Enumerated Domain(Entity)</b></td>
157
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
158
            </td>
159
       </tr>
160
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Entity Reference</td>
161
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/entityReference"/>
162
            </td>
163
       </tr>
164
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Value Reference</td>
165
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/valueAttributeReference"/>
166
            </td>
167
       </tr>
168
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Definition Reference</td>
169
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/definitionAttributeReference"/>
170
            </td>
171
       </tr>
172
     </xsl:if>  
173
     
174
  </xsl:template>
175

    
176
  
177
</xsl:stylesheet>
(6-6/30)