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: cjones $'
9
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
10
  * '$Revision: 3094 $'
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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
35
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
36
              indent="yes" />  
37

    
38
   <xsl:template name="nonNumericDomain">
39
     <xsl:param name="nondomainfirstColStyle"/>
40
     <table class="{$tabledefaultStyle}">
41
        <xsl:choose>
42
         <xsl:when test="references!=''">
43
          <xsl:variable name="ref_id" select="references"/>
44
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
45
          <xsl:for-each select="$references">
46
            <xsl:call-template name="nonNumericDomainCommon">
47
             <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
48
            </xsl:call-template>
49
          </xsl:for-each>
50
        </xsl:when>
51
        <xsl:otherwise>
52
          <xsl:call-template name="nonNumericDomainCommon">
53
             <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
54
           </xsl:call-template>
55
        </xsl:otherwise>
56
      </xsl:choose>
57
    </table>
58
  </xsl:template>
59

    
60

    
61
  <xsl:template name="nonNumericDomainCommon">
62
    <xsl:param name="nondomainfirstColStyle"/>
63
    <xsl:for-each select="enumeratedDomain">
64
      <xsl:call-template name="enumeratedDomain">
65
        <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
66
      </xsl:call-template>
67
    </xsl:for-each>
68
    <xsl:for-each select="textDomain">
69
      <xsl:call-template name="enumeratedDomain">
70
        <xsl:with-param name="nondomainfirstColStyle" select="$nondomainfirstColStyle"/>
71
      </xsl:call-template>
72
    </xsl:for-each>
73
  </xsl:template>
74

    
75
  <xsl:template name="textDomain">
76
       <xsl:param name="nondomainfirstColStyle"/>
77
       <tr><td class="{$nondomainfirstColStyle}"><b>Text Domain</b></td>
78
            <td class="{$secondColStyle}">&#160;
79
            </td>
80
       </tr>
81
       <tr><td class="{$nondomainfirstColStyle}">Definition</td>
82
            <td class="{$secondColStyle}"><xsl:value-of select="definition"/>
83
            </td>
84
        </tr>
85
        <xsl:for-each select="parttern">
86
          <tr><td class="{$nondomainfirstColStyle}">Pattern</td>
87
            <td class="{$secondColStyle}"><xsl:value-of select="."/>
88
            </td>
89
          </tr>
90
        </xsl:for-each>
91
        <xsl:if test="source">
92
          <tr><td class="{$nondomainfirstColStyle}">Source</td>
93
            <td class="{$secondColStyle}"><xsl:value-of select="source"/>
94
            </td>
95
          </tr>
96
        </xsl:if>
97
  </xsl:template>
98

    
99
  <xsl:template name="enumeratedDomain">
100
     <xsl:param name="nondomainfirstColStyle"/>
101
     <xsl:if test="codeDefinition">
102
        <tr><td class="{$nondomainfirstColStyle}"><b>Enumerated Domain</b></td>
103
            <td class="{$secondColStyle}">&#160;
104
            </td>
105
       </tr>
106
       <xsl:for-each select="codeDefinition">
107
              <tr><td class="{$nondomainfirstColStyle}">Code Definition</td>
108
                   <td>
109
                      <table class="{$tabledefaultStyle}">
110
                          <tr><td class="{$nondomainfirstColStyle}">
111
                               Code
112
                              </td>
113
                               <td class="{$secondColStyle}"><xsl:value-of select="code"/></td>
114

    
115
                           </tr>
116
                           <tr><td class="{$nondomainfirstColStyle}">
117
                               Definition
118
                              </td>
119
                               <td class="{$secondColStyle}"><xsl:value-of select="definition"/></td>
120

    
121
                           </tr>
122
                           <tr><td class="{$nondomainfirstColStyle}">
123
                               Source
124
                              </td>
125
                               <td class="{$secondColStyle}"><xsl:value-of select="source"/></td>
126
                          </tr>
127
                      </table>
128
                   </td>
129
               </tr>
130
         </xsl:for-each>
131
     </xsl:if>
132
     <xsl:if test="externalCodeSet">
133
        <tr><td class="{$nondomainfirstColStyle}"><b>Enumerated Domain(External Set)</b></td>
134
            <td>&#160;
135
           </td>
136
        </tr>
137
        <tr><td class="{$nondomainfirstColStyle}">Set Name:</td>
138
            <td class="{$secondColStyle}"><xsl:value-of select="externalCodeSet/codesetName"/>
139
           </td>
140
        </tr>
141
        <xsl:for-each select="externalCodeSet/citation">
142
           <tr><td class="{$nondomainfirstColStyle}">Citation:</td>
143
               <td>
144
                  <xsl:call-template name="citation">
145
                      <xsl:with-param name="citationfirstColStyle" select="$nondomainfirstColStyle"/>
146
                   </xsl:call-template>
147
               </td>
148
           </tr>
149
        </xsl:for-each>
150
        <xsl:for-each select="externalCodeSet/codesetURL">
151
           <tr><td class="{$nondomainfirstColStyle}">URL</td>
152
               <td class="{$secondColStyle}">
153
                 <a><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute><xsl:value-of select="."/></a>
154
              </td>
155
           </tr>
156
        </xsl:for-each>
157
     </xsl:if>
158
     <xsl:if test="entityCodeList">
159
        <tr><td class="{$nondomainfirstColStyle}"><b>Enumerated Domain(Entity)</b></td>
160
            <td class="{$secondColStyle}">&#160;
161
            </td>
162
       </tr>
163
        <tr><td class="{$nondomainfirstColStyle}">Entity Reference</td>
164
            <td class="{$secondColStyle}"><xsl:value-of select="entityCodeList/entityReference"/>
165
            </td>
166
       </tr>
167
       <tr><td class="{$nondomainfirstColStyle}">Attribute Value Reference</td>
168
            <td class="{$secondColStyle}"><xsl:value-of select="entityCodeList/valueAttributeReference"/>
169
            </td>
170
       </tr>
171
       <tr><td class="{$nondomainfirstColStyle}">Attribute Definition Reference</td>
172
            <td class="{$secondColStyle}"><xsl:value-of select="entityCodeList/definitionAttributeReference"/>
173
            </td>
174
       </tr>
175
     </xsl:if>
176

    
177
  </xsl:template>
178

    
179

    
180
</xsl:stylesheet>
(3-3/28)