Project

General

Profile

« Previous | Next » 

Revision 1660

Added by Jing Tao over 21 years ago

Finished the module.

View differences:

eml-attribute-enumeratedDomain-2.0.0.xsl
31 31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32 32
  <xsl:import href="eml-settings-2.0.0beta6-@name@.xsl" />
33 33
  <xsl:output method="html" encoding="iso-8859-1"/>
34
  <xsl:template match="/">
35
    <html>
36
      <head>
37
        <link rel="stylesheet" type="text/css" href="{$stylePath}/@name@.css"/>
38
      </head>
39

  
40
      <body>
41
        <table width="100%" cellspacing="0" cellpadding="0" border="1">
42
          <tr>
43
            <table cellspacing="0" width="100%" border="0">
44
              <tr>
45
                <td class="header-title">
46
                  <div class="header-title">
47
                    @header-title@
48
                  </div>
49
                   <div class="header-subtitle">
50
                    @header-subtitle@
51
                  </div>
52
                </td>
53
                <td class="header-image" rowspan="1">
54
                  <div class="header-image">
55
                    <img class="header" src="@html-path@/@header-image@"
56
                      alt="@header-image-alt@" border="0" />
57
                  </div>
58
                </td>
59
              </tr>
60
              <tr>
61
                <td class="header-menu" colspan="2">
62
                  <div class="header-menu">
63
                   @header-menu@
64
                  </div>
65
                </td>
66
              </tr>
67
              <tr>
68
                <td class="header-submenu" colspan="2">
69
                  <div class="header-submenu">
70
                    &#160; <!-- &nbsp; that is XML compliant -->
71
                  </div>
72
                </td>
73
              </tr>
74
            </table>
75
          </tr>
76
          <tr>
77
            <td colspan="7" valign="top" align="left">
78
              <table width="85%" border="0">
79
                <tr>
80
                  <td class="tablehead">Code Definitions for Allowed Values</td>
81
                </tr>
82
                <tr>
83
                  <td>
84
                    <table border="0" width="95%" cellspacing="0"
85
                    align="center">
86
                      <tr>
87
                        <th colspan="3" valign="center" align="center" class="bordered">
88
                          List of Acceptable Values
89
                        </th>
90
                      </tr>
91
                      <tr>
92
                        <th class="bordered">Code</th>
93
                        <th class="bordered">Definition</th>
94
                        <th class="bordered">Source</th>
95
                      </tr>
96
                      <tr>
97
                        <xsl:for-each select="eml-attribute/attribute">
98
                          <xsl:for-each select="attributeDomain">
99
                            <xsl:for-each select="enumeratedDomain">
100
                              <xsl:variable name="stripes">
101
                                <xsl:choose>
102
                                  <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
103
                                  <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
104
                                </xsl:choose>
105
                              </xsl:variable>
106
                              <tr>
107
                                <td class="{$stripes}" align="center"><xsl:value-of select="code"/></td>
108
                                <td class="{$stripes}" align="center"><xsl:value-of select="definition"/></td>
109
                                <td class="{$stripes}" align="center"><xsl:value-of select="source"/></td> &#160;
110
                              </tr>
111
                            </xsl:for-each>
112
                          </xsl:for-each>
113
                        </xsl:for-each>
114
                      </tr>
115
                      <tr>
116
                        <td>&#160;</td>
117
                      </tr>
118
                      <tr>
119
                        <td>&#160;</td>
120
                      </tr>
121
                      <tr>
122
                        <th colspan="3" valign="center" align="center" class="bordered">Acceptable Text Values</th>
123
                      </tr>
124
                      <tr>
125
                        <th class="bordered">Definition</th>
126
                        <th class="bordered">Pattern</th>
127
                        <th class="bordered">Source</th>
128
                      </tr>
129
                      <tr>
130
                      <xsl:for-each select="eml-attribute/attribute">
131
                        <xsl:for-each select="attributeDomain">
132
                          <xsl:for-each select="textDomain">
133
                            <xsl:variable name="stripes">
134
                              <xsl:choose>
135
                                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
136
                                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
137
                              </xsl:choose>
138
                            </xsl:variable>
139
                            <tr>
140
                              <td class="$stripes" align="center"><xsl:value-of select="code"/></td>
141
                              <td class="$stripes" align="center"><xsl:value-of select="definition"/></td>
142
                              <td class="$stripes" align="center"><xsl:value-of select="source"/></td> &#160;
143
                            </tr>
144
                          </xsl:for-each>
145
                        </xsl:for-each>
146
                      </xsl:for-each>
147
                    </tr>
148
                  </table>
149
                </td>
150
               </tr>
151
             </table>
152
           </td>
153
         </tr>
154
       </table>
155
      </body>
156
    </html>
34
  
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>
157 55
  </xsl:template>
158 56

  
159

  
160
  <xsl:template match="enumeratedDomain">
161
      <tr>
162
        <td><xsl:value-of select="code"/></td>
163
        <td><xsl:value-of select="definition"/></td>
164
        <td><xsl:value-of select="source"/>&#160;</td>
165
      </tr>
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>
166 70
  </xsl:template>
167

  
168
  <xsl:template match="textDomain">
169
     <tr>
170
       <td><xsl:value-of select="definition"/></td>
171
       <td><xsl:value-of select="pattern"/></td>
172
       <td><xsl:value-of select="source"/>&#160;</td>
173
     </tr>
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}">&#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>
174 94
  </xsl:template>
175 95

  
176
  <xsl:template match="numericDomain">
177
    <tr>
178
      <td><xsl:value-of select="minimum"/></td>
179
      <td><xsl:value-of select="maximum"/></td>
180
    </tr>
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}">&#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
     
181 178
  </xsl:template>
182 179

  
180
  
183 181
</xsl:stylesheet>

Also available in: Unified diff