File: guihelp.xsl

package info (click to toggle)
espresso 5.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 146,004 kB
  • ctags: 17,245
  • sloc: f90: 253,041; sh: 51,271; ansic: 27,494; tcl: 15,570; xml: 14,508; makefile: 2,958; perl: 2,035; fortran: 1,924; python: 337; cpp: 200; awk: 57
file content (239 lines) | stat: -rw-r--r-- 7,782 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
	 ***
	 *** THIS FILE IS a XSL STYLESHEET FOR TRANSFORMING INPUT_*.xml into PWgui's help file, *-help.tcl
	 ***
      -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">    

  <xsl:preserve-space elements="*"/>
  <xsl:output method="html"/>

  <!-- *** ROOT *** -->

  <xsl:template match="/input_description">
    # FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST
    <xsl:apply-templates match="namelist | card | linecard"/>
  </xsl:template>
  
  <!-- igrnore the following elements -->

  <xsl:template match="intro | toc | label | message | section |
		       subsection | subsubsection | paragraph | text">   
  </xsl:template>
  
  <!--    *** NAMELIST ***  -->

  <xsl:template match="namelist">
    <xsl:apply-templates match="descendant::var | descendant::vargroup | descendant::dimension | descendant::dimensiongroup | descendant::table"/>
  </xsl:template>


  <!--    *** CARD *** -->

  <xsl:template match="card">
    
    <!-- info for card's flags -->    
    <xsl:if test="boolean(ancestor::card/@nameless) = false()">
      help <xsl:value-of select="@name"/>_flags {
      <h2>Description of <xsl:value-of select="@name"/> card's flags</h2>
      
      <pre><xsl:value-of select="flag/info"/></pre>
      }
    </xsl:if>
    
    <xsl:apply-templates select="descendant::var | descendant::vargroup | descendant::dimension |
				 descendant::dimensiongroup | descendant::list | descendant::table"
				 mode="card_description"/>
  </xsl:template>

  <xsl:template match="flag" mode="card_description">
  </xsl:template>

  <!--    *** LINECARD *** -->

  <xsl:template match="linecard">
    <xsl:apply-templates match="descendant::var | descendant::vargroup | descendant::list"/>
  </xsl:template>
  

  <!--    *** VAR | DIMENSION | LIST ***  -->

  <xsl:template match="var | dimension | vargroup | dimensiongroup |
		       list | list/format" mode="card_description">
    <xsl:if test="info != '' or status != '' or see != ''">
      <xsl:apply-templates select="."/>
    </xsl:if>
  </xsl:template>

  <xsl:template match="var | dimension">
    <xsl:if test="name(..) != 'vargroup' and name(..) != 'dimensiongroup'">
      help <xsl:value-of select="@name"/> {
      <ul>      
	<xsl:choose>
	  <xsl:when test="name(.)='var'">
	    <li><xsl:text>&#160;</xsl:text> <em>Variable: </em> <big><b><xsl:value-of select="@name"/></b></big></li><br/>
	  </xsl:when>
	  <xsl:when test="name(.)='dimension'">
	    <li><xsl:text>&#160;</xsl:text> <em>Variables: </em> <big><b><xsl:value-of select="@name"/>(i), i=<xsl:value-of select="@start"/>,<xsl:value-of select="@end"/></b></big></li><br/>
	  </xsl:when>
	</xsl:choose>

	<li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>
	
	<xsl:apply-templates select="default"/> 
	<xsl:apply-templates select="status"/>
	<xsl:apply-templates select="see"/>
	<xsl:apply-templates select="info"/>
      </ul>      
      }
    </xsl:if>
  </xsl:template>

  <xsl:template match="list">
    help <xsl:value-of select="@name"/> {
    <ul>      
      <li><xsl:text>&#160;</xsl:text> <em>Variables: </em> <big><b><xsl:value-of select="format"/></b></big></li><br/>
      
      <li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>
      
      <xsl:apply-templates select="default"/> 
      <xsl:apply-templates select="status"/>
      <xsl:apply-templates select="see"/>
      <xsl:apply-templates select="info"/>
    </ul>      
    }

    grouphelp { <xsl:value-of select="format"/> } {
    <ul>      
      <li><xsl:text>&#160;</xsl:text> <em>Variables: </em> <big><b><xsl:value-of select="format"/></b></big></li><br/>
      
      <li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>
      
      <xsl:apply-templates select="default"/> 
      <xsl:apply-templates select="status"/>
      <xsl:apply-templates select="see"/>
      <xsl:apply-templates select="info"/>
    </ul>  
    }
  </xsl:template>

  <!-- *** VARGROUP | DIMENSIONGROUP *** -->

  <xsl:template match="vargroup | dimensiongroup">
    grouphelp {
    <xsl:for-each select="var | dimension">
      <xsl:value-of select="@name"/><xsl:text> </xsl:text> 
    </xsl:for-each>
    } {
    <ul>
      <xsl:if test="name(.)='vargroup'">	
	<li><xsl:text>&#160;</xsl:text> <em>Variables: </em> 
	  <big><b>
	      <xsl:for-each select="var">
		<xsl:value-of select="@name"/><xsl:if test="not(position()=last())">, </xsl:if>
	      </xsl:for-each>	
	  </b></big>
	</li><br/>
      </xsl:if>
      
      <xsl:if test="name(.)='dimensiongroup'">
	<li><xsl:text>&#160;</xsl:text> <em>Variables: </em>
	  <big><b>
	      <xsl:for-each select="dimension">
		<xsl:value-of select="@name"/>(i), 
		<xsl:if test="position()=last()"> 
		  i=<xsl:value-of select="../@start"/>,<xsl:value-of select="../@end"/>
		</xsl:if>
	      </xsl:for-each>
	  </b></big>
	</li><br/>
      </xsl:if>

      <li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>

      <xsl:apply-templates select="default"/> 
      <xsl:apply-templates select="status"/>
      <xsl:apply-templates select="see"/>
      <xsl:apply-templates select="info"/>
    </ul>
    }
  </xsl:template>


  <!--    *** VAR's elements ***  -->

  <xsl:template match="default">
    <li><xsl:text>&#160;</xsl:text> <em>Default: </em> <xsl:value-of select="."/></li><br/>
  </xsl:template>
  
  <xsl:template match="status">
    <li><xsl:text>&#160;</xsl:text> <em>Status: </em> <xsl:value-of select="."/></li><br/>
  </xsl:template>
  
  <xsl:template match="see">
    <li><xsl:text>&#160;</xsl:text> <em>See: </em> <xsl:value-of select="."/></li><br/>
  </xsl:template>
  
  <xsl:template match="info">
    <li><xsl:text>&#160;</xsl:text> <em>Description:</em></li>
    <blockquote><pre><xsl:value-of select="."/></pre></blockquote>
  </xsl:template>
  
  
  <!--    *** TABLE ***  -->

  <xsl:template match="table" mode="card_description">
    help <xsl:value-of select="@name"/> {
    <xsl:apply-templates select="rows | cols" mode="table"/>   
    }
  </xsl:template>
  
  <xsl:template match="rows | cols" mode="table">
    <xsl:apply-templates select="col | colgroup | row | rowgroup | optional | conditional" mode="table"/>
  </xsl:template>

  <xsl:template match="optional | conditional" mode="table">
    <xsl:apply-templates select="col | colgroup | row | rowgroup | optional | conditional" mode="table"/>
  </xsl:template>
  
  <xsl:template match="colgroup | rowgroup" mode="table">
    <xsl:if test="info != '' or status != '' or see != ''">
      <ul>
	<li><xsl:text>&#160;</xsl:text> <em>Variables: </em>
	  <big><b>
	      <xsl:for-each select=".//col | .//row">
		<xsl:value-of select="@name"/><xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if>
	      </xsl:for-each>
	  </b></big>
	</li><br/>

	<li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>
	
	<xsl:apply-templates select="default"/> 
	<xsl:apply-templates select="status"/>
	<xsl:apply-templates select="see"/>
	<xsl:apply-templates select="info"/>
      </ul>
    </xsl:if>
  </xsl:template>
  
  <xsl:template match="col | row" mode="table">
    <xsl:if test="info != '' or status != '' or see != ''">
      <ul>
	<li><xsl:text>&#160;</xsl:text> <em>Variable: </em>
	  <big><b><xsl:value-of select="@name"/></b></big>
	</li><br/>

	<li><xsl:text>&#160;</xsl:text> <em>Type: </em> <xsl:value-of select="@type"/></li><br/>

	<xsl:apply-templates select="default"/> 
	<xsl:apply-templates select="status"/>
	<xsl:apply-templates select="see"/>
	<xsl:apply-templates select="info"/>
      </ul>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>