Project

General

Profile

1 553 tao
<?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$'
9
  *     '$Date$'
10
  * '$Revision$'
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
  <xsl:import href="eml-settings-2.0.0beta6-@name@.xsl" />
33
  <xsl:output method="html" encoding="iso-8859-1"/>
34 1660 tao
35
   <xsl:template name="nonNumericDomain">
36
     <xsl:param name="nondomainfirstColStyle"/>
37
     <table 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 553 tao
  </xsl:template>
56
57 1660 tao
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 553 tao
  </xsl:template>
71 1660 tao
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}">&#160;
76
            </td>
77
       </tr>
78
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Definition</td>
79
            <td width="{$secondColWidth}"><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}"><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}"><xsl:value-of select="source"/>
91
            </td>
92
          </tr>
93
        </xsl:if>
94 553 tao
  </xsl:template>
95
96 1660 tao
  <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}">&#160;
101
            </td>
102
       </tr>
103
       <xsl:for-each select="codeDefinition">
104
              <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">&#160;</td>
105
                   <td width="{$secondColWidth}">
106
                      <table width="100%">
107
                          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
108
                               Code
109
                              </td>
110
                               <td width="{$secondColWidth}"><td><xsl:value-of select="code"/></td>
111
                               </td>
112
                           </tr>
113
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
114
                               Definition
115
                              </td>
116
                               <td width="{$secondColWidth}"><td><xsl:value-of select="definition"/></td>
117
                               </td>
118
                           </tr>
119
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
120
                               Source
121
                              </td>
122
                               <td width="{$secondColWidth}"><td><xsl:value-of select="source"/></td>
123
                               </td>
124
                           </tr>
125
                      </table>
126
                   </td>
127
               </tr>
128
         </xsl:for-each>
129
     </xsl:if>
130
     <xsl:if test="externalCodeSet">
131
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Enumerated Domain(External Set)</b></td>
132
            <td width="{$secondColWidth}">&#160;
133
           </td>
134
        </tr>
135
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Set Name</td>
136
            <td width="{$secondColWidth}"><xsl:value-of select="externalCodeSet/codesetName"/>
137
           </td>
138
        </tr>
139
        <xsl:for-each select="externalCodeSet/citation">
140
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Citation</td>
141
               <td width="{$secondColWidth}">&#160;</td>
142
           </tr>
143
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">&#160;</td>
144
                <td width="{$secondColWidth}">
145
                   <xsl:call-template name="citation">
146
                      <xsl:with-param name="citationfirstColStyle" select="$nondomainfirstColStyle"/>
147
                   </xsl:call-template>
148
                </td>
149
           </tr>
150
        </xsl:for-each>
151
        <xsl:for-each select="externalCodeSet/codesetURL">
152
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">URL</td>
153
               <td width="{$secondColWidth}">
154
                 <a><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute><xsl:value-of select="."/></a>
155
              </td>
156
           </tr>
157
        </xsl:for-each>
158
     </xsl:if>
159
     <xsl:if test="entityCodeList">
160
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}"><b>Enumerated Domain(Entity)</b></td>
161
            <td width="{$secondColWidth}">&#160;
162
            </td>
163
       </tr>
164
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Entity Reference</td>
165
            <td width="{$secondColWidth}"><xsl:value-of select="codeDefinition/entityReference"/>
166
            </td>
167
       </tr>
168
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Value Reference</td>
169
            <td width="{$secondColWidth}"><xsl:value-of select="codeDefinition/valueAttributeReference"/>
170
            </td>
171
       </tr>
172
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Definition Reference</td>
173
            <td width="{$secondColWidth}"><xsl:value-of select="codeDefinition/definitionAttributeReference"/>
174
            </td>
175
       </tr>
176
     </xsl:if>
177
178 553 tao
  </xsl:template>
179
180 1660 tao
181 553 tao
</xsl:stylesheet>