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 1681 tao
33 553 tao
  <xsl:output method="html" encoding="iso-8859-1"/>
34 1660 tao
35
   <xsl:template name="nonNumericDomain">
36
     <xsl:param name="nondomainfirstColStyle"/>
37 1696 tao
     <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
38 1660 tao
        <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 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
76 1660 tao
            </td>
77
       </tr>
78
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Definition</td>
79 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="definition"/>
80 1660 tao
            </td>
81
        </tr>
82
        <xsl:for-each select="parttern">
83
          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Pattern</td>
84 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="."/>
85 1660 tao
            </td>
86
          </tr>
87
        </xsl:for-each>
88
        <xsl:if test="source">
89
          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Source</td>
90 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="source"/>
91 1660 tao
            </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 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
101 1660 tao
            </td>
102
       </tr>
103
       <xsl:for-each select="codeDefinition">
104 1689 tao
              <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Code Definition</td>
105 1660 tao
                   <td width="{$secondColWidth}">
106 1696 tao
                      <table xsl:use-attribute-sets="cellspacing" class="tabledefault" width="100%">
107 1660 tao
                          <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
108
                               Code
109
                              </td>
110 1706 tao
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="code"/></td>
111 1689 tao
112 1660 tao
                           </tr>
113
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
114
                               Definition
115
                              </td>
116 1706 tao
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="definition"/></td>
117 1689 tao
118 1660 tao
                           </tr>
119
                           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">
120
                               Source
121
                              </td>
122 1706 tao
                               <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="source"/></td>
123 1689 tao
                          </tr>
124 1660 tao
                      </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 1689 tao
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Set Name:</td>
135 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="externalCodeSet/codesetName"/>
136 1660 tao
           </td>
137
        </tr>
138
        <xsl:for-each select="externalCodeSet/citation">
139 1689 tao
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Citation:</td>
140
               <td width="{$secondColWidth}">
141
                  <xsl:call-template name="citation">
142 1660 tao
                      <xsl:with-param name="citationfirstColStyle" select="$nondomainfirstColStyle"/>
143
                   </xsl:call-template>
144 1689 tao
               </td>
145 1660 tao
           </tr>
146
        </xsl:for-each>
147
        <xsl:for-each select="externalCodeSet/codesetURL">
148
           <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">URL</td>
149 1706 tao
               <td width="{$secondColWidth}" class="{$secondColStyle}">
150 1660 tao
                 <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 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
158 1660 tao
            </td>
159
       </tr>
160
        <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Entity Reference</td>
161 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/entityReference"/>
162 1660 tao
            </td>
163
       </tr>
164
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Value Reference</td>
165 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/valueAttributeReference"/>
166 1660 tao
            </td>
167
       </tr>
168
       <tr><td width="{$firstColWidth}" class="{$nondomainfirstColStyle}">Attribute Definition Reference</td>
169 1706 tao
            <td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="entityCodeList/definitionAttributeReference"/>
170 1660 tao
            </td>
171
       </tr>
172
     </xsl:if>
173
174 553 tao
  </xsl:template>
175
176 1660 tao
177 553 tao
</xsl:stylesheet>