1 <!-- saved from url=(0013)about:internet -->
4 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 xmlns:
mml=
"http://www.w3.org/1998/Math/MathML"
9 $Id: ctop.xsl,v 1.3 2002/09/20 08:41:39 davidc Exp $
11 Copyright David Carlisle 2001, 2002.
13 Use and distribution of this code are permitted under the terms of the <a
14 href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
15 >W3C Software Notice and License</a>.
18 <xsl:output method=
"xml" />
20 <xsl:template mode=
"c2p" match=
"*">
22 <xsl:copy-of select=
"@*"/>
23 <xsl:apply-templates mode=
"c2p"/>
30 <xsl:template mode=
"c2p" match=
"mml:cn">
31 <mml:mn><xsl:apply-templates mode=
"c2p"/></mml:mn>
34 <xsl:template mode=
"c2p" match=
"mml:cn[@type='complex-cartesian']">
36 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[1]"/></mml:mn>
38 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[2]"/></mml:mn>
39 <mml:mo><!--⁢--><!--invisible times--></mml:mo>
40 <mml:mi>i
<!-- imaginary i --></mml:mi>
44 <xsl:template mode=
"c2p" match=
"mml:cn[@type='rational']">
46 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[1]"/></mml:mn>
48 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[2]"/></mml:mn>
52 <xsl:template mode=
"c2p" match=
"mml:cn[@type='integer']">
54 <xsl:when test=
"not(@base) or @base=10">
55 <mml:mn><xsl:apply-templates mode=
"c2p"/></mml:mn>
59 <mml:mn><xsl:apply-templates mode=
"c2p"/></mml:mn>
60 <mml:mn><xsl:value-of select=
"@base"/></mml:mn>
66 <xsl:template mode=
"c2p" match=
"mml:cn[@type='complex-polar']">
68 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[1]"/></mml:mn>
69 <mml:mo><!--⁢--><!--invisible times--></mml:mo>
71 <mml:mi>e
<!-- exponential e--></mml:mi>
73 <mml:mi>i
<!-- imaginary i--></mml:mi>
74 <mml:mo><!--⁢--><!--invisible times--></mml:mo>
75 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[2]"/></mml:mn>
81 <xsl:template mode=
"c2p" match=
"mml:cn[@type='e-notation']">
82 <mml:mn><xsl:apply-templates mode=
"c2p" select=
"text()[1]"/>E
<xsl:apply-templates mode=
"c2p" select=
"text()[2]"/></mml:mn>
87 <xsl:template mode=
"c2p" match=
"mml:ci/text()">
88 <mml:mi><xsl:value-of select=
"."/></mml:mi>
91 <xsl:template mode=
"c2p" match=
"mml:ci">
92 <mml:mrow><xsl:apply-templates mode=
"c2p"/></mml:mrow>
95 <!-- 4.4.1.2 csymbol -->
97 <xsl:template mode=
"c2p" match=
"mml:csymbol/text()">
98 <mml:mo><xsl:apply-templates mode=
"c2p"/></mml:mo>
101 <xsl:template mode=
"c2p" match=
"mml:csymbol">
102 <mml:mrow><xsl:apply-templates mode=
"c2p"/></mml:mrow>
105 <!-- 4.4.2.1 apply 4.4.2.2 reln -->
107 <xsl:template mode=
"c2p" match=
"mml:apply|mml:reln">
109 <xsl:apply-templates mode=
"c2p" select=
"*[1]">
110 <xsl:with-param name=
"p" select=
"10"/>
111 </xsl:apply-templates>
112 <mml:mo><!--⁢--><!--invisible times--></mml:mo>
113 <mml:mfenced open=
"(" close=
")" separators=
",">
114 <xsl:apply-templates mode=
"c2p" select=
"*[position()>1]"/>
120 <xsl:template mode=
"c2p" match=
"mml:fn">
121 <mml:mrow><xsl:apply-templates mode=
"c2p"/></mml:mrow>
124 <!-- 4.4.2.4 interval -->
125 <xsl:template mode=
"c2p" match=
"mml:interval[*[2]]">
126 <mml:mfenced open=
"[" close=
"]"><xsl:apply-templates mode=
"c2p"/></mml:mfenced>
128 <xsl:template mode=
"c2p" match=
"mml:interval[*[2]][@closure='open']">
129 <mml:mfenced open=
"(" close=
")"><xsl:apply-templates mode=
"c2p"/></mml:mfenced>
131 <xsl:template mode=
"c2p" match=
"mml:interval[*[2]][@closure='open-closed']">
132 <mml:mfenced open=
"(" close=
"]"><xsl:apply-templates mode=
"c2p"/></mml:mfenced>
134 <xsl:template mode=
"c2p" match=
"mml:interval[*[2]][@closure='closed-open']">
135 <mml:mfenced open=
"[" close=
")"><xsl:apply-templates mode=
"c2p"/></mml:mfenced>
138 <xsl:template mode=
"c2p" match=
"mml:interval">
139 <mml:mfenced open=
"{{" close=
"}}"><xsl:apply-templates mode=
"c2p"/></mml:mfenced>
142 <!-- 4.4.2.5 inverse -->
144 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:inverse]]">
146 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
147 <mml:mrow><mml:mo>(
</mml:mo><mml:mn>-
1</mml:mn><mml:mo>)
</mml:mo></mml:mrow>
153 <!-- 4.4.2.7 condition -->
154 <xsl:template mode=
"c2p" match=
"mml:condition">
155 <mml:mrow><xsl:apply-templates mode=
"c2p"/></mml:mrow>
158 <!-- 4.4.2.8 declare -->
159 <xsl:template mode=
"c2p" match=
"mml:declare"/>
161 <!-- 4.4.2.9 lambda -->
162 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:lambda]]">
164 <mml:mi>λ<!--lambda--></mml:mi>
165 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:bvar/*"/></mml:mrow>
168 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
174 <!-- 4.4.2.10 compose -->
175 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:compose]]">
176 <xsl:param name=
"p" select=
"0"/>
177 <xsl:call-template name=
"infix">
178 <xsl:with-param name=
"this-p" select=
"1"/>
179 <xsl:with-param name=
"p" select=
"$p"/>
180 <xsl:with-param name=
"mo"><mml:mo>∘<!-- o --></mml:mo></xsl:with-param>
185 <!-- 4.4.2.11` ident -->
186 <xsl:template mode=
"c2p" match=
"mml:ident">
190 <!-- 4.4.2.12` domain -->
191 <xsl:template mode=
"c2p" match=
"mml:domain">
192 <mml:mo>domain
</mml:mo>
195 <!-- 4.4.2.13` codomain -->
196 <xsl:template mode=
"c2p" match=
"mml:codomain">
197 <mml:mo>codomain
</mml:mo>
200 <!-- 4.4.2.14` image -->
201 <xsl:template mode=
"c2p" match=
"mml:image">
202 <mml:mo>image
</mml:mo>
205 <!-- 4.4.2.15` domainofapplication -->
206 <xsl:template mode=
"c2p" match=
"mml:domainofapplication">
210 <!-- 4.4.2.16` piecewise -->
211 <xsl:template mode=
"c2p" match=
"mml:piecewise">
215 <xsl:for-each select=
"mml:piece|mml:otherwise">
217 <mml:mtd><xsl:apply-templates mode=
"c2p" select=
"*[1]"/></mml:mtd>
218 <mml:mtd><mml:mtext>  if
 </mml:mtext></mml:mtd>
219 <mml:mtd><xsl:apply-templates mode=
"c2p" select=
"*[2]"/></mml:mtd>
227 <!-- 4.4.3.1 quotient -->
228 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:quotient]]">
230 <mml:mo>⌊<!-- lfloor--></mml:mo>
231 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
233 <xsl:apply-templates mode=
"c2p" select=
"*[3]"/>
234 <mml:mo>⌋<!-- rfloor--></mml:mo>
240 <!-- 4.4.3.2 factorial -->
241 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:factorial]]">
243 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
244 <xsl:with-param name=
"p" select=
"7"/>
245 </xsl:apply-templates>
251 <!-- 4.4.3.3 divide -->
252 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:divide]]">
253 <xsl:param name=
"p" select=
"0"/>
254 <xsl:call-template name=
"binary">
255 <xsl:with-param name=
"mo"><mml:mo>/
</mml:mo></xsl:with-param>
256 <xsl:with-param name=
"p" select=
"$p"/>
257 <xsl:with-param name=
"this-p" select=
"3"/>
262 <!-- 4.4.3.4 max min-->
263 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:max]]">
266 <xsl:call-template name=
"set"/>
270 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:min]]">
273 <xsl:call-template name=
"set"/>
277 <!-- 4.4.3.5 minus-->
278 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:minus] and count(*)=2]">
280 <mml:mo>−<!--minus--></mml:mo>
281 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
282 <xsl:with-param name=
"p" select=
"5"/>
283 </xsl:apply-templates>
287 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:minus] and count(*)>2]">
288 <xsl:param name=
"p" select=
"0"/>
289 <xsl:call-template name=
"binary">
290 <xsl:with-param name=
"mo"><mml:mo>−<!--minus--></mml:mo></xsl:with-param>
291 <xsl:with-param name=
"p" select=
"$p"/>
292 <xsl:with-param name=
"this-p" select=
"2"/>
297 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:plus]]">
298 <xsl:param name=
"p" select=
"0"/>
300 <xsl:if test=
"$p > 2"><mml:mo>(
</mml:mo></xsl:if>
301 <xsl:for-each select=
"*[position()>1]">
302 <xsl:if test=
"position() > 1">
305 <xsl:when test=
"self::mml:apply[*[1][self::mml:times] and
306 *[2][self::mml:apply/*[1][self::mml:minus] or self::mml:cn[not(mml:sep) and
307 (number(.) < 0)]]]">−<!--minus--></xsl:when>
308 <xsl:otherwise>+
</xsl:otherwise>
313 <xsl:when test=
"self::mml:apply[*[1][self::mml:times] and
314 *[2][self::mml:cn[not(mml:sep) and (number(.) <0)]]]">
316 <mml:mn><xsl:value-of select=
"-(*[2])"/></mml:mn>
317 <mml:mo><!--⁢--><!--invisible times--></mml:mo>
318 <xsl:apply-templates mode=
"c2p" select=
".">
319 <xsl:with-param name=
"first" select=
"2"/>
320 <xsl:with-param name=
"p" select=
"2"/>
321 </xsl:apply-templates>
324 <xsl:when test=
"self::mml:apply[*[1][self::mml:times] and
325 *[2][self::mml:apply/*[1][self::mml:minus]]]">
327 <xsl:apply-templates mode=
"c2p" select=
"./*[2]/*[2]"/>
328 <xsl:apply-templates mode=
"c2p" select=
".">
329 <xsl:with-param name=
"first" select=
"2"/>
330 <xsl:with-param name=
"p" select=
"2"/>
331 </xsl:apply-templates>
335 <xsl:apply-templates mode=
"c2p" select=
".">
336 <xsl:with-param name=
"p" select=
"2"/>
337 </xsl:apply-templates>
341 <xsl:if test=
"$p > 2"><mml:mo>)
</mml:mo></xsl:if>
346 <!-- 4.4.3.7 power -->
347 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:power]]">
349 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
350 <xsl:with-param name=
"p" select=
"5"/>
351 </xsl:apply-templates>
352 <xsl:apply-templates mode=
"c2p" select=
"*[3]">
353 <xsl:with-param name=
"p" select=
"5"/>
354 </xsl:apply-templates>
358 <!-- 4.4.3.8 remainder -->
359 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:rem]]">
360 <xsl:param name=
"p" select=
"0"/>
361 <xsl:call-template name=
"binary">
362 <xsl:with-param name=
"mo"><mml:mo>mod
</mml:mo></xsl:with-param>
363 <xsl:with-param name=
"p" select=
"$p"/>
364 <xsl:with-param name=
"this-p" select=
"3"/>
368 <!-- 4.4.3.9 times-->
369 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:times]]" name=
"times">
370 <xsl:param name=
"p" select=
"0"/>
371 <xsl:param name=
"first" select=
"1"/>
373 <xsl:if test=
"$p > 3"><mml:mo>(
</mml:mo></xsl:if>
374 <xsl:for-each select=
"*[position()>1]">
375 <xsl:if test=
"position() > 1">
378 <xsl:when test=
"self::mml:cn">×<!-- times --></xsl:when>
379 <xsl:otherwise><!--⁢--><!--invisible times--></xsl:otherwise>
383 <xsl:if test=
"position()>= $first">
384 <xsl:apply-templates mode=
"c2p" select=
".">
385 <xsl:with-param name=
"p" select=
"3"/>
386 </xsl:apply-templates>
389 <xsl:if test=
"$p > 3"><mml:mo>)
</mml:mo></xsl:if>
394 <!-- 4.4.3.10 root -->
395 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:root] and not(mml:degree) or mml:degree=2]" priority=
"4">
397 <xsl:apply-templates mode=
"c2p" select=
"*[position()>1]"/>
401 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:root]]">
403 <xsl:apply-templates mode=
"c2p" select=
"*[position()>1 and not(self::mml:degree)]"/>
404 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:degree/*"/></mml:mrow>
408 <!-- 4.4.3.11 gcd -->
409 <xsl:template mode=
"c2p" match=
"mml:gcd">
413 <!-- 4.4.3.12 and -->
414 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:and]]">
415 <xsl:param name=
"p" select=
"0"/>
416 <xsl:call-template name=
"infix">
417 <xsl:with-param name=
"this-p" select=
"2"/>
418 <xsl:with-param name=
"p" select=
"$p"/>
419 <xsl:with-param name=
"mo"><mml:mo>∧<!-- and --></mml:mo></xsl:with-param>
425 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:or]]">
426 <xsl:param name=
"p" select=
"0"/>
427 <xsl:call-template name=
"infix">
428 <xsl:with-param name=
"this-p" select=
"3"/>
429 <xsl:with-param name=
"p" select=
"$p"/>
430 <xsl:with-param name=
"mo"><mml:mo>∨<!-- or --></mml:mo></xsl:with-param>
434 <!-- 4.4.3.14 xor -->
435 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:xor]]">
436 <xsl:param name=
"p" select=
"0"/>
437 <xsl:call-template name=
"infix">
438 <xsl:with-param name=
"this-p" select=
"3"/>
439 <xsl:with-param name=
"p" select=
"$p"/>
440 <xsl:with-param name=
"mo"><mml:mo>xor
</mml:mo></xsl:with-param>
445 <!-- 4.4.3.15 not -->
446 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:not]]">
448 <mml:mo>¬<!-- not --></mml:mo>
449 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
450 <xsl:with-param name=
"p" select=
"7"/>
451 </xsl:apply-templates>
458 <!-- 4.4.3.16 implies -->
459 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:implies]]">
460 <xsl:param name=
"p" select=
"0"/>
461 <xsl:call-template name=
"binary">
462 <xsl:with-param name=
"mo"><mml:mo>⇒<!-- Rightarrow --></mml:mo></xsl:with-param>
463 <xsl:with-param name=
"p" select=
"$p"/>
464 <xsl:with-param name=
"this-p" select=
"3"/>
469 <!-- 4.4.3.17 forall -->
470 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:forall]]">
472 <mml:mi>∀<!--forall--></mml:mi>
473 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
476 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
483 <!-- 4.4.3.18 exists -->
484 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:exists]]">
486 <mml:mi>∃<!--exists--></mml:mi>
487 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
490 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
496 <!-- 4.4.3.19 abs -->
497 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:abs]]">
500 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
507 <!-- 4.4.3.20 conjugate -->
508 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:conjugate]]">
510 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
511 <mml:mo>¯<!-- overline --></mml:mo>
515 <!-- 4.4.3.21 arg -->
516 <xsl:template mode=
"c2p" match=
"mml:arg">
521 <!-- 4.4.3.22 real -->
522 <xsl:template mode=
"c2p" match=
"mml:real">
523 <mml:mo>ℛ<!-- real --></mml:mo>
526 <!-- 4.4.3.23 imaginary -->
527 <xsl:template mode=
"c2p" match=
"mml:imaginary">
528 <mml:mo>ℑ<!-- imaginary --></mml:mo>
531 <!-- 4.4.3.24 lcm -->
532 <xsl:template mode=
"c2p" match=
"mml:lcm">
537 <!-- 4.4.3.25 floor -->
538 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:floor]]">
540 <mml:mo>⌊<!-- lfloor--></mml:mo>
541 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
542 <mml:mo>⌋<!-- rfloor--></mml:mo>
547 <!-- 4.4.3.25 ceiling -->
548 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:ceiling]]">
550 <mml:mo>⌈<!-- lceil--></mml:mo>
551 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
552 <mml:mo>⌉<!-- rceil--></mml:mo>
557 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:eq]]">
558 <xsl:param name=
"p" select=
"0"/>
559 <xsl:call-template name=
"infix">
560 <xsl:with-param name=
"this-p" select=
"1"/>
561 <xsl:with-param name=
"p" select=
"$p"/>
562 <xsl:with-param name=
"mo"><mml:mo>=
</mml:mo></xsl:with-param>
567 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:neq]]">
568 <xsl:param name=
"p" select=
"0"/>
569 <xsl:call-template name=
"infix">
570 <xsl:with-param name=
"this-p" select=
"1"/>
571 <xsl:with-param name=
"p" select=
"$p"/>
572 <xsl:with-param name=
"mo"><mml:mo>≠<!-- neq --></mml:mo></xsl:with-param>
577 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:gt]]">
578 <xsl:param name=
"p" select=
"0"/>
579 <xsl:call-template name=
"infix">
580 <xsl:with-param name=
"this-p" select=
"1"/>
581 <xsl:with-param name=
"p" select=
"$p"/>
582 <xsl:with-param name=
"mo"><mml:mo>></mml:mo></xsl:with-param>
587 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:lt]]">
588 <xsl:param name=
"p" select=
"0"/>
589 <xsl:call-template name=
"infix">
590 <xsl:with-param name=
"this-p" select=
"1"/>
591 <xsl:with-param name=
"p" select=
"$p"/>
592 <xsl:with-param name=
"mo"><mml:mo><</mml:mo></xsl:with-param>
597 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:geq]]">
598 <xsl:param name=
"p" select=
"0"/>
599 <xsl:call-template name=
"infix">
600 <xsl:with-param name=
"this-p" select=
"1"/>
601 <xsl:with-param name=
"p" select=
"$p"/>
602 <xsl:with-param name=
"mo"><mml:mo>≥</mml:mo></xsl:with-param>
607 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:leq]]">
608 <xsl:param name=
"p" select=
"0"/>
609 <xsl:call-template name=
"infix">
610 <xsl:with-param name=
"this-p" select=
"1"/>
611 <xsl:with-param name=
"p" select=
"$p"/>
612 <xsl:with-param name=
"mo"><mml:mo>≤</mml:mo></xsl:with-param>
616 <!-- 4.4.4.7 equivalent -->
617 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:equivalent]]">
618 <xsl:param name=
"p" select=
"0"/>
619 <xsl:call-template name=
"infix">
620 <xsl:with-param name=
"this-p" select=
"1"/>
621 <xsl:with-param name=
"p" select=
"$p"/>
622 <xsl:with-param name=
"mo"><mml:mo>≡</mml:mo></xsl:with-param>
626 <!-- 4.4.4.8 approx -->
627 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:approx]]">
628 <xsl:param name=
"p" select=
"0"/>
629 <xsl:call-template name=
"infix">
630 <xsl:with-param name=
"this-p" select=
"1"/>
631 <xsl:with-param name=
"p" select=
"$p"/>
632 <xsl:with-param name=
"mo"><mml:mo>≃</mml:mo></xsl:with-param>
637 <!-- 4.4.4.9 factorof -->
638 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:factorof]]">
639 <xsl:param name=
"p" select=
"0"/>
640 <xsl:call-template name=
"binary">
641 <xsl:with-param name=
"mo"><mml:mo>|
</mml:mo></xsl:with-param>
642 <xsl:with-param name=
"p" select=
"$p"/>
643 <xsl:with-param name=
"this-p" select=
"3"/>
648 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:int]]">
651 <mml:mi>∫<!--int--></mml:mi>
652 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
653 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
655 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
656 <mml:mo>d
</mml:mo><xsl:apply-templates mode=
"c2p" select=
"mml:bvar"/>
660 <!-- 4.4.5.2 diff -->
661 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:diff] and mml:ci and count(*)=2]" priority=
"2">
663 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"*[2]"/></mml:mrow>
664 <mml:mo>′<!--prime--></mml:mo>
668 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:diff]]" priority=
"1">
671 <xsl:when test=
"mml:bvar/mml:degree">
672 <mml:mrow><mml:msup><mml:mo>d
</mml:mo><xsl:apply-templates mode=
"c2p" select=
"mml:bvar/mml:degree/node()"/></mml:msup>
673 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/></mml:mrow>
674 <mml:mrow><mml:mo>d
</mml:mo><mml:msup><xsl:apply-templates mode=
"c2p"
675 select=
"mml:bvar/node()"/><xsl:apply-templates mode=
"c2p"
676 select=
"mml:bvar/mml:degree/node()"/></mml:msup>
680 <mml:mrow><mml:mo>d
</mml:mo><xsl:apply-templates mode=
"c2p" select=
"*[last()]"/></mml:mrow>
681 <mml:mrow><mml:mo>d
</mml:mo><xsl:apply-templates mode=
"c2p" select=
"mml:bvar"/></mml:mrow>
688 <!-- 4.4.5.3 partialdiff -->
689 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:partialdiff] and mml:list and mml:ci and count(*)=3]" priority=
"2">
691 <mml:msub><mml:mo>D
</mml:mo><mml:mrow>
692 <xsl:for-each select=
"mml:list[1]/*">
693 <xsl:apply-templates mode=
"c2p" select=
"."/>
694 <xsl:if test=
"position()<last()"><mml:mo>,
</mml:mo></xsl:if>
696 </mml:mrow></mml:msub>
697 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"*[3]"/></mml:mrow>
701 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:partialdiff]]" priority=
"1">
703 <mml:mrow><mml:msup><mml:mo>∂<!-- partial --></mml:mo>
706 <xsl:when test=
"mml:degree">
707 <xsl:apply-templates mode=
"c2p" select=
"mml:degree/node()"/>
709 <xsl:when test=
"mml:bvar/mml:degree[string(number(.))='NaN']">
710 <xsl:for-each select=
"mml:bvar/mml:degree">
711 <xsl:apply-templates mode=
"c2p" select=
"node()"/>
712 <xsl:if test=
"position()<last()"><mml:mo>+
</mml:mo></xsl:if>
714 <xsl:if test=
"count(mml:bvar[not(mml:degree)])>0">
715 <mml:mo>+
</mml:mo><mml:mn><xsl:value-of select=
"count(mml:bvar[not(mml:degree)])"/></mml:mn>
719 <mml:mn><xsl:value-of select=
"sum(mml:bvar/mml:degree)+count(mml:bvar[not(mml:degree)])"/></mml:mn>
724 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/></mml:mrow>
726 <xsl:for-each select=
"mml:bvar">
728 <mml:mo>∂<!-- partial --></mml:mo><mml:msup><xsl:apply-templates mode=
"c2p" select=
"node()"/>
729 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:degree/node()"/></mml:mrow>
737 <!-- 4.4.5.4 lowlimit-->
738 <xsl:template mode=
"c2p" match=
"mml:lowlimit"/>
740 <!-- 4.4.5.5 uplimit-->
741 <xsl:template mode=
"c2p" match=
"mml:uplimit"/>
744 <xsl:template mode=
"c2p" match=
"mml:bvar">
745 <mml:mi><xsl:apply-templates mode=
"c2p"/></mml:mi>
746 <xsl:if test=
"following-sibling::mml:bvar"><mml:mo>,
</mml:mo></xsl:if>
749 <!-- 4.4.5.7 degree-->
750 <xsl:template mode=
"c2p" match=
"mml:degree"/>
752 <!-- 4.4.5.8 divergence-->
753 <xsl:template mode=
"c2p" match=
"mml:divergence">
758 <xsl:template mode=
"c2p" match=
"mml:grad">
759 <mml:mo>grad
</mml:mo>
762 <!-- 4.4.5.10 curl -->
763 <xsl:template mode=
"c2p" match=
"mml:curl">
764 <mml:mo>curl
</mml:mo>
768 <!-- 4.4.5.11 laplacian-->
769 <xsl:template mode=
"c2p" match=
"mml:laplacian">
770 <mml:msup><mml:mo>∇<!-- nabla --></mml:mo><mml:mn>2</mml:mn></mml:msup>
775 <xsl:template mode=
"c2p" match=
"mml:set">
776 <xsl:call-template name=
"set"/>
779 <!-- 4.4.6.2 list -->
781 <xsl:template mode=
"c2p" match=
"mml:list">
782 <xsl:call-template name=
"set">
783 <xsl:with-param name=
"o" select=
"'('"/>
784 <xsl:with-param name=
"c" select=
"')'"/>
788 <!-- 4.4.6.3 union -->
789 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:union]]">
790 <xsl:param name=
"p" select=
"0"/>
791 <xsl:call-template name=
"infix">
792 <xsl:with-param name=
"this-p" select=
"2"/>
793 <xsl:with-param name=
"p" select=
"$p"/>
794 <xsl:with-param name=
"mo"><mml:mo>∪<!-- union --></mml:mo></xsl:with-param>
798 <!-- 4.4.6.4 intersect -->
799 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:intersect]]">
800 <xsl:param name=
"p" select=
"0"/>
801 <xsl:call-template name=
"infix">
802 <xsl:with-param name=
"this-p" select=
"3"/>
803 <xsl:with-param name=
"p" select=
"$p"/>
804 <xsl:with-param name=
"mo"><mml:mo>∩<!-- intersect --></mml:mo></xsl:with-param>
809 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:in]]">
810 <xsl:param name=
"p" select=
"0"/>
811 <xsl:call-template name=
"binary">
812 <xsl:with-param name=
"mo"><mml:mo>∈<!-- in --></mml:mo></xsl:with-param>
813 <xsl:with-param name=
"p" select=
"$p"/>
814 <xsl:with-param name=
"this-p" select=
"3"/>
818 <!-- 4.4.6.5 notin -->
819 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:notin]]">
820 <xsl:param name=
"p" select=
"0"/>
821 <xsl:call-template name=
"binary">
822 <xsl:with-param name=
"mo"><mml:mo>∉<!-- not in --></mml:mo></xsl:with-param>
823 <xsl:with-param name=
"p" select=
"$p"/>
824 <xsl:with-param name=
"this-p" select=
"3"/>
828 <!-- 4.4.6.7 subset -->
829 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:subset]]">
830 <xsl:param name=
"p" select=
"0"/>
831 <xsl:call-template name=
"infix">
832 <xsl:with-param name=
"this-p" select=
"2"/>
833 <xsl:with-param name=
"p" select=
"$p"/>
834 <xsl:with-param name=
"mo"><mml:mo>⊆<!-- subseteq --></mml:mo></xsl:with-param>
838 <!-- 4.4.6.8 prsubset -->
839 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:prsubset]]">
840 <xsl:param name=
"p" select=
"0"/>
841 <xsl:call-template name=
"infix">
842 <xsl:with-param name=
"this-p" select=
"2"/>
843 <xsl:with-param name=
"p" select=
"$p"/>
844 <xsl:with-param name=
"mo"><mml:mo>⊂<!-- prsubset --></mml:mo></xsl:with-param>
848 <!-- 4.4.6.9 notsubset -->
849 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:notsubset]]">
850 <xsl:param name=
"p" select=
"0"/>
851 <xsl:call-template name=
"binary">
852 <xsl:with-param name=
"this-p" select=
"2"/>
853 <xsl:with-param name=
"p" select=
"$p"/>
854 <xsl:with-param name=
"mo"><mml:mo>⊈<!-- notsubseteq --></mml:mo></xsl:with-param>
858 <!-- 4.4.6.10 notprsubset -->
859 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:notprsubset]]">
860 <xsl:param name=
"p" select=
"0"/>
861 <xsl:call-template name=
"binary">
862 <xsl:with-param name=
"this-p" select=
"2"/>
863 <xsl:with-param name=
"p" select=
"$p"/>
864 <xsl:with-param name=
"mo"><mml:mo>⊄<!-- prsubset --></mml:mo></xsl:with-param>
868 <!-- 4.4.6.11 setdiff -->
869 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:setdiff]]">
870 <xsl:param name=
"p" select=
"0"/>
871 <xsl:call-template name=
"binary">
872 <xsl:with-param name=
"this-p" select=
"2"/>
873 <xsl:with-param name=
"p" select=
"$p"/>
874 <xsl:with-param name=
"mo"><mml:mo>∖<!-- setminus --></mml:mo></xsl:with-param>
878 <!-- 4.4.6.12 card -->
879 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:card]]">
882 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
887 <!-- 4.4.6.13 cartesianproduct -->
888 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:cartesianproduct or self::mml:vectorproduct]]">
889 <xsl:param name=
"p" select=
"0"/>
890 <xsl:call-template name=
"infix">
891 <xsl:with-param name=
"this-p" select=
"2"/>
892 <xsl:with-param name=
"p" select=
"$p"/>
893 <xsl:with-param name=
"mo"><mml:mo>×<!-- times --></mml:mo></xsl:with-param>
898 match=
"mml:apply[*[1][self::mml:cartesianproduct][count(following-sibling::mml:reals)=count(following-sibling::*)]]"
901 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
902 <xsl:with-param name=
"p" select=
"5"/>
903 </xsl:apply-templates>
904 <mml:mn><xsl:value-of select=
"count(*)-1"/></mml:mn>
910 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:sum]]">
913 <mml:mo>∑<!--sum--></mml:mo>
914 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
915 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
917 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
921 <!-- 4.4.7.2 product -->
922 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:product]]">
925 <mml:mo>∏<!--product--></mml:mo>
926 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
927 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
929 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
933 <!-- 4.4.7.3 limit -->
934 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:limit]]">
937 <mml:mi>limit
</mml:mi>
938 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:lowlimit|mml:condition/*"/></mml:mrow>
940 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
944 <xsl:template mode=
"c2p" match=
"mml:apply[mml:limit]/mml:lowlimit" priority=
"3">
946 <xsl:apply-templates mode=
"c2p" select=
"../mml:bvar/node()"/>
947 <mml:mo>→<!--rightarrow--></mml:mo>
948 <xsl:apply-templates mode=
"c2p"/>
953 <!-- 4.4.7.4 tendsto -->
954 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:tendsto]]">
955 <xsl:param name=
"p"/>
956 <xsl:call-template name=
"binary">
957 <xsl:with-param name=
"this-p" select=
"2"/>
958 <xsl:with-param name=
"p" select=
"$p"/>
959 <xsl:with-param name=
"mo"><mml:mo>
961 <xsl:when test=
"@type='above'">↘<!--searrow--></xsl:when>
962 <xsl:when test=
"@type='below'">↗<!--nearrow--></xsl:when>
963 <xsl:when test=
"@type='two-sided'">→<!--rightarrow--></xsl:when>
964 <xsl:otherwise>→<!--rightarrow--></xsl:otherwise>
966 </mml:mo></xsl:with-param>
970 <!-- 4.4.8.1 trig -->
971 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][
972 self::mml:sin or self::mml:cos or self::mml:tan or self::mml:sec or
973 self::mml:csc or self::mml:cot or self::mml:sinh or self::mml:cosh or
974 self::mml:tanh or self::mml:sech or self::mml:csch or self::mml:coth or
975 self::mml:arcsin or self::mml:arccos or self::mml:arctan or self::mml:arccosh
976 or self::mml:arccot or self::mml:arccoth or self::mml:arccsc or
977 self::mml:arccsch or self::mml:arcsec or self::mml:arcsech or
978 self::mml:arcsinh or self::mml:arctanh or self::mml:ln]]">
980 <mml:mi><xsl:value-of select=
"local-name(*[1])"/></mml:mi>
981 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
982 <xsl:with-param name=
"p" select=
"7"/>
983 </xsl:apply-templates>
991 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:exp]]">
993 <mml:mi>e
<!-- exponential e--></mml:mi>
994 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"*[2]"/></mml:mrow>
1001 <!-- 4.4.8.4 log -->
1002 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:log]]">
1005 <xsl:when test=
"not(mml:logbase) or mml:logbase=10">
1006 <mml:mi>log
</mml:mi>
1010 <mml:mi>log
</mml:mi>
1011 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:logbase/node()"/></mml:mrow>
1015 <xsl:apply-templates mode=
"c2p" select=
"*[last()]">
1016 <xsl:with-param name=
"p" select=
"7"/>
1017 </xsl:apply-templates>
1022 <!-- 4.4.9.1 mean -->
1023 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:mean]]">
1025 <mml:mo>〈<!--langle--></mml:mo>
1026 <xsl:for-each select=
"*[position()>1]">
1027 <xsl:apply-templates mode=
"c2p" select=
"."/>
1028 <xsl:if test=
"position() !=last()"><mml:mo>,
</mml:mo></xsl:if>
1030 <mml:mo>〉<!--rangle--></mml:mo>
1035 <!-- 4.4.9.2 sdef -->
1036 <xsl:template mode=
"c2p" match=
"mml:sdev">
1037 <mml:mo>σ<!--sigma--></mml:mo>
1040 <!-- 4.4.9.3 variance -->
1041 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:variance]]">
1044 <mml:mo>σ<!--sigma--></mml:mo>
1046 <xsl:apply-templates mode=
"c2p" select=
"*[2]"/>
1054 <!-- 4.4.9.4 median -->
1055 <xsl:template mode=
"c2p" match=
"mml:median">
1056 <mml:mo>median
</mml:mo>
1060 <!-- 4.4.9.5 mode -->
1061 <xsl:template mode=
"c2p" match=
"mml:mode">
1062 <mml:mo>mode
</mml:mo>
1065 <!-- 4.4.9.5 moment -->
1066 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:moment]]">
1068 <mml:mo>〈<!--langle--></mml:mo>
1070 <xsl:apply-templates mode=
"c2p" select=
"*[last()]"/>
1071 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:degree/node()"/></mml:mrow>
1073 <mml:mo>〉<!--rangle--></mml:mo>
1077 <!-- 4.4.9.5 momentabout -->
1078 <xsl:template mode=
"c2p" match=
"mml:momentabout"/>
1080 <!-- 4.4.10.1 vector -->
1081 <xsl:template mode=
"c2p" match=
"mml:vector">
1085 <xsl:for-each select=
"*">
1086 <mml:mtr><mml:mtd><xsl:apply-templates mode=
"c2p" select=
"."/></mml:mtd></mml:mtr>
1093 <!-- 4.4.10.2 matrix -->
1094 <xsl:template mode=
"c2p" match=
"mml:matrix">
1098 <xsl:apply-templates mode=
"c2p"/>
1104 <!-- 4.4.10.3 matrixrow -->
1105 <xsl:template mode=
"c2p" match=
"mml:matrixrow">
1107 <xsl:for-each select=
"*">
1108 <mml:mtd><xsl:apply-templates mode=
"c2p" select=
"."/></mml:mtd>
1113 <!-- 4.4.10.4 determinant -->
1114 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:determinant]]">
1116 <mml:mi>det
</mml:mi>
1117 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
1118 <xsl:with-param name=
"p" select=
"7"/>
1119 </xsl:apply-templates>
1124 match=
"mml:apply[*[1][self::mml:determinant]][*[2][self::mml:matrix]]" priority=
"2">
1128 <xsl:apply-templates mode=
"c2p" select=
"mml:matrix/*"/>
1134 <!-- 4.4.10.5 transpose -->
1135 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:transpose]]">
1137 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
1138 <xsl:with-param name=
"p" select=
"7"/>
1139 </xsl:apply-templates>
1144 <!-- 4.4.10.5 selector -->
1145 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:selector]]">
1147 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
1148 <xsl:with-param name=
"p" select=
"7"/>
1149 </xsl:apply-templates>
1151 <xsl:for-each select=
"*[position()>2]">
1152 <xsl:apply-templates mode=
"c2p" select=
"."/>
1153 <xsl:if test=
"position() !=last()"><mml:mo>,
</mml:mo></xsl:if>
1160 <!-- 4.4.10.6 vectorproduct see cartesianproduct -->
1163 <!-- 4.4.10.7 scalarproduct-->
1164 <xsl:template mode=
"c2p" match=
"mml:apply[*[1][self::mml:scalarproduct or self::mml:outerproduct]]">
1165 <xsl:param name=
"p" select=
"0"/>
1166 <xsl:call-template name=
"infix">
1167 <xsl:with-param name=
"this-p" select=
"2"/>
1168 <xsl:with-param name=
"p" select=
"$p"/>
1169 <xsl:with-param name=
"mo"><mml:mo>.
</mml:mo></xsl:with-param>
1170 </xsl:call-template>
1173 <!-- 4.4.10.8 outerproduct-->
1175 <!-- 4.4.11.2 semantics -->
1176 <xsl:template mode=
"c2p" match=
"mml:semantics">
1177 <xsl:apply-templates mode=
"c2p" select=
"*[1]"/>
1179 <xsl:template mode=
"c2p" match=
"mml:semantics[mml:annotation-xml/@encoding='MathML-Presentation']">
1180 <xsl:apply-templates mode=
"c2p" select=
"mml:annotation-xml[@encoding='MathML-Presentation']/node()"/>
1183 <!-- 4.4.12.1 integers -->
1184 <xsl:template mode=
"c2p" match=
"mml:integers">
1185 <mml:mi mathvariant=
"double-struck">Z
</mml:mi>
1188 <!-- 4.4.12.2 reals -->
1189 <xsl:template mode=
"c2p" match=
"mml:reals">
1190 <mml:mi mathvariant=
"double-struck">R
</mml:mi>
1193 <!-- 4.4.12.3 rationals -->
1194 <xsl:template mode=
"c2p" match=
"mml:rationals">
1195 <mml:mi mathvariant=
"double-struck">Q
</mml:mi>
1198 <!-- 4.4.12.4 naturalnumbers -->
1199 <xsl:template mode=
"c2p" match=
"mml:naturalnumbers">
1200 <mml:mi mathvariant=
"double-struck">N
</mml:mi>
1203 <!-- 4.4.12.5 complexes -->
1204 <xsl:template mode=
"c2p" match=
"mml:complexes">
1205 <mml:mi mathvariant=
"double-struck">C
</mml:mi>
1208 <!-- 4.4.12.6 primes -->
1209 <xsl:template mode=
"c2p" match=
"mml:primes">
1210 <mml:mi mathvariant=
"double-struck">P
</mml:mi>
1213 <!-- 4.4.12.7 exponentiale -->
1214 <xsl:template mode=
"c2p" match=
"mml:exponentiale">
1215 <mml:mi>e
<!-- exponential e--></mml:mi>
1218 <!-- 4.4.12.8 imaginaryi -->
1219 <xsl:template mode=
"c2p" match=
"mml:imaginaryi">
1220 <mml:mi>i
<!-- imaginary i--></mml:mi>
1223 <!-- 4.4.12.9 notanumber -->
1224 <xsl:template mode=
"c2p" match=
"mml:notanumber">
1225 <mml:mi>NaN
</mml:mi>
1228 <!-- 4.4.12.10 true -->
1229 <xsl:template mode=
"c2p" match=
"mml:true">
1230 <mml:mi>true
</mml:mi>
1233 <!-- 4.4.12.11 false -->
1234 <xsl:template mode=
"c2p" match=
"mml:false">
1235 <mml:mi>false
</mml:mi>
1238 <!-- 4.4.12.12 emptyset -->
1239 <xsl:template mode=
"c2p" match=
"mml:emptyset">
1240 <mml:mi>∅<!-- emptyset --></mml:mi>
1244 <!-- 4.4.12.13 pi -->
1245 <xsl:template mode=
"c2p" match=
"mml:pi">
1246 <mml:mi>π<!-- pi --></mml:mi>
1249 <!-- 4.4.12.14 eulergamma -->
1250 <xsl:template mode=
"c2p" match=
"mml:eulergamma">
1251 <mml:mi>γ<!-- gamma --></mml:mi>
1254 <!-- 4.4.12.15 infinity -->
1255 <xsl:template mode=
"c2p" match=
"mml:infinity">
1256 <mml:mi>∞<!-- infinity --></mml:mi>
1260 <!-- ****************************** -->
1261 <xsl:template name=
"infix" >
1262 <xsl:param name=
"mo"/>
1263 <xsl:param name=
"p" select=
"0"/>
1264 <xsl:param name=
"this-p" select=
"0"/>
1266 <xsl:if test=
"$this-p < $p"><mml:mo>(
</mml:mo></xsl:if>
1267 <xsl:for-each select=
"*[position()>1]">
1268 <xsl:if test=
"position() > 1">
1269 <xsl:copy-of select=
"$mo"/>
1271 <xsl:apply-templates mode=
"c2p" select=
".">
1272 <xsl:with-param name=
"p" select=
"$this-p"/>
1273 </xsl:apply-templates>
1275 <xsl:if test=
"$this-p < $p"><mml:mo>)
</mml:mo></xsl:if>
1279 <xsl:template name=
"binary" >
1280 <xsl:param name=
"mo"/>
1281 <xsl:param name=
"p" select=
"0"/>
1282 <xsl:param name=
"this-p" select=
"0"/>
1284 <xsl:if test=
"$this-p < $p"><mml:mo>(
</mml:mo></xsl:if>
1285 <xsl:apply-templates mode=
"c2p" select=
"*[2]">
1286 <xsl:with-param name=
"p" select=
"$this-p"/>
1287 </xsl:apply-templates>
1288 <xsl:copy-of select=
"$mo"/>
1289 <xsl:apply-templates mode=
"c2p" select=
"*[3]">
1290 <xsl:with-param name=
"p" select=
"$this-p"/>
1291 </xsl:apply-templates>
1292 <xsl:if test=
"$this-p < $p"><mml:mo>)
</mml:mo></xsl:if>
1296 <xsl:template name=
"set" >
1297 <xsl:param name=
"o" select=
"'{'"/>
1298 <xsl:param name=
"c" select=
"'}'"/>
1300 <mml:mo><xsl:value-of select=
"$o"/></mml:mo>
1302 <xsl:when test=
"mml:condition">
1303 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:bvar/*[not(self::bvar or self::condition)]"/></mml:mrow>
1305 <mml:mrow><xsl:apply-templates mode=
"c2p" select=
"mml:condition/node()"/></mml:mrow>
1308 <xsl:for-each select=
"*">
1309 <xsl:apply-templates mode=
"c2p" select=
"."/>
1310 <xsl:if test=
"position() !=last()"><mml:mo>,
</mml:mo></xsl:if>
1314 <mml:mo><xsl:value-of select=
"$c"/></mml:mo>