]> matita.cs.unibo.it Git - helm.git/blob - helm/nuprl_stylesheets/nuprl_html_basic.xsl
ocaml 3.09 transition
[helm.git] / helm / nuprl_stylesheets / nuprl_html_basic.xsl
1 <?xml version="1.0"?>
2 <!-- Copyright (C) 2000, HELM Team                                     -->
3 <!-- This file is part of HELM, an Hypertextual, Electronic            -->
4 <!-- Library of Mathematics, developed at the Computer Science         -->
5 <!-- Department, University of Bologna, Italy.                         -->
6 <!-- HELM is free software; you can redistribute it and/or             -->
7 <!-- modify it under the terms of the GNU General Public License       -->
8 <!-- as published by the Free Software Foundation; either version 2    -->
9 <!-- of the License, or (at your option) any later version.            -->
10 <!-- HELM is distributed in the hope that it will be useful,           -->
11 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
12 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
13 <!-- GNU General Public License for more details.                      -->
14 <!-- You should have received a copy of the GNU General Public License -->
15 <!-- along with HELM; if not, write to the Free Software               -->
16 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
17 <!-- MA  02111-1307, USA.                                              -->
18 <!-- For details, see the HELM World-Wide-Web page,                    -->
19 <!-- http://cs.unibo.it/helm/.                                         -->
20 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:i="http://www.cs.unibo.it/helm/InputNotationalElements" xmlns:o="http://www.cs.unibo.it/helm/OutputNotationalElements" version="1.0">
21 <!-- HTML SYMBOLS  -->
22 <!--and-->
23   <xsl:variable name="and">
24     <xsl:choose>
25       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">&#xD9;</xsl:when>
26       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#x2227;</xsl:when>
27       <xsl:otherwise>???</xsl:otherwise>
28     </xsl:choose>
29   </xsl:variable>
30 <!--or-->
31   <xsl:variable name="or">
32     <xsl:choose>
33       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">&#xDA;</xsl:when>
34       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#x2228;</xsl:when>
35       <xsl:otherwise>???</xsl:otherwise>
36     </xsl:choose>
37   </xsl:variable>
38 <!--iff-->
39   <xsl:variable name="iff">
40     <xsl:choose>
41       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">&#xDB;</xsl:when>
42       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#x21D4;</xsl:when>
43       <xsl:otherwise>???</xsl:otherwise>
44     </xsl:choose>
45   </xsl:variable>
46 <!--not-->
47   <xsl:variable name="not">
48     <xsl:choose>
49       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">&#xD8;</xsl:when>
50       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#xAC;</xsl:when>
51       <xsl:otherwise>???</xsl:otherwise>
52     </xsl:choose>
53   </xsl:variable>
54 <!--eq-->
55   <xsl:variable name="eq">
56     <xsl:choose>
57       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">=</xsl:when>
58       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">=</xsl:when>
59       <xsl:otherwise>???</xsl:otherwise>
60     </xsl:choose>
61   </xsl:variable>
62 <!--neq-->
63   <xsl:variable name="neq">
64     <xsl:choose>
65       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">&#xB9;</xsl:when>
66       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#x2260;</xsl:when>
67       <xsl:otherwise>???</xsl:otherwise>
68     </xsl:choose>
69   </xsl:variable>
70 <!--exists-->
71   <xsl:variable name="exists">
72     <xsl:choose>
73       <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">$</xsl:when>
74       <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">&#x2203;</xsl:when>
75       <xsl:otherwise>???</xsl:otherwise>
76     </xsl:choose>
77   </xsl:variable>
78 <!-- AND -->
79   <xsl:template match="m:apply[m:and[count(*) = 0] and count(*) = 3]">
80     <xsl:param name="current_indent" select="0"/>
81     <xsl:param name="width" select="$framewidth"/>
82     <xsl:variable name="charlength">
83       <xsl:apply-templates select="." mode="root_charcount"/>
84     </xsl:variable>
85     <xsl:choose>
86       <xsl:when test="$width &gt;= $charlength">
87         <xsl:apply-templates select="." mode="inline"/>
88       </xsl:when>
89       <xsl:otherwise>
90         <xsl:text>(</xsl:text>
91         <xsl:apply-templates select="*[2]">
92           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
93         </xsl:apply-templates>
94         <BR/>
95         <xsl:call-template name="make_indent">
96           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
97         </xsl:call-template>
98         <a href="{m:and/@definitionURL}">
99           <xsl:choose>
100             <xsl:when test="boolean($and)">
101               <xsl:call-template name="mksymbol">
102                 <xsl:with-param name="symbol" select="$and"/>
103               </xsl:call-template>
104             </xsl:when>
105             <xsl:otherwise>and</xsl:otherwise>
106           </xsl:choose>
107         </a>
108         <xsl:apply-templates select="*[3]">
109           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
110         </xsl:apply-templates>
111         <xsl:text>)</xsl:text>
112       </xsl:otherwise>
113     </xsl:choose>
114   </xsl:template>
115 <!-- AND (INLINE MODE) -->
116   <xsl:template match="m:apply[m:and[count(*) = 0] and count(*) = 3]" mode="inline">
117     <xsl:text>(</xsl:text>
118     <xsl:apply-templates select="*[2]" mode="inline"/>
119     <a href="{m:and/@definitionURL}">
120       <xsl:choose>
121         <xsl:when test="boolean($and)">
122           <xsl:call-template name="mksymbol">
123             <xsl:with-param name="symbol" select="$and"/>
124           </xsl:call-template>
125         </xsl:when>
126         <xsl:otherwise>and</xsl:otherwise>
127       </xsl:choose>
128     </a>
129     <xsl:apply-templates select="*[3]" mode="inline"/>
130     <xsl:text>)</xsl:text>
131   </xsl:template>
132 <!-- AND (CHARCOUNT MODE) -->
133   <xsl:template match="m:apply[m:and[count(*) = 0] and count(*) = 3]" mode="root_charcount">
134     <xsl:param name="incurrent_length" select="0"/>
135     <xsl:value-of select="$incurrent_length + 3"/>
136   </xsl:template>
137 <!-- OR -->
138   <xsl:template match="m:apply[m:or[count(*) = 0] and count(*) = 3]">
139     <xsl:param name="current_indent" select="0"/>
140     <xsl:param name="width" select="$framewidth"/>
141     <xsl:variable name="charlength">
142       <xsl:apply-templates select="." mode="root_charcount"/>
143     </xsl:variable>
144     <xsl:choose>
145       <xsl:when test="$width &gt;= $charlength">
146         <xsl:apply-templates select="." mode="inline"/>
147       </xsl:when>
148       <xsl:otherwise>
149         <xsl:text>(</xsl:text>
150         <xsl:apply-templates select="*[2]">
151           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
152         </xsl:apply-templates>
153         <BR/>
154         <xsl:call-template name="make_indent">
155           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
156         </xsl:call-template>
157         <a href="{m:or/@definitionURL}">
158           <xsl:choose>
159             <xsl:when test="boolean($or)">
160               <xsl:call-template name="mksymbol">
161                 <xsl:with-param name="symbol" select="$or"/>
162               </xsl:call-template>
163             </xsl:when>
164             <xsl:otherwise>or</xsl:otherwise>
165           </xsl:choose>
166         </a>
167         <xsl:apply-templates select="*[3]">
168           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
169         </xsl:apply-templates>
170         <xsl:text>)</xsl:text>
171       </xsl:otherwise>
172     </xsl:choose>
173   </xsl:template>
174 <!-- OR (INLINE MODE) -->
175   <xsl:template match="m:apply[m:or[count(*) = 0] and count(*) = 3]" mode="inline">
176     <xsl:text>(</xsl:text>
177     <xsl:apply-templates select="*[2]" mode="inline"/>
178     <a href="{m:or/@definitionURL}">
179       <xsl:choose>
180         <xsl:when test="boolean($or)">
181           <xsl:call-template name="mksymbol">
182             <xsl:with-param name="symbol" select="$or"/>
183           </xsl:call-template>
184         </xsl:when>
185         <xsl:otherwise>or</xsl:otherwise>
186       </xsl:choose>
187     </a>
188     <xsl:apply-templates select="*[3]" mode="inline"/>
189     <xsl:text>)</xsl:text>
190   </xsl:template>
191 <!-- OR (CHARCOUNT MODE) -->
192   <xsl:template match="m:apply[m:or[count(*) = 0] and count(*) = 3]" mode="root_charcount">
193     <xsl:param name="incurrent_length" select="0"/>
194     <xsl:value-of select="$incurrent_length + 3"/>
195   </xsl:template>
196 <!-- IFF -->
197   <xsl:template match="m:apply[m:csymbol[text() = 'iff' and count(*) = 0] and count(*) = 3]">
198     <xsl:param name="current_indent" select="0"/>
199     <xsl:param name="width" select="$framewidth"/>
200     <xsl:variable name="charlength">
201       <xsl:apply-templates select="." mode="root_charcount"/>
202     </xsl:variable>
203     <xsl:choose>
204       <xsl:when test="$width &gt;= $charlength">
205         <xsl:apply-templates select="." mode="inline"/>
206       </xsl:when>
207       <xsl:otherwise>
208         <xsl:text>(</xsl:text>
209         <xsl:apply-templates select="*[2]">
210           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
211         </xsl:apply-templates>
212         <BR/>
213         <xsl:call-template name="make_indent">
214           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
215         </xsl:call-template>
216         <a href="{m:csymbol/@definitionURL}">
217           <xsl:choose>
218             <xsl:when test="boolean($iff)">
219               <xsl:call-template name="mksymbol">
220                 <xsl:with-param name="symbol" select="$iff"/>
221               </xsl:call-template>
222             </xsl:when>
223             <xsl:otherwise>iff</xsl:otherwise>
224           </xsl:choose>
225         </a>
226         <xsl:apply-templates select="*[3]">
227           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
228         </xsl:apply-templates>
229         <xsl:text>)</xsl:text>
230       </xsl:otherwise>
231     </xsl:choose>
232   </xsl:template>
233 <!-- IFF (INLINE MODE) -->
234   <xsl:template match="m:apply[m:csymbol[text() = 'iff' and count(*) = 0] and count(*) = 3]" mode="inline">
235     <xsl:text>(</xsl:text>
236     <xsl:apply-templates select="*[2]" mode="inline"/>
237     <a href="{m:csymbol/@definitionURL}">
238       <xsl:choose>
239         <xsl:when test="boolean($iff)">
240           <xsl:call-template name="mksymbol">
241             <xsl:with-param name="symbol" select="$iff"/>
242           </xsl:call-template>
243         </xsl:when>
244         <xsl:otherwise>iff</xsl:otherwise>
245       </xsl:choose>
246     </a>
247     <xsl:apply-templates select="*[3]" mode="inline"/>
248     <xsl:text>)</xsl:text>
249   </xsl:template>
250 <!-- IFF (CHARCOUNT MODE) -->
251   <xsl:template match="m:apply[m:csymbol[text() = 'iff' and count(*) = 0] and count(*) = 3]" mode="root_charcount">
252     <xsl:param name="incurrent_length" select="0"/>
253     <xsl:value-of select="$incurrent_length + 3"/>
254   </xsl:template>
255 <!-- NOT -->
256   <xsl:template match="m:apply[m:not[count(*) = 0] and count(*) = 2]">
257     <xsl:param name="current_indent" select="0"/>
258     <xsl:param name="width" select="$framewidth"/>
259     <a href="{m:not/@definitionURL}">
260       <xsl:choose>
261         <xsl:when test="boolean($not)">
262           <xsl:call-template name="mksymbol">
263             <xsl:with-param name="symbol" select="$not"/>
264           </xsl:call-template>
265         </xsl:when>
266         <xsl:otherwise>not</xsl:otherwise>
267       </xsl:choose>
268     </a>
269     <xsl:apply-templates select="*[2]">
270       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
271     </xsl:apply-templates>
272   </xsl:template>
273 <!-- NOT (INLINE MODE) -->
274   <xsl:template match="m:apply[m:not[count(*) = 0] and count(*) = 2]" mode="inline">
275     <a href="{m:not/@definitionURL}">
276       <xsl:choose>
277         <xsl:when test="boolean($not)">
278           <xsl:call-template name="mksymbol">
279             <xsl:with-param name="symbol" select="$not"/>
280           </xsl:call-template>
281         </xsl:when>
282         <xsl:otherwise>not</xsl:otherwise>
283       </xsl:choose>
284     </a>
285     <xsl:apply-templates select="*[2]" mode="inline"/>
286   </xsl:template>
287 <!-- NOT (CHARCOUNT MODE) -->
288   <xsl:template match="m:apply[m:not[count(*) = 0] and count(*) = 2]" mode="root_charcount">
289     <xsl:param name="incurrent_length" select="0"/>
290     <xsl:value-of select="$incurrent_length + 1"/>
291   </xsl:template>
292 <!-- EQUALITY and TYPE EQUALITY -->
293   <xsl:template match="m:apply[m:eq[count(*) = 0] and count(*) = 3]">
294     <xsl:param name="current_indent" select="0"/>
295     <xsl:param name="width" select="$framewidth"/>
296     <xsl:variable name="charlength">
297       <xsl:apply-templates select="." mode="root_charcount"/>
298     </xsl:variable>
299     <xsl:choose>
300       <xsl:when test="$width &gt;= $charlength">
301         <xsl:apply-templates select="." mode="inline"/>
302       </xsl:when>
303       <xsl:otherwise>
304         <xsl:text>(</xsl:text>
305         <xsl:apply-templates select="*[2]">
306           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
307         </xsl:apply-templates>
308         <BR/>
309         <xsl:call-template name="make_indent">
310           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
311         </xsl:call-template>
312         <a href="{m:eq/@definitionURL}">
313           <xsl:choose>
314             <xsl:when test="boolean($eq)">
315               <xsl:call-template name="mksymbol">
316                 <xsl:with-param name="symbol" select="$eq"/>
317               </xsl:call-template>
318             </xsl:when>
319             <xsl:otherwise>eq</xsl:otherwise>
320           </xsl:choose>
321         </a>
322         <xsl:apply-templates select="*[3]">
323           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
324         </xsl:apply-templates>
325         <xsl:text>)</xsl:text>
326       </xsl:otherwise>
327     </xsl:choose>
328   </xsl:template>
329 <!-- EQUALITY and TYPE EQUALITY (INLINE MODE) -->
330   <xsl:template match="m:apply[m:eq[count(*) = 0] and count(*) = 3]" mode="inline">
331     <xsl:text>(</xsl:text>
332     <xsl:apply-templates select="*[2]" mode="inline"/>
333     <a href="{m:eq/@definitionURL}">
334       <xsl:choose>
335         <xsl:when test="boolean($eq)">
336           <xsl:call-template name="mksymbol">
337             <xsl:with-param name="symbol" select="$eq"/>
338           </xsl:call-template>
339         </xsl:when>
340         <xsl:otherwise>eq</xsl:otherwise>
341       </xsl:choose>
342     </a>
343     <xsl:apply-templates select="*[3]" mode="inline"/>
344     <xsl:text>)</xsl:text>
345   </xsl:template>
346 <!-- EQUALITY and TYPE EQUALITY (CHARCOUNT MODE) -->
347   <xsl:template match="m:apply[m:eq[count(*) = 0] and count(*) = 3]" mode="root_charcount">
348     <xsl:param name="incurrent_length" select="0"/>
349     <xsl:value-of select="$incurrent_length + 3"/>
350   </xsl:template>
351 <!-- NOT-EQ and NOT-EQT -->
352   <xsl:template match="m:apply[m:neq[count(*) = 0] and count(*) = 3]">
353     <xsl:param name="current_indent" select="0"/>
354     <xsl:param name="width" select="$framewidth"/>
355     <xsl:variable name="charlength">
356       <xsl:apply-templates select="." mode="root_charcount"/>
357     </xsl:variable>
358     <xsl:choose>
359       <xsl:when test="$width &gt;= $charlength">
360         <xsl:apply-templates select="." mode="inline"/>
361       </xsl:when>
362       <xsl:otherwise>
363         <xsl:text>(</xsl:text>
364         <xsl:apply-templates select="*[2]">
365           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
366         </xsl:apply-templates>
367         <BR/>
368         <xsl:call-template name="make_indent">
369           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
370         </xsl:call-template>
371         <a href="{m:neq/@definitionURL}">
372           <xsl:choose>
373             <xsl:when test="boolean($neq)">
374               <xsl:call-template name="mksymbol">
375                 <xsl:with-param name="symbol" select="$neq"/>
376               </xsl:call-template>
377             </xsl:when>
378             <xsl:otherwise>neq</xsl:otherwise>
379           </xsl:choose>
380         </a>
381         <xsl:apply-templates select="*[3]">
382           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
383         </xsl:apply-templates>
384         <xsl:text>)</xsl:text>
385       </xsl:otherwise>
386     </xsl:choose>
387   </xsl:template>
388 <!-- NOT-EQ and NOT-EQT (INLINE MODE) -->
389   <xsl:template match="m:apply[m:neq[count(*) = 0] and count(*) = 3]" mode="inline">
390     <xsl:text>(</xsl:text>
391     <xsl:apply-templates select="*[2]" mode="inline"/>
392     <a href="{m:neq/@definitionURL}">
393       <xsl:choose>
394         <xsl:when test="boolean($neq)">
395           <xsl:call-template name="mksymbol">
396             <xsl:with-param name="symbol" select="$neq"/>
397           </xsl:call-template>
398         </xsl:when>
399         <xsl:otherwise>neq</xsl:otherwise>
400       </xsl:choose>
401     </a>
402     <xsl:apply-templates select="*[3]" mode="inline"/>
403     <xsl:text>)</xsl:text>
404   </xsl:template>
405 <!-- NOT-EQ and NOT-EQT (CHARCOUNT MODE) -->
406   <xsl:template match="m:apply[m:neq[count(*) = 0] and count(*) = 3]" mode="root_charcount">
407     <xsl:param name="incurrent_length" select="0"/>
408     <xsl:value-of select="$incurrent_length + 3"/>
409   </xsl:template>
410 <!-- EXIST -->
411   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]">
412     <xsl:param name="current_indent" select="0"/>
413     <xsl:param name="width" select="$framewidth"/>
414     <xsl:variable name="charlength">
415       <xsl:apply-templates select="." mode="root_charcount"/>
416     </xsl:variable>
417     <xsl:choose>
418       <xsl:when test="$width &gt;= $charlength">
419         <xsl:apply-templates select="." mode="inline"/>
420       </xsl:when>
421       <xsl:otherwise>
422         <a href="{m:exists/@definitionURL}">
423           <xsl:choose>
424             <xsl:when test="boolean($exists)">
425               <xsl:call-template name="mksymbol">
426                 <xsl:with-param name="symbol" select="$exists"/>
427               </xsl:call-template>
428             </xsl:when>
429             <xsl:otherwise>exists</xsl:otherwise>
430           </xsl:choose>
431         </a>
432         <xsl:value-of select="m:bvar/m:ci/text()"/>
433         <xsl:text>:</xsl:text>
434         <xsl:apply-templates select="m:condition/*[1]">
435           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
436         </xsl:apply-templates>
437         <BR/>
438         <xsl:call-template name="make_indent">
439           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
440         </xsl:call-template>
441         <xsl:text>.</xsl:text>
442         <xsl:apply-templates select="*[4]">
443           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
444         </xsl:apply-templates>
445       </xsl:otherwise>
446     </xsl:choose>
447   </xsl:template>
448 <!-- EXIST (INLINE MODE) -->
449   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]" mode="inline">
450     <a href="{m:exists/@definitionURL}">
451       <xsl:choose>
452         <xsl:when test="boolean($exists)">
453           <xsl:call-template name="mksymbol">
454             <xsl:with-param name="symbol" select="$exists"/>
455           </xsl:call-template>
456         </xsl:when>
457         <xsl:otherwise>exists</xsl:otherwise>
458       </xsl:choose>
459     </a>
460     <xsl:value-of select="m:bvar/m:ci/text()"/>
461     <xsl:text>:</xsl:text>
462     <xsl:apply-templates select="m:condition/*[1]" mode="inline"/>
463     <xsl:text>.</xsl:text>
464     <xsl:apply-templates select="*[4]" mode="inline"/>
465   </xsl:template>
466 <!-- EXIST (CHARCOUNT MODE) -->
467   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]" mode="root_charcount">
468     <xsl:param name="incurrent_length" select="0"/>
469     <xsl:value-of select="$incurrent_length + 3"/>
470   </xsl:template>
471 <!-- EXIST -->
472   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]">
473     <xsl:param name="current_indent" select="0"/>
474     <xsl:param name="width" select="$framewidth"/>
475     <xsl:variable name="charlength">
476       <xsl:apply-templates select="." mode="root_charcount"/>
477     </xsl:variable>
478     <xsl:choose>
479       <xsl:when test="$width &gt;= $charlength">
480         <xsl:apply-templates select="." mode="inline"/>
481       </xsl:when>
482       <xsl:otherwise>
483         <a href="{m:exists/@definitionURL}">
484           <xsl:choose>
485             <xsl:when test="boolean($exists)">
486               <xsl:call-template name="mksymbol">
487                 <xsl:with-param name="symbol" select="$exists"/>
488               </xsl:call-template>
489             </xsl:when>
490             <xsl:otherwise>exists</xsl:otherwise>
491           </xsl:choose>
492         </a>
493         <xsl:value-of select="m:bvar/m:ci/text()"/>
494         <xsl:text>:</xsl:text>
495         <xsl:apply-templates select="m:condition/*[1]">
496           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
497         </xsl:apply-templates>
498         <BR/>
499         <xsl:call-template name="make_indent">
500           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
501         </xsl:call-template>
502         <xsl:text>.</xsl:text>
503         <xsl:apply-templates select="*[4]">
504           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
505         </xsl:apply-templates>
506       </xsl:otherwise>
507     </xsl:choose>
508   </xsl:template>
509 <!-- EXIST (INLINE MODE) -->
510   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]" mode="inline">
511     <a href="{m:exists/@definitionURL}">
512       <xsl:choose>
513         <xsl:when test="boolean($exists)">
514           <xsl:call-template name="mksymbol">
515             <xsl:with-param name="symbol" select="$exists"/>
516           </xsl:call-template>
517         </xsl:when>
518         <xsl:otherwise>exists</xsl:otherwise>
519       </xsl:choose>
520     </a>
521     <xsl:value-of select="m:bvar/m:ci/text()"/>
522     <xsl:text>:</xsl:text>
523     <xsl:apply-templates select="m:condition/*[1]" mode="inline"/>
524     <xsl:text>.</xsl:text>
525     <xsl:apply-templates select="*[4]" mode="inline"/>
526   </xsl:template>
527 <!-- EXIST (CHARCOUNT MODE) -->
528   <xsl:template match="m:apply[m:exists[count(*) = 0] and m:bvar/m:ci[count(*) = 0] and m:condition[count(*) = 1] and count(*) = 4]" mode="root_charcount">
529     <xsl:param name="incurrent_length" select="0"/>
530     <xsl:value-of select="$incurrent_length + 3"/>
531   </xsl:template>
532 </xsl:stylesheet>