3 <!-- ====================================================== -->
4 <!-- XSL Transform of MathML content to MathML presentation -->
5 <!-- By Igor Rodionov, Computer Science Department of -->
6 <!-- the University of Western Ontario, London, Canada -->
7 <!-- Complies with the W3C Working Draft from Dec.3, 1999 -->
8 <!-- Version x.xx from Feb. 18, 2000 -->
9 <!-- Comments to: igor@csd.uwo.ca -->
11 <!-- (C) Copyright 1999, 2000 Symbolic Computation -->
12 <!-- Laboratory, University of Western Ontario. -->
13 <!-- ====================================================== -->
15 <!-- ====================================================== -->
16 <!-- May 11, 2000 - HELM group: -->
17 <!-- Added the namespace prefix to all the output elements -->
18 <!-- Changed the mml prefix into m -->
19 <!-- Swapped math element out of the semantic element -->
20 <!-- Added the declaration of the xlink namespace -->
21 <!-- ====================================================== -->
23 <!-- ====================================================== -->
24 <!-- June, 2000 - HELM group: -->
25 <!-- Added auxiliary function to insert: -->
26 <!-- 1) backwards pointers: helm:xref -->
27 <!-- 2) references to definitions: xlink:href -->
28 <!-- Added call-templates to the functions: -->
29 <!-- insert_xref, insert, insert1, insert2 -->
30 <!-- ====================================================== -->
33 <!-- HELM: namespace helm added -->
34 <xsl:stylesheet id="mml2mml"
36 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
37 xmlns:m="http://www.w3.org/1998/Math/MathML"
38 xmlns:xlink="http://www.w3.org/1999/xlink"
39 xmlns:helm="http://www.cs.unibo.it/helm">
41 <xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>
43 <!-- ***************************************************** -->
44 <!-- Parameters affectin' stylesheet's run-time behavior -->
45 <!-- ***************************************************** -->
47 <!-- SEM_SW: -1 - strip off all semantics
48 0 - pass semantics "as is" (default)
49 1 - add semantics at top level only
50 2 - add semantics at all levels
51 3 - semantics at top level with cross-references
53 <!-- HELM: SEM_SW was 0 -->
54 <xsl:param name="SEM_SW" select="1"/>
56 <!-- Miscellaneous Variable Definitions -->
58 <xsl:variable name="NO" select="0"/>
59 <xsl:variable name="YES" select="1"/>
60 <xsl:variable name="PAR_NO" select="-7"/>
61 <xsl:variable name="PAR_YES" select="-5"/>
62 <xsl:variable name="PAR_SAME" select="-3"/>
63 <xsl:variable name="NO_PARAM" select="-1"/>
65 <!-- Operator Precedence Definitions -->
67 <xsl:variable name="NO_PREC" select="0"/>
68 <xsl:variable name="UNION_PREC" select="1"/>
69 <xsl:variable name="SETDIFF_PREC" select="1"/>
70 <xsl:variable name="INTERSECT_PREC" select="3"/>
71 <xsl:variable name="OR_PREC" select="5"/>
72 <xsl:variable name="XOR_PREC" select="5"/>
73 <xsl:variable name="AND_PREC" select="7"/>
74 <xsl:variable name="PLUS_PREC" select="9"/>
75 <xsl:variable name="MINUS_PREC" select="9"/>
76 <xsl:variable name="MUL_PREC" select="11"/>
77 <xsl:variable name="DIV_PREC" select="11"/>
78 <xsl:variable name="NEG_PREC" select="13"/>
79 <xsl:variable name="FUNCTION_PREC" select="99"/>
81 <!-- HELM: auxiliary functions for backwards pointers and refs -->
83 <xsl:template name = "insert_xref">
84 <xsl:if test="@helm:xref">
85 <xsl:attribute name="helm:xref">
86 <xsl:value-of select="@helm:xref"/>
91 <xsl:template name = "insert">
92 <xsl:if test="@definitionURL">
93 <xsl:attribute name="xlink:href">
94 <xsl:value-of select="@definitionURL"/>
97 <xsl:if test="@helm:xref">
98 <xsl:attribute name="helm:xref">
99 <xsl:value-of select="@helm:xref"/>
104 <!-- HELM: for use inside m:apply -->
105 <xsl:template name = "insert1">
106 <xsl:if test="*[1]/@definitionURL">
107 <xsl:attribute name="xlink:href">
108 <xsl:value-of select="*[1]/@definitionURL"/>
111 <xsl:if test="*[1]/@helm:xref">
112 <xsl:attribute name="helm:xref">
113 <xsl:value-of select="*[1]/@helm:xref"/>
118 <!-- HELM: for use inside "for-each" -->
119 <xsl:template name = "insert2">
120 <xsl:if test="../*[1]/@definitionURL">
121 <xsl:attribute name="xlink:href">
122 <xsl:value-of select="../*[1]/@definitionURL"/>
125 <xsl:if test="../*[1]/@helm:xref">
126 <xsl:attribute name="helm:xref">
127 <xsl:value-of select="../*[1]/@helm:xref"/>
132 <!-- THE TOPMOST ELEMENT: MATH -->
134 <xsl:template match = "m:math">
136 <xsl:when test="$SEM_SW>0">
137 <!-- HELM: deleted math (we have already inserted at object level) -->
140 <xsl:apply-templates mode = "semantics"/>
141 <m:annotation-xml encoding="MathML">
142 <xsl:copy-of select = "*"/>
149 <xsl:apply-templates mode = "semantics"/>
157 <xsl:template match = "m:*" mode = "semantics">
158 <xsl:param name="IN_PREC" select="$NO_PREC"/>
159 <xsl:param name="PARAM" select="$NO_PARAM"/>
160 <xsl:param name="PAREN" select="$PAR_NO"/>
161 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
163 <xsl:when test="$SEM_SW=-1 and self::m:semantics">
164 <xsl:apply-templates select="*[1]">
165 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
166 <xsl:with-param name="PARAM" select="$PARAM"/>
167 <xsl:with-param name="PAREN" select="$PAREN"/>
168 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
169 </xsl:apply-templates>
171 <xsl:when test="$SEM_SW=0 and self::m:semantics">
173 <xsl:apply-templates select="*[1]">
174 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
175 <xsl:with-param name="PARAM" select="$PARAM"/>
176 <xsl:with-param name="PAREN" select="$PAREN"/>
177 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
178 </xsl:apply-templates>
179 <xsl:copy-of select="m:annotation-xml"/>
182 <xsl:when test="$SEM_SW=2">
185 <xsl:when test="self::m:semantics">
186 <xsl:apply-templates select="*[1]">
187 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
188 <xsl:with-param name="PARAM" select="$PARAM"/>
189 <xsl:with-param name="PAREN" select="$PAREN"/>
190 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
191 </xsl:apply-templates>
192 <xsl:copy-of select="m:annotation-xml"/>
195 <xsl:apply-templates select=".">
196 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
197 <xsl:with-param name="PARAM" select="$PARAM"/>
198 <xsl:with-param name="PAREN" select="$PAREN"/>
199 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
200 </xsl:apply-templates>
201 <m:annotation-xml encoding="MathML">
202 <xsl:copy-of select="."/>
208 <xsl:when test="$SEM_SW=3 and @id">
209 <m:mrow idref="{@id}">
210 <xsl:apply-templates select=".">
211 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
212 <xsl:with-param name="PARAM" select="$PARAM"/>
213 <xsl:with-param name="PAREN" select="$PAREN"/>
214 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
215 </xsl:apply-templates>
219 <xsl:apply-templates select=".">
220 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
221 <xsl:with-param name="PARAM" select="$PARAM"/>
222 <xsl:with-param name="PAREN" select="$PAREN"/>
223 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
224 </xsl:apply-templates>
229 <xsl:template match = "m:semantics">
230 <xsl:apply-templates select="*[1]" mode = "semantics"/>
234 <!-- BASIC ELEMENTS -->
236 <!-- HELM: cn could not contain MAthMl presentation -->
237 <xsl:template match = "m:cn">
238 <xsl:param name="IN_PREC" select="$NO_PREC"/>
239 <xsl:param name="PAREN" select="$PAR_NO"/>
240 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
243 <xsl:when test="child::text()">
246 <xsl:when test=". < 0 and $IN_PREC > 0 and $PAREN=$PAR_NO and $PAR_NO_IGNORE=$NO">
247 <m:mfenced separators="">
248 <xsl:apply-templates select="." mode="cn"/>
252 <xsl:apply-templates select="." mode="cn"/>
258 <xsl:copy-of select="*"/>
264 <xsl:template match = "m:cn" mode="cn">
266 <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
268 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
269 <m:mn> <xsl:value-of select="@base"/> </m:mn>
272 <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
273 <m:mfenced separators="">
274 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
275 <xsl:if test="text()[2] < 0">
277 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
279 <xsl:if test="not(text()[2] < 0)">
281 <xsl:apply-templates select="text()[2]" mode = "semantics"/>
283 <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
287 <xsl:when test="@type='complex' and @base and child::m:sep[1]">
289 <m:mfenced separators="">
290 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
291 <xsl:if test="text()[2] < 0">
293 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
295 <xsl:if test="not(text()[2] < 0)">
297 <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
299 <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
302 <m:mn> <xsl:value-of select="@base"/> </m:mn>
305 <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
307 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
309 <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
312 <xsl:when test="@type='rational' and @base and child::m:sep[1]">
314 <m:mfenced separators="">
315 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
317 <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
319 <m:mn> <xsl:value-of select="@base"/> </m:mn>
322 <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
325 <m:mfenced separators=",">
326 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
327 <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
331 <xsl:when test="@type='polar' and @base and child::m:sep[1]">
335 <m:mfenced separators=",">
336 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
337 <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
340 <m:mn> <xsl:value-of select="@base"/> </m:mn>
345 <xsl:call-template name="insert"/>
346 <xsl:apply-templates mode = "semantics"/>
352 <xsl:template match = "m:ci">
354 <xsl:when test="@type='vector' or @type=matrix or @type=set">
355 <m:mi fontweight="bold"> <xsl:apply-templates mode = "semantics"/> </m:mi>
358 <!-- HELM: ci could not contain MathML presentation
360 <xsl:call-template name="insert"/>
361 <xsl:apply-templates mode = "semantics"/>
365 <!-- HELM: or the opposite test <xsl:when test="*[1]"> -->
366 <xsl:when test="child::text()">
368 <xsl:call-template name="insert"/>
369 <xsl:apply-templates mode = "semantics"/>
374 <xsl:call-template name="insert"/>
375 <xsl:copy-of select="*"/>
384 <xsl:template match = "m:csymbol">
386 <xsl:when test="*[1]">
387 <xsl:copy-of select = "*"/>
390 <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
396 <!-- BASIC CONTENT ELEMENTS -->
398 <xsl:template match = "m:apply[m:fn[1]]">
400 <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
401 <m:mfenced separators=",">
402 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
407 <xsl:template match = "m:fn">
408 <xsl:apply-templates select = "*[1]" mode = "semantics">
409 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
410 </xsl:apply-templates>
413 <xsl:template match = "m:interval">
415 <xsl:when test="@closure='closed'">
416 <m:mfenced open="[" close="]" separators=",">
417 <xsl:apply-templates mode = "semantics"/>
420 <xsl:when test="@closure='open'">
421 <m:mfenced separators=",">
422 <xsl:apply-templates mode = "semantics"/>
425 <xsl:when test="@closure='open-closed'">
426 <m:mfenced open="(" close="]" separators=",">
427 <xsl:apply-templates mode = "semantics"/>
430 <xsl:when test="@closure='closed-open'">
431 <m:mfenced open="[" close=")" separators=",">
432 <xsl:apply-templates mode = "semantics"/>
436 <m:mfenced open="[" close="]" separators=",">
437 <xsl:apply-templates mode = "semantics"/>
443 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
445 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
446 <m:mfenced separators=",">
447 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
452 <!-- HELM: these "semantical" Transformations are REALLY questionable.
455 <xsl:template match = "m:apply[*[1][self::m:inverse]]">
457 <xsl:when test="*[2]=m:exp">
460 <xsl:when test="*[2]=m:ln | m:log">
463 <xsl:when test="*[2]=m:sin">
466 <xsl:when test="*[2]=m:cos">
469 <xsl:when test="*[2]=m:tan">
472 <xsl:when test="*[2]=m:sec">
475 <xsl:when test="*[2]=m:csc">
478 <xsl:when test="*[2]=m:cot">
481 <xsl:when test="*[2]=m:sinh">
484 <xsl:when test="*[2]=m:cosh">
487 <xsl:when test="*[2]=m:tanh">
490 <xsl:when test="*[2]=m:sech">
493 <xsl:when test="*[2]=m:csch">
496 <xsl:when test="*[2]=m:coth">
499 <xsl:when test="*[2]=m:arcsin">
502 <xsl:when test="*[2]=m:arccos">
505 <xsl:when test="*[2]=m:arctan">
510 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
519 <xsl:template match = "m:sep"/>
521 <xsl:template match = "m:condition">
523 <xsl:when test="parent::m:apply[m:forall[1]]"/>
525 <xsl:if test="not(*[2])">
526 <xsl:apply-templates mode = "semantics"/>
530 <xsl:apply-templates mode = "semantics"/>
537 <xsl:template match = "m:declare"/>
539 <xsl:template match = "m:lambda">
541 <m:mo> Λ </m:mo>
542 <m:mfenced separators=",">
543 <xsl:for-each select = "*">
545 <xsl:when test="self::m:ci or self::m:cn">
546 <xsl:apply-templates select = "." mode="semantics"/>
550 <xsl:apply-templates select = "." mode="semantics"/>
559 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:compose[1]]]]">
561 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
562 <m:mfenced separators=",">
563 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
568 <xsl:template match = "m:apply[*[1][self::m:compose]]">
569 <m:mfenced separators="">
570 <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] | self::m:fn]" mode="semantics"/>
571 <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] | self::m:fn]">
572 <m:mo> <xsl:call-template name="insert2"/> <mchar name="SmallCircle"/> </m:mo>
573 <xsl:apply-templates select = "." mode="semantics"/>
578 <xsl:template match = "m:ident">
583 <!-- ARITHMETIC, ALGEBRA & LOGIC -->
585 <xsl:template match = "m:apply[m:quotient[1]]">
586 <m:mfenced open="⌊" close="⌋" separators="">
587 <xsl:call-template name="insert_xref"/>
588 <xsl:apply-templates select="*[2]" mode = "semantics">
589 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
590 </xsl:apply-templates>
591 <m:mo><xsl:call-template name="insert1"/>/</m:mo>
592 <xsl:apply-templates select="*[3]" mode = "semantics">
593 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
594 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
595 </xsl:apply-templates>
599 <xsl:template match = "m:apply[*[1][self::m:exp]]">
602 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
606 <xsl:template match = "m:apply[m:factorial[1]]">
608 <xsl:call-template name="insert_xref"/>
609 <xsl:apply-templates select = "*[2]" mode = "semantics">
610 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
611 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
612 </xsl:apply-templates>
613 <m:mo><xsl:call-template name="insert1"/>!</m:mo>
617 <xsl:template match = "m:apply[m:max[1] | m:min[1]]">
619 <xsl:call-template name="insert_xref"/>
620 <xsl:if test="*[2]=m:bvar">
622 <xsl:if test="*[1]=m:max">
623 <m:mo><xsl:call-template name="insert1"/>max</m:mo>
625 <xsl:if test="*[1]=m:min">
628 <xsl:apply-templates select="*[2]" mode = "semantics"/>
630 <xsl:if test="*[3]=m:condition">
631 <m:mfenced open="{{" close="}}" separators="">
632 <m:mfenced open="" close="" separators=",">
633 <xsl:for-each select = "*[position()>3]">
634 <xsl:apply-templates select = "." mode="semantics"/>
638 <xsl:apply-templates select="*[3]" mode = "semantics"/>
641 <xsl:if test="not(*[3]=m:condition)">
642 <m:mfenced open="{{" close="}}" separators=",">
643 <xsl:for-each select = "*[position()>2]">
644 <xsl:apply-templates select = "." mode="semantics"/>
649 <xsl:if test="*[2]=m:condition">
650 <xsl:if test="*[1]=m:max">
653 <xsl:if test="*[1]=m:min">
656 <m:mfenced open="{{" close="}}" separators="">
658 <m:mfenced open="" close="" separators=",">
659 <xsl:for-each select = "*[position()>2]">
660 <xsl:apply-templates select = "." mode="semantics"/>
665 <xsl:apply-templates select="*[2]" mode = "semantics"/>
668 <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
669 <xsl:if test="*[1]=m:max">
672 <xsl:if test="*[1]=m:min">
673 <m:mo><xsl:call-template name="insert1"/>min</m:mo>
675 <m:mfenced open="{{" close="}}" separators=",">
676 <xsl:for-each select = "*[position()>1]">
677 <xsl:apply-templates select = "." mode="semantics"/>
684 <xsl:template match = "m:apply[m:minus[1]]">
685 <xsl:param name="IN_PREC" select="$NO_PREC"/>
686 <xsl:param name="PARAM" select="$NO_PARAM"/>
687 <xsl:param name="PAREN" select="$PAR_NO"/>
688 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
690 <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME">
691 <m:mfenced separators="">
692 <xsl:call-template name="insert_xref"/>
693 <xsl:apply-templates select="." mode="minus">
694 <xsl:with-param name="PARAM" select="$PARAM"/>
695 <xsl:with-param name="PAREN" select="$PAR_YES"/>
696 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
697 </xsl:apply-templates>
700 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
701 <xsl:apply-templates select="." mode="minus">
702 <xsl:with-param name="PARAM" select="$PARAM"/>
703 <xsl:with-param name="PAREN" select="$PAREN"/>
704 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
705 </xsl:apply-templates>
709 <xsl:call-template name="insert_xref"/>
710 <xsl:apply-templates select="." mode="minus">
711 <xsl:with-param name="PARAM" select="$PARAM"/>
712 <xsl:with-param name="PAREN" select="$PAREN"/>
713 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
714 </xsl:apply-templates>
720 <xsl:template match = "m:apply[m:minus[1]]" mode="minus">
721 <xsl:param name="PARAM" select="$NO_PARAM"/>
722 <xsl:param name="PAREN" select="$PAR_NO"/>
723 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
724 <xsl:if test="not(*[3])">
725 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
726 <xsl:apply-templates select="*[2]" mode = "semantics">
727 <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
728 <xsl:with-param name="PAREN" select="$PAREN"/>
729 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
730 </xsl:apply-templates>
733 <xsl:apply-templates select="*[2]" mode = "semantics">
734 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
735 <xsl:with-param name="PARAM" select="$PARAM"/>
736 <xsl:with-param name="PAREN" select="$PAREN"/>
737 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
738 </xsl:apply-templates>
739 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
740 <xsl:apply-templates select="*[3]" mode = "semantics">
741 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
742 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
743 <xsl:with-param name="PAREN" select="$PAREN"/>
744 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
745 </xsl:apply-templates>
749 <xsl:template match = "m:apply[m:plus[1]]">
750 <xsl:param name="IN_PREC" select="$NO_PREC"/>
751 <xsl:param name="PARAM" select="$NO_PARAM"/>
752 <xsl:param name="PAREN" select="$PAR_NO"/>
753 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
755 <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME">
756 <m:mfenced separators="">
757 <xsl:call-template name="insert_xref"/>
758 <xsl:apply-templates select="." mode="plus">
759 <xsl:with-param name="PARAM" select="$IN_PREC"/>
760 <xsl:with-param name="PAREN" select="$PAR_YES"/>
761 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
762 </xsl:apply-templates>
765 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
766 <xsl:apply-templates select="." mode="plus">
767 <xsl:with-param name="PARAM" select="$PARAM"/>
768 <xsl:with-param name="PAREN" select="$PAREN"/>
769 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
770 </xsl:apply-templates>
774 <xsl:call-template name="insert_xref"/>
775 <xsl:apply-templates select="." mode="plus">
776 <xsl:with-param name="PARAM" select="$IN_PREC"/>
777 <xsl:with-param name="PAREN" select="$PAREN"/>
778 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
779 </xsl:apply-templates>
785 <xsl:template match = "m:apply[m:plus[1]]" mode="plus">
786 <xsl:param name="PARAM" select="$NO_PARAM"/>
787 <xsl:param name="PAREN" select="$PAR_NO"/>
788 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
790 <xsl:apply-templates select="*[2]" mode = "semantics">
791 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
792 <xsl:with-param name="PARAM" select="$PARAM"/>
793 <xsl:with-param name="PAREN" select="$PAREN"/>
794 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
795 </xsl:apply-templates>
796 <xsl:for-each select = "*[position()>2]">
798 <xsl:when test=". < 0">
800 <m:mn> <xsl:value-of select="-."/> </m:mn>
802 <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
803 <xsl:apply-templates select="." mode = "semantics">
804 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
805 <xsl:with-param name="PAREN" select="$PAREN"/>
806 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
807 </xsl:apply-templates>
810 <m:mo><xsl:call-template name="insert2"/>+</m:mo>
811 <xsl:apply-templates select="." mode = "semantics">
812 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
813 <xsl:with-param name="PAREN" select="$PAREN"/>
814 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
815 </xsl:apply-templates>
822 <xsl:template match = "m:apply[m:power[1]]">
824 <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] | m:gcd[1] | m:sin[1] | m:cos[1] | m:tan[1] | m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] | m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] | m:coth[1] | m:arcsin[1] | m:arccos[1] | m:arctan[1]]">
825 <xsl:apply-templates select="*[2]" mode = "semantics"/>
829 <xsl:apply-templates select = "*[2]" mode = "semantics">
830 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
831 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
832 </xsl:apply-templates>
833 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
839 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
840 <xsl:param name="IN_PREC" select="$NO_PREC"/>
841 <xsl:param name="PARAM" select="$NO_PARAM"/>
842 <xsl:param name="PAREN" select="$PAR_NO"/>
843 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
845 <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME">
846 <m:mfenced separators="">
847 <xsl:call-template name="insert_xref"/>
848 <xsl:apply-templates select="." mode="remdiv">
849 <xsl:with-param name="PARAM" select="$IN_PREC"/>
850 <xsl:with-param name="PAREN" select="$PAR_YES"/>
851 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
852 </xsl:apply-templates>
855 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
856 <xsl:apply-templates select="." mode="remdiv">
857 <xsl:with-param name="PARAM" select="$PARAM"/>
858 <xsl:with-param name="PAREN" select="$PAREN"/>
859 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
860 </xsl:apply-templates>
864 <xsl:call-template name="insert_xref"/>
865 <xsl:apply-templates select="." mode="remdiv">
866 <xsl:with-param name="PARAM" select="$IN_PREC"/>
867 <xsl:with-param name="PAREN" select="$PAREN"/>
868 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
869 </xsl:apply-templates>
875 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
876 <xsl:param name="PARAM" select="$NO_PARAM"/>
877 <xsl:param name="PAREN" select="$PAR_NO"/>
878 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
879 <xsl:apply-templates select = "*[2]" mode = "semantics">
880 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
881 <xsl:with-param name="PARAM" select="$PARAM"/>
882 <xsl:with-param name="PAREN" select="$PAREN"/>
883 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
884 </xsl:apply-templates>
885 <xsl:if test="m:rem">
886 <m:mo><xsl:call-template name="insert1"/>%</m:mo>
888 <xsl:if test="m:divide">
889 <m:mo><xsl:call-template name="insert1"/>/</m:mo>
891 <xsl:apply-templates select = "*[3]" mode = "semantics">
892 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
893 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
894 <xsl:with-param name="PAREN" select="$PAREN"/>
895 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
896 </xsl:apply-templates>
899 <xsl:template match = "m:apply[m:times[1]]">
900 <xsl:param name="IN_PREC" select="$NO_PREC"/>
901 <xsl:param name="PARAM" select="$NO_PARAM"/>
902 <xsl:param name="PAREN" select="$PAR_NO"/>
903 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
905 <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME">
906 <m:mfenced separators="">
907 <xsl:call-template name="insert_xref"/>
908 <xsl:apply-templates select="." mode="times">
909 <xsl:with-param name="PARAM" select="$IN_PREC"/>
910 <xsl:with-param name="PAREN" select="$PAR_YES"/>
911 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
912 </xsl:apply-templates>
915 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
916 <xsl:apply-templates select="." mode="times">
917 <xsl:with-param name="PARAM" select="$PARAM"/>
918 <xsl:with-param name="PAREN" select="$PAREN"/>
919 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
920 </xsl:apply-templates>
924 <xsl:call-template name="insert_xref"/>
925 <xsl:apply-templates select="." mode="times">
926 <xsl:with-param name="PARAM" select="$IN_PREC"/>
927 <xsl:with-param name="PAREN" select="$PAREN"/>
928 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
929 </xsl:apply-templates>
935 <xsl:template match = "m:apply[m:times[1]]" mode="times">
936 <xsl:param name="PARAM" select="$NO_PARAM"/>
937 <xsl:param name="PAREN" select="$PAR_NO"/>
938 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
939 <xsl:apply-templates select="*[2]" mode = "semantics">
940 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
941 <xsl:with-param name="PARAM" select="$PARAM"/>
942 <xsl:with-param name="PAREN" select="$PAREN"/>
943 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
944 </xsl:apply-templates>
946 <xsl:for-each select = "*[position()>2]">
947 <!-- HELM: to distinguish between * and the application -->
948 <!-- <m:mo><xsl:call-template name="insert2"/>
949 <mchar name="InvisibleTimes"/> </m:mo> -->
950 <m:mo><xsl:call-template name="insert2"/>*</m:mo>
951 <xsl:apply-templates select="." mode = "semantics">
952 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
953 <xsl:with-param name="PAREN" select="$PAREN"/>
954 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
955 </xsl:apply-templates>
961 <xsl:template match = "m:apply[m:root[1]]">
963 <xsl:call-template name="insert1"/>
964 <xsl:call-template name="insert_xref"/>
965 <xsl:if test="*[2]=m:degree">
966 <xsl:apply-templates select="*[3]" mode = "semantics"/>
967 <xsl:apply-templates select="*[2]" mode = "semantics"/>
969 <xsl:if test="not(*[2]=m:degree)">
970 <xsl:apply-templates select="*[2]" mode = "semantics"/>
976 <xsl:template match = "m:apply[m:gcd[1]]">
978 <xsl:call-template name="insert_xref"/>
979 <xsl:if test="not(parent::m:apply[m:power[1]])">
980 <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
982 <xsl:if test="parent::m:apply[m:power[1]]">
984 <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
985 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
988 <m:mfenced separators=",">
989 <xsl:for-each select = "*[position()>1]">
990 <xsl:apply-templates select = "." mode="semantics"/>
996 <xsl:template match = "m:apply[m:and[1]]">
997 <xsl:param name="IN_PREC" select="$NO_PREC"/>
998 <xsl:param name="PAREN" select="$PAR_NO"/>
999 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1001 <xsl:when test="$IN_PREC > $AND_PREC">
1002 <m:mfenced separators="">
1003 <xsl:call-template name="insert_xref"/>
1004 <xsl:apply-templates select="." mode="and">
1005 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1006 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1007 </xsl:apply-templates>
1010 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1011 <xsl:apply-templates select="." mode="and">
1012 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1013 <xsl:with-param name="PAREN" select="$PAREN"/>
1014 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1015 </xsl:apply-templates>
1019 <xsl:call-template name="insert_xref"/>
1020 <xsl:apply-templates select="." mode="and">
1021 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1022 <xsl:with-param name="PAREN" select="$PAREN"/>
1023 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1024 </xsl:apply-templates>
1030 <xsl:template match = "m:apply[m:and[1]]" mode="and">
1031 <xsl:param name="PARAM" select="$NO_PARAM"/>
1032 <xsl:param name="PAREN" select="$PAR_NO"/>
1033 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1034 <xsl:apply-templates select="*[2]" mode = "semantics">
1035 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1036 <xsl:with-param name="PARAM" select="$PARAM"/>
1037 <xsl:with-param name="PAREN" select="$PAREN"/>
1038 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1039 </xsl:apply-templates>
1040 <xsl:for-each select = "*[position()>2]">
1041 <m:mo><xsl:call-template name="insert2"/> <mchar name="wedge"/> </m:mo>
1042 <xsl:apply-templates select="." mode = "semantics">
1043 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1044 <xsl:with-param name="PAREN" select="$PAREN"/>
1045 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1046 </xsl:apply-templates>
1050 <xsl:template match = "m:apply[m:or[1]]">
1051 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1052 <xsl:param name="PAREN" select="$PAR_NO"/>
1053 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1055 <xsl:when test="$IN_PREC > $OR_PREC">
1056 <m:mfenced separators="">
1057 <xsl:call-template name="insert_xref"/>
1058 <xsl:apply-templates select="." mode="or">
1059 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1060 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1061 </xsl:apply-templates>
1064 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1065 <xsl:apply-templates select="." mode="or">
1066 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1067 <xsl:with-param name="PAREN" select="$PAREN"/>
1068 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1069 </xsl:apply-templates>
1073 <xsl:call-template name="insert_xref"/>
1074 <xsl:apply-templates select="." mode="or">
1075 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1076 <xsl:with-param name="PAREN" select="$PAREN"/>
1077 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1078 </xsl:apply-templates>
1084 <xsl:template match = "m:apply[m:or[1]]" mode="or">
1085 <xsl:param name="PARAM" select="$NO_PARAM"/>
1086 <xsl:param name="PAREN" select="$PAR_NO"/>
1087 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1088 <xsl:apply-templates select="*[2]" mode = "semantics">
1089 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1090 <xsl:with-param name="PARAM" select="$PARAM"/>
1091 <xsl:with-param name="PAREN" select="$PAREN"/>
1092 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1093 </xsl:apply-templates>
1094 <xsl:for-each select = "*[position()>2]">
1095 <m:mo><xsl:call-template name="insert2"/> <mchar name="vee"/> </m:mo>
1096 <xsl:apply-templates select="." mode = "semantics">
1097 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1098 <xsl:with-param name="PAREN" select="$PAREN"/>
1099 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1100 </xsl:apply-templates>
1104 <xsl:template match = "m:apply[m:xor[1]]">
1105 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1106 <xsl:param name="PAREN" select="$PAR_NO"/>
1107 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1109 <xsl:when test="$IN_PREC > $XOR_PREC">
1110 <m:mfenced separators="">
1111 <xsl:call-template name="insert_xref"/>
1112 <xsl:apply-templates select="." mode="xor">
1113 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1114 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1115 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1116 </xsl:apply-templates>
1119 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1120 <xsl:apply-templates select="." mode="xor">
1121 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1122 <xsl:with-param name="PAREN" select="$PAREN"/>
1123 </xsl:apply-templates>
1127 <xsl:call-template name="insert_xref"/>
1128 <xsl:apply-templates select="." mode="xor">
1129 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1130 <xsl:with-param name="PAREN" select="$PAREN"/>
1131 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1132 </xsl:apply-templates>
1138 <xsl:template match = "m:apply[m:xor[1]]" mode="xor">
1139 <xsl:param name="PARAM" select="$NO_PARAM"/>
1140 <xsl:param name="PAREN" select="$PAR_NO"/>
1141 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1142 <xsl:apply-templates select="*[2]" mode = "semantics">
1143 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1144 <xsl:with-param name="PARAM" select="$PARAM"/>
1145 <xsl:with-param name="PAREN" select="$PAREN"/>
1146 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1147 </xsl:apply-templates>
1148 <xsl:for-each select = "*[position()>2]">
1149 <m:mo><xsl:call-template name="insert2"/> <mchar name="xor"/> </m:mo>
1150 <xsl:apply-templates select="." mode = "semantics">
1151 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1152 <xsl:with-param name="PAREN" select="$PAREN"/>
1153 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1154 </xsl:apply-templates>
1158 <xsl:template match = "m:apply[m:not[1]]">
1160 <xsl:call-template name="insert_xref"/>
1161 <!-- CSC, per estetica!
1162 <m:mo><xsl:call-template name="insert1"/>not</m:mo>
1164 <m:mo><xsl:call-template name="insert1"/><m:mchar name="not"/></m:mo>
1165 <xsl:apply-templates select = "*[2]" mode = "semantics">
1166 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1167 </xsl:apply-templates>
1171 <xsl:template match = "m:apply[m:forall[1]]">
1173 <xsl:call-template name="insert_xref"/>
1174 <m:mo><xsl:call-template name="insert1"/>for all</m:mo>
1175 <m:mfenced separators=",">
1176 <xsl:for-each select = "m:bvar">
1177 <xsl:apply-templates select = "." mode="semantics"/>
1180 <xsl:if test="m:condition">
1182 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1185 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
1189 <xsl:template match = "m:apply[m:exists[1]]">
1191 <xsl:call-template name="insert_xref"/>
1192 <m:mo><xsl:call-template name="insert1"/> <mchar name="Exists"/> </m:mo>
1193 <m:mfenced separators=",">
1194 <xsl:for-each select = "m:bvar">
1195 <xsl:apply-templates select = "." mode="semantics"/>
1198 <xsl:if test="m:condition">
1200 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1203 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
1207 <xsl:template match = "m:apply[m:abs[1]]">
1208 <xsl:if test="not(parent::m:apply[m:power[1]])">
1209 <m:mfenced open="|" close="|" separators="">
1210 <xsl:call-template name="insert_xref"/>
1211 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1214 <xsl:if test="parent::m:apply[m:power[1]]">
1216 <m:mfenced open="|" close="|" separators="">
1217 <xsl:call-template name="insert_xref"/>
1218 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1220 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1225 <xsl:template match = "m:apply[m:conjugate[1]]">
1228 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1230 <m:mo><xsl:call-template name="insert1"/> <mchar name="UnderBar"/> </m:mo>
1234 <xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
1236 <xsl:call-template name="insert_xref"/>
1238 <xsl:when test="m:arg">
1239 <m:mo><xsl:call-template name="insert1"/>arg</m:mo>
1241 <xsl:when test="m:real">
1242 <m:mo><xsl:call-template name="insert1"/>Real</m:mo>
1244 <xsl:when test="m:imaginary">
1245 <m:mo><xsl:call-template name="insert1"/>Imaginary</m:mo>
1248 <m:mfenced separators="">
1249 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1257 <xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies | m:in | m:notin | m:notsubset | m:notprsubset | m:subset | m:prsubset | m:eq | m:gt | m:lt | m:geq | m:leq | m:equivalent]">
1259 <xsl:call-template name="insert_xref"/>
1260 <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:tendsto or *[1]=m:implies or *[1]=m:in or *[1]=m:notin or *[1]=m:notsubset or *[1]=m:notprsubset">
1261 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1262 <xsl:if test="*[1]=m:neq">
1263 <m:mo><xsl:call-template name="insert1"/> <mchar name="NotEqual"/> </m:mo>
1265 <xsl:if test="*[1]=m:approx">
1266 <m:mo><xsl:call-template name="insert1"/> <mchar name="approxeq"/> </m:mo>
1268 <xsl:if test="*[1]=m:tendsto">
1269 <m:mo><xsl:call-template name="insert1"/> <mchar name="RightArrow"/> </m:mo>
1271 <xsl:if test="*[1]=m:implies">
1272 <m:mo><xsl:call-template name="insert1"/> <mchar name="DoubleRightArrow"/> </m:mo>
1274 <xsl:if test="*[1]=m:in">
1275 <m:mo><xsl:call-template name="insert1"/>
1276 <mchar name="Element"/>
1279 <xsl:if test="*[1]=m:notin">
1280 <m:mo><xsl:call-template name="insert1"/> <mchar name="NotElement"/> </m:mo>
1282 <xsl:if test="*[1]=m:notsubset">
1283 <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubset"/> </m:mo>
1285 <xsl:if test="*[1]=m:notprsubset">
1286 <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubsetEqual"/> </m:mo>
1288 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1289 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
1290 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
1292 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
1293 <m:mo><xsl:call-template name="insert1"/>+</m:mo>
1296 <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
1297 <xsl:apply-templates select = "*[2]" mode="semantics"/>
1298 <xsl:for-each select = "*[position()>2]">
1299 <xsl:if test="../*[self::m:subset][1]">
1300 <m:mo> <xsl:call-template name="insert2"/> <mchar name="SubsetEqual"/> </m:mo>
1302 <xsl:if test="../*[self::m:prsubset][1]">
1303 <m:mo> <xsl:call-template name="insert2"/><mchar name="subset"/> </m:mo>
1305 <xsl:if test="../*[self::m:eq][1]">
1306 <m:mo><xsl:call-template name="insert2"/>=</m:mo>
1308 <xsl:if test="../*[self::m:gt][1]">
1309 <m:mo><xsl:call-template name="insert2"/>></m:mo>
1311 <xsl:if test="../*[self::m:lt][1]">
1312 <m:mo><xsl:call-template name="insert2"/><</m:mo>
1314 <xsl:if test="../*[self::m:geq][1]">
1315 <m:mo><xsl:call-template name="insert2"/> <mchar name="geq"/> </m:mo>
1317 <xsl:if test="../*[self::m:leq][1]">
1318 <m:mo><xsl:call-template name="insert2"/> <mchar name="leq"/> </m:mo>
1320 <xsl:if test="../*[self::m:equivalent][1]">
1321 <m:mo><xsl:call-template name="insert2"/> <mchar name="Congruent"/> </m:mo>
1323 <xsl:apply-templates select = "." mode="semantics"/>
1332 <xsl:template match = "m:apply[*[1][self::m:ln]]">
1334 <xsl:call-template name="insert_xref"/>
1336 <xsl:when test="parent::m:apply[m:power[1]]">
1338 <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
1339 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1343 <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
1346 <xsl:apply-templates select = "*[2]" mode = "semantics">
1347 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1348 </xsl:apply-templates>
1352 <xsl:template match = "m:apply[m:log[1]]">
1354 <xsl:call-template name="insert_xref"/>
1356 <xsl:when test="parent::m:apply[m:power[1]]">
1357 <xsl:if test="not(*[2]=m:logbase)">
1359 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1360 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1363 <xsl:if test="*[2]=m:logbase">
1365 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1366 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1367 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
1372 <xsl:if test="not(*[2]=m:logbase)">
1373 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1375 <xsl:if test="*[2]=m:logbase">
1377 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1378 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
1383 <xsl:if test="*[2]=m:logbase">
1384 <xsl:apply-templates select = "*[3]" mode = "semantics">
1385 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1386 </xsl:apply-templates>
1388 <xsl:if test="not(*[2]=m:logbase)">
1389 <xsl:apply-templates select = "*[2]" mode = "semantics">
1390 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1391 </xsl:apply-templates>
1396 <xsl:template match = "m:apply[m:diff[1]]">
1398 <xsl:call-template name="insert_xref"/>
1399 <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
1400 <m:mfrac><xsl:call-template name="insert1"/>
1403 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
1408 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
1409 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
1414 <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
1415 <m:mfrac><xsl:call-template name="insert1"/>
1419 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
1423 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1427 <xsl:template match = "m:apply[m:partialdiff[1]]">
1429 <xsl:call-template name="insert_xref"/>
1430 <xsl:for-each select = "m:bvar">
1431 <xsl:if test="*[last()]=m:degree">
1432 <m:mfrac><xsl:call-template name="insert1"/>
1435 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
1440 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
1441 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
1446 <xsl:if test="not(*[last()]=m:degree)">
1447 <m:mfrac><xsl:call-template name="insert1"/>
1451 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
1456 <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
1460 <xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
1461 <xsl:apply-templates mode = "semantics"/>
1464 <xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
1466 <xsl:call-template name="insert_xref"/>
1467 <xsl:if test="*[1]=m:divergence">
1468 <m:mo><xsl:call-template name="insert1"/>div</m:mo>
1470 <xsl:if test="*[1]=m:grad">
1471 <m:mo><xsl:call-template name="insert1"/>grad</m:mo>
1473 <xsl:if test="*[1]=m:curl">
1474 <m:mo><xsl:call-template name="insert1"/>curl</m:mo>
1477 <xsl:when test="*[2]=m:ci">
1478 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1481 <m:mfenced separators="">
1482 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1489 <xsl:template match = "m:apply[m:laplacian[1]]">
1491 <xsl:call-template name="insert_xref"/>
1492 <m:msup><xsl:call-template name="insert1"/>
1493 <m:mo> Δ </m:mo>
1496 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1503 <xsl:template match = "m:set | m:list">
1504 <m:mfenced open="{{" close="}}" separators="">
1505 <xsl:call-template name="insert_xref"/>
1506 <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
1507 <xsl:apply-templates select="m:bvar" mode = "semantics"/>
1509 <xsl:apply-templates select="m:condition" mode = "semantics"/>
1511 <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
1512 <m:mfenced open="" close="" separators=",">
1513 <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
1514 <xsl:apply-templates select = "." mode="semantics"/>
1518 <xsl:apply-templates select="m:condition" mode = "semantics"/>
1520 <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
1521 <m:mfenced open="" close="" separators=",">
1522 <xsl:for-each select = "*">
1523 <xsl:apply-templates select = "." mode="semantics"/>
1530 <xsl:template match = "m:apply[m:union[1]]">
1531 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1532 <xsl:param name="PARAM" select="$NO_PARAM"/>
1533 <xsl:param name="PAREN" select="$PAR_NO"/>
1534 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1536 <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC and $PARAM=$PAR_SAME">
1537 <m:mfenced separators="" helm:xref="{@helm:xref}">
1538 <xsl:call-template name="insert_xref"/>
1539 <xsl:apply-templates select="." mode="union">
1540 <xsl:with-param name="PARAM" select="$PARAM"/>
1541 <xsl:with-param name="PAREN" select="$PAREN"/>
1542 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1543 </xsl:apply-templates>
1546 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1547 <xsl:apply-templates select="." mode="union">
1548 <xsl:with-param name="PARAM" select="$PARAM"/>
1549 <xsl:with-param name="PAREN" select="$PAREN"/>
1550 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1551 </xsl:apply-templates>
1555 <xsl:call-template name="insert_xref"/>
1556 <xsl:apply-templates select="." mode="union">
1557 <xsl:with-param name="PARAM" select="$PARAM"/>
1558 <xsl:with-param name="PAREN" select="$PAREN"/>
1559 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1560 </xsl:apply-templates>
1566 <xsl:template match = "m:apply[m:union[1]]" mode="union">
1567 <xsl:param name="PARAM" select="$NO_PARAM"/>
1568 <xsl:param name="PAREN" select="$PAR_NO"/>
1569 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1570 <xsl:apply-templates select = "*[2]" mode="semantics">
1571 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
1572 <xsl:with-param name="PARAM" select="$PARAM"/>
1573 <xsl:with-param name="PAREN" select="$PAREN"/>
1574 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1575 </xsl:apply-templates>
1576 <xsl:for-each select = "*[position()>2]">
1577 <m:mo><xsl:call-template name="insert2"/> <mchar name="Union"/> </m:mo>
1578 <xsl:apply-templates select = "." mode="semantics">
1579 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
1580 <xsl:with-param name="PAREN" select="$PAREN"/>
1581 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1582 </xsl:apply-templates>
1586 <xsl:template match = "m:apply[m:intersect[1]]">
1587 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1588 <xsl:param name="PARAM" select="$NO_PARAM"/>
1589 <xsl:param name="PAREN" select="$PAR_NO"/>
1590 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1592 <xsl:when test="$IN_PREC > $INTERSECT_PREC">
1593 <m:mfenced separators="" helm:xref="{@helm:xref}">
1594 <xsl:call-template name="insert_xref"/>
1595 <xsl:apply-templates select="." mode="intersect">
1596 <xsl:with-param name="PARAM" select="$PARAM"/>
1597 <xsl:with-param name="PAREN" select="$PAREN"/>
1598 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1599 </xsl:apply-templates>
1602 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1603 <xsl:apply-templates select="." mode="intersect">
1604 <xsl:with-param name="PARAM" select="$PARAM"/>
1605 <xsl:with-param name="PAREN" select="$PAREN"/>
1606 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1607 </xsl:apply-templates>
1611 <xsl:call-template name="insert_xref"/>
1612 <xsl:apply-templates select="." mode="intersect">
1613 <xsl:with-param name="PARAM" select="$PARAM"/>
1614 <xsl:with-param name="PAREN" select="$PAREN"/>
1615 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1616 </xsl:apply-templates>
1622 <xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
1623 <xsl:param name="PARAM" select="$NO_PARAM"/>
1624 <xsl:param name="PAREN" select="$PAR_NO"/>
1625 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1626 <xsl:apply-templates select = "*[2]" mode="semantics">
1627 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
1628 <xsl:with-param name="PARAM" select="$PARAM"/>
1629 <xsl:with-param name="PAREN" select="$PAREN"/>
1630 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1631 </xsl:apply-templates>
1632 <xsl:for-each select = "*[position()>2]">
1633 <m:mo><xsl:call-template name="insert2"/> <mchar name="Intersection"/> </m:mo>
1634 <xsl:apply-templates select = "." mode="semantics">
1635 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
1636 <xsl:with-param name="PAREN" select="$PAREN"/>
1637 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1638 </xsl:apply-templates>
1642 <xsl:template match = "m:apply[m:setdiff[1]]">
1643 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1644 <xsl:param name="PARAM" select="$NO_PARAM"/>
1645 <xsl:param name="PAREN" select="$PAR_NO"/>
1646 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1648 <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC and $PARAM=$PAR_SAME">
1649 <m:mfenced separators="">
1650 <xsl:call-template name="insert_xref"/>
1651 <xsl:apply-templates select="." mode="setdiff">
1652 <xsl:with-param name="PARAM" select="$PARAM"/>
1653 <xsl:with-param name="PAREN" select="$PAREN"/>
1654 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1655 </xsl:apply-templates>
1658 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1659 <xsl:apply-templates select="." mode="setdiff">
1660 <xsl:with-param name="PARAM" select="$PARAM"/>
1661 <xsl:with-param name="PAREN" select="$PAREN"/>
1662 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1663 </xsl:apply-templates>
1667 <xsl:call-template name="insert_xref"/>
1668 <xsl:apply-templates select="." mode="setdiff">
1669 <xsl:with-param name="PARAM" select="$PARAM"/>
1670 <xsl:with-param name="PAREN" select="$PAREN"/>
1671 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1672 </xsl:apply-templates>
1678 <xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
1679 <xsl:param name="PARAM" select="$NO_PARAM"/>
1680 <xsl:param name="PAREN" select="$PAR_NO"/>
1681 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1682 <xsl:apply-templates select = "*[2]" mode = "semantics">
1683 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
1684 <xsl:with-param name="PARAM" select="$PARAM"/>
1685 <xsl:with-param name="PAREN" select="$PAREN"/>
1686 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1687 </xsl:apply-templates>
1688 <m:mo><xsl:call-template name="insert1"/>\</m:mo>
1689 <xsl:apply-templates select = "*[3]" mode = "semantics">
1690 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
1691 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1692 <xsl:with-param name="PAREN" select="$PAREN"/>
1693 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1694 </xsl:apply-templates>
1697 <xsl:template match = "m:apply[m:card[1]]">
1698 <m:mfenced open="|" close="|" separators=",">
1699 <xsl:call-template name="insert_xref"/>
1700 <xsl:for-each select = "*[position()>1]">
1701 <xsl:apply-templates select = "." mode="semantics"/>
1707 <!-- SEQUENCES AND SERIES -->
1709 <xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
1711 <xsl:call-template name="insert_xref"/>
1713 <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
1715 <xsl:if test="*[1]=m:sum">
1716 <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
1718 <xsl:if test="*[1]=m:product">
1719 <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
1722 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1724 <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
1726 <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
1728 <xsl:apply-templates select = "*[5]" mode = "semantics"/>
1730 <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
1732 <xsl:if test="*[1]=m:sum">
1733 <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
1735 <xsl:if test="*[1]=m:product">
1736 <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
1738 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1740 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
1746 <xsl:template match = "m:apply[m:limit[1]]">
1748 <xsl:call-template name="insert_xref"/>
1750 <m:mo><xsl:call-template name="insert1"/>lim</m:mo>
1752 <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
1753 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1754 <m:mo> <mchar name="RightArrow"/> </m:mo>
1755 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1757 <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
1758 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1762 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
1767 <!-- TRIGONOMETRY -->
1769 <xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos | self::m:tan | self::m:sec | self::m:csc | self::m:cot | self::m:sinh | self::m:cosh | self::m:tanh | self::m:sech | self::m:csch | self::m:coth | self::m:arcsin | self::m:arccos | self::m:arctan]]">
1771 <xsl:call-template name="insert_xref"/>
1772 <xsl:if test="not(parent::m:apply[m:power[1]])">
1773 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
1775 <xsl:if test="parent::m:apply[m:power[1]]">
1777 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
1778 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1781 <xsl:apply-templates select = "*[2]" mode = "semantics">
1782 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1783 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1784 </xsl:apply-templates>
1788 <xsl:template match = "m:*" mode = "trigonometry">
1790 <xsl:when test="self::m:sin">
1793 <xsl:when test="self::m:cos">
1796 <xsl:when test="self::m:tan">
1799 <xsl:when test="self::m:sec">
1802 <xsl:when test="self::m:csc">
1805 <xsl:when test="self::m:cot">
1808 <xsl:when test="self::m:sinh">
1811 <xsl:when test="self::m:cosh">
1814 <xsl:when test="self::m:tanh">
1817 <xsl:when test="self::m:sech">
1820 <xsl:when test="self::m:csch">
1823 <xsl:when test="self::m:coth">
1826 <xsl:when test="self::m:arcsin">
1829 <xsl:when test="self::m:arccos">
1832 <xsl:when test="self::m:arctan">
1841 <xsl:template match = "m:apply[m:mean[1]]">
1842 <m:mfenced open="<" close=">" separators=",">
1843 <xsl:call-template name="insert_xref"/>
1844 <xsl:for-each select = "*[position()>1]">
1845 <xsl:apply-templates select = "." mode="semantics"/>
1850 <xsl:template match = "m:apply[m:sdev[1]]">
1852 <xsl:call-template name="insert_xref"/>
1853 <m:mo><xsl:call-template name="insert1"/> σ </m:mo>
1854 <m:mfenced separators=",">
1855 <xsl:for-each select = "*[position()>1]">
1856 <xsl:apply-templates select = "." mode="semantics"/>
1862 <xsl:template match = "m:apply[m:variance[1]]">
1864 <xsl:call-template name="insert_xref"/>
1865 <m:mo><xsl:call-template name="insert1"/> σ </m:mo>
1867 <m:mfenced separators=",">
1868 <xsl:for-each select = "*[position()>1]">
1869 <xsl:apply-templates select = "." mode="semantics"/>
1877 <xsl:template match = "m:apply[m:median[1]]">
1879 <xsl:call-template name="insert_xref"/>
1880 <m:mo><xsl:call-template name="insert1"/>median</m:mo>
1881 <m:mfenced separators=",">
1882 <xsl:for-each select = "*[position()>1]">
1883 <xsl:apply-templates select = "." mode="semantics"/>
1889 <xsl:template match = "m:apply[m:mode[1]]">
1891 <xsl:call-template name="insert_xref"/>
1892 <m:mo><xsl:call-template name="insert1"/>mode</m:mo>
1893 <m:mfenced separators=",">
1894 <xsl:for-each select = "*[position()>1]">
1895 <xsl:apply-templates select = "." mode="semantics"/>
1901 <xsl:template match = "m:apply[m:moment[1]]">
1902 <xsl:call-template name="insert_xref"/>
1903 <m:mfenced open="<" close=">" separators="">
1904 <xsl:if test="*[2]=m:degree">
1906 <xsl:apply-templates select="*[3]" mode = "semantics"/>
1907 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1910 <xsl:if test="not(*[2]=m:degree)">
1911 <xsl:for-each select = "*[position()>1]">
1912 <xsl:apply-templates select = "." mode="semantics"/>
1919 <!-- LINEAR ALGEBRA -->
1921 <xsl:template match="m:vector">
1922 <m:mfenced separators="">
1924 <xsl:for-each select="*">
1926 <xsl:apply-templates select="." mode = "semantics"/>
1933 <xsl:template match = "m:matrix">
1934 <m:mfenced separators="">
1936 <xsl:apply-templates mode = "semantics"/>
1941 <xsl:template match = "m:matrixrow">
1943 <xsl:for-each select="*">
1945 <xsl:apply-templates select="." mode = "semantics"/>
1951 <xsl:template match = "m:apply[m:determinant[1]]">
1953 <xsl:call-template name="insert_xref"/>
1954 <m:mo><xsl:call-template name="insert1"/>det</m:mo>
1955 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1959 <xsl:template match = "m:apply[m:transpose[1]]">
1961 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1966 <xsl:template match = "m:apply[m:selector[1]]">
1967 <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
1968 <xsl:variable name="m" select = "*[3]"/>
1970 <xsl:when test="*[4]=m:cn">
1971 <xsl:variable name="n" select = "*[4]"/>
1972 <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
1975 <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
1979 <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
1980 <xsl:variable name="m" select = "*[3]"/>
1981 <xsl:copy-of select = "*[2]/*[position()=$m]"/>
1985 <xsl:template match = "m:apply[m:vectorproduct[1] | m:scalarproduct[1] | m:outerproduct[1]]">
1987 <xsl:call-template name="insert_xref"/>
1988 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1990 <xsl:when test="m:vectorproduct[1]">
1991 <m:mo><xsl:call-template name="insert1"/> <mchar name="Cross"/> </m:mo>
1993 <xsl:when test="m:scalarproduct[1] | m:outerproduct[1]">
1994 <m:mo><xsl:call-template name="insert1"/>.</m:mo>
1997 <xsl:apply-templates select="*[3]" mode = "semantics"/>