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"/>
373 <xsl:copy-of select="*"/>
381 <xsl:template match = "m:csymbol">
383 <xsl:when test="*[1]">
384 <xsl:copy-of select = "*"/>
387 <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
393 <!-- BASIC CONTENT ELEMENTS -->
395 <xsl:template match = "m:apply[m:fn[1]]">
397 <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
398 <m:mfenced separators=",">
399 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
404 <xsl:template match = "m:fn">
405 <xsl:apply-templates select = "*[1]" mode = "semantics">
406 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
407 </xsl:apply-templates>
410 <xsl:template match = "m:interval">
412 <xsl:when test="@closure='closed'">
413 <m:mfenced open="[" close="]" separators=",">
414 <xsl:apply-templates mode = "semantics"/>
417 <xsl:when test="@closure='open'">
418 <m:mfenced separators=",">
419 <xsl:apply-templates mode = "semantics"/>
422 <xsl:when test="@closure='open-closed'">
423 <m:mfenced open="(" close="]" separators=",">
424 <xsl:apply-templates mode = "semantics"/>
427 <xsl:when test="@closure='closed-open'">
428 <m:mfenced open="[" close=")" separators=",">
429 <xsl:apply-templates mode = "semantics"/>
433 <m:mfenced open="[" close="]" separators=",">
434 <xsl:apply-templates mode = "semantics"/>
440 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
442 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
443 <m:mfenced separators=",">
444 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
449 <!-- HELM: these "semantical" Transformations are REALLY questionable.
452 <xsl:template match = "m:apply[*[1][self::m:inverse]]">
454 <xsl:when test="*[2]=m:exp">
457 <xsl:when test="*[2]=m:ln | m:log">
460 <xsl:when test="*[2]=m:sin">
463 <xsl:when test="*[2]=m:cos">
466 <xsl:when test="*[2]=m:tan">
469 <xsl:when test="*[2]=m:sec">
472 <xsl:when test="*[2]=m:csc">
475 <xsl:when test="*[2]=m:cot">
478 <xsl:when test="*[2]=m:sinh">
481 <xsl:when test="*[2]=m:cosh">
484 <xsl:when test="*[2]=m:tanh">
487 <xsl:when test="*[2]=m:sech">
490 <xsl:when test="*[2]=m:csch">
493 <xsl:when test="*[2]=m:coth">
496 <xsl:when test="*[2]=m:arcsin">
499 <xsl:when test="*[2]=m:arccos">
502 <xsl:when test="*[2]=m:arctan">
507 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
516 <xsl:template match = "m:sep"/>
518 <xsl:template match = "m:condition">
520 <xsl:when test="parent::m:apply[m:forall[1]]"/>
522 <xsl:if test="not(*[2])">
523 <xsl:apply-templates mode = "semantics"/>
527 <xsl:apply-templates mode = "semantics"/>
534 <xsl:template match = "m:declare"/>
536 <xsl:template match = "m:lambda">
538 <m:mo> Λ </m:mo>
539 <m:mfenced separators=",">
540 <xsl:for-each select = "*">
542 <xsl:when test="self::m:ci or self::m:cn">
543 <xsl:apply-templates select = "." mode="semantics"/>
547 <xsl:apply-templates select = "." mode="semantics"/>
556 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:compose[1]]]]">
558 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
559 <m:mfenced separators=",">
560 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
565 <xsl:template match = "m:apply[*[1][self::m:compose]]">
566 <m:mfenced separators="">
567 <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] | self::m:fn]" mode="semantics"/>
568 <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] | self::m:fn]">
569 <m:mo> <xsl:call-template name="insert2"/> <mchar name="SmallCircle"/> </m:mo>
570 <xsl:apply-templates select = "." mode="semantics"/>
575 <xsl:template match = "m:ident">
580 <!-- ARITHMETIC, ALGEBRA & LOGIC -->
582 <xsl:template match = "m:apply[m:quotient[1]]">
583 <m:mfenced open="⌊" close="⌋" separators="">
584 <xsl:call-template name="insert_xref"/>
585 <xsl:apply-templates select="*[2]" mode = "semantics">
586 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
587 </xsl:apply-templates>
588 <m:mo><xsl:call-template name="insert1"/>/</m:mo>
589 <xsl:apply-templates select="*[3]" mode = "semantics">
590 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
591 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
592 </xsl:apply-templates>
596 <xsl:template match = "m:apply[*[1][self::m:exp]]">
599 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
603 <xsl:template match = "m:apply[m:factorial[1]]">
605 <xsl:call-template name="insert_xref"/>
606 <xsl:apply-templates select = "*[2]" mode = "semantics">
607 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
608 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
609 </xsl:apply-templates>
610 <m:mo><xsl:call-template name="insert1"/>!</m:mo>
614 <xsl:template match = "m:apply[m:max[1] | m:min[1]]">
616 <xsl:call-template name="insert_xref"/>
617 <xsl:if test="*[2]=m:bvar">
619 <xsl:if test="*[1]=m:max">
620 <m:mo><xsl:call-template name="insert1"/>max</m:mo>
622 <xsl:if test="*[1]=m:min">
625 <xsl:apply-templates select="*[2]" mode = "semantics"/>
627 <xsl:if test="*[3]=m:condition">
628 <m:mfenced open="{{" close="}}" separators="">
629 <m:mfenced open="" close="" separators=",">
630 <xsl:for-each select = "*[position()>3]">
631 <xsl:apply-templates select = "." mode="semantics"/>
635 <xsl:apply-templates select="*[3]" mode = "semantics"/>
638 <xsl:if test="not(*[3]=m:condition)">
639 <m:mfenced open="{{" close="}}" separators=",">
640 <xsl:for-each select = "*[position()>2]">
641 <xsl:apply-templates select = "." mode="semantics"/>
646 <xsl:if test="*[2]=m:condition">
647 <xsl:if test="*[1]=m:max">
650 <xsl:if test="*[1]=m:min">
653 <m:mfenced open="{{" close="}}" separators="">
655 <m:mfenced open="" close="" separators=",">
656 <xsl:for-each select = "*[position()>2]">
657 <xsl:apply-templates select = "." mode="semantics"/>
662 <xsl:apply-templates select="*[2]" mode = "semantics"/>
665 <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
666 <xsl:if test="*[1]=m:max">
669 <xsl:if test="*[1]=m:min">
670 <m:mo><xsl:call-template name="insert1"/>min</m:mo>
672 <m:mfenced open="{{" close="}}" separators=",">
673 <xsl:for-each select = "*[position()>1]">
674 <xsl:apply-templates select = "." mode="semantics"/>
681 <xsl:template match = "m:apply[m:minus[1]]">
682 <xsl:param name="IN_PREC" select="$NO_PREC"/>
683 <xsl:param name="PARAM" select="$NO_PARAM"/>
684 <xsl:param name="PAREN" select="$PAR_NO"/>
685 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
687 <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME">
688 <m:mfenced separators="">
689 <xsl:call-template name="insert_xref"/>
690 <xsl:apply-templates select="." mode="minus">
691 <xsl:with-param name="PARAM" select="$PARAM"/>
692 <xsl:with-param name="PAREN" select="$PAR_YES"/>
693 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
694 </xsl:apply-templates>
697 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
698 <xsl:apply-templates select="." mode="minus">
699 <xsl:with-param name="PARAM" select="$PARAM"/>
700 <xsl:with-param name="PAREN" select="$PAREN"/>
701 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
702 </xsl:apply-templates>
706 <xsl:call-template name="insert_xref"/>
707 <xsl:apply-templates select="." mode="minus">
708 <xsl:with-param name="PARAM" select="$PARAM"/>
709 <xsl:with-param name="PAREN" select="$PAREN"/>
710 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
711 </xsl:apply-templates>
717 <xsl:template match = "m:apply[m:minus[1]]" mode="minus">
718 <xsl:param name="PARAM" select="$NO_PARAM"/>
719 <xsl:param name="PAREN" select="$PAR_NO"/>
720 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
721 <xsl:if test="not(*[3])">
722 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
723 <xsl:apply-templates select="*[2]" mode = "semantics">
724 <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
725 <xsl:with-param name="PAREN" select="$PAREN"/>
726 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
727 </xsl:apply-templates>
730 <xsl:apply-templates select="*[2]" mode = "semantics">
731 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
732 <xsl:with-param name="PARAM" select="$PARAM"/>
733 <xsl:with-param name="PAREN" select="$PAREN"/>
734 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
735 </xsl:apply-templates>
736 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
737 <xsl:apply-templates select="*[3]" mode = "semantics">
738 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
739 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
740 <xsl:with-param name="PAREN" select="$PAREN"/>
741 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
742 </xsl:apply-templates>
746 <xsl:template match = "m:apply[m:plus[1]]">
747 <xsl:param name="IN_PREC" select="$NO_PREC"/>
748 <xsl:param name="PARAM" select="$NO_PARAM"/>
749 <xsl:param name="PAREN" select="$PAR_NO"/>
750 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
752 <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME">
753 <m:mfenced separators="">
754 <xsl:call-template name="insert_xref"/>
755 <xsl:apply-templates select="." mode="plus">
756 <xsl:with-param name="PARAM" select="$IN_PREC"/>
757 <xsl:with-param name="PAREN" select="$PAR_YES"/>
758 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
759 </xsl:apply-templates>
762 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
763 <xsl:apply-templates select="." mode="plus">
764 <xsl:with-param name="PARAM" select="$PARAM"/>
765 <xsl:with-param name="PAREN" select="$PAREN"/>
766 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
767 </xsl:apply-templates>
771 <xsl:call-template name="insert_xref"/>
772 <xsl:apply-templates select="." mode="plus">
773 <xsl:with-param name="PARAM" select="$IN_PREC"/>
774 <xsl:with-param name="PAREN" select="$PAREN"/>
775 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
776 </xsl:apply-templates>
782 <xsl:template match = "m:apply[m:plus[1]]" mode="plus">
783 <xsl:param name="PARAM" select="$NO_PARAM"/>
784 <xsl:param name="PAREN" select="$PAR_NO"/>
785 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
787 <xsl:apply-templates select="*[2]" mode = "semantics">
788 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
789 <xsl:with-param name="PARAM" select="$PARAM"/>
790 <xsl:with-param name="PAREN" select="$PAREN"/>
791 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
792 </xsl:apply-templates>
793 <xsl:for-each select = "*[position()>2]">
795 <xsl:when test=". < 0">
797 <m:mn> <xsl:value-of select="-."/> </m:mn>
799 <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
800 <xsl:apply-templates select="." mode = "semantics">
801 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
802 <xsl:with-param name="PAREN" select="$PAREN"/>
803 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
804 </xsl:apply-templates>
807 <m:mo><xsl:call-template name="insert2"/>+</m:mo>
808 <xsl:apply-templates select="." mode = "semantics">
809 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
810 <xsl:with-param name="PAREN" select="$PAREN"/>
811 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
812 </xsl:apply-templates>
819 <xsl:template match = "m:apply[m:power[1]]">
821 <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]]">
822 <xsl:apply-templates select="*[2]" mode = "semantics"/>
826 <xsl:apply-templates select = "*[2]" mode = "semantics">
827 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
828 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
829 </xsl:apply-templates>
830 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
836 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
837 <xsl:param name="IN_PREC" select="$NO_PREC"/>
838 <xsl:param name="PARAM" select="$NO_PARAM"/>
839 <xsl:param name="PAREN" select="$PAR_NO"/>
840 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
842 <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME">
843 <m:mfenced separators="">
844 <xsl:call-template name="insert_xref"/>
845 <xsl:apply-templates select="." mode="remdiv">
846 <xsl:with-param name="PARAM" select="$IN_PREC"/>
847 <xsl:with-param name="PAREN" select="$PAR_YES"/>
848 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
849 </xsl:apply-templates>
852 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
853 <xsl:apply-templates select="." mode="remdiv">
854 <xsl:with-param name="PARAM" select="$PARAM"/>
855 <xsl:with-param name="PAREN" select="$PAREN"/>
856 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
857 </xsl:apply-templates>
861 <xsl:call-template name="insert_xref"/>
862 <xsl:apply-templates select="." mode="remdiv">
863 <xsl:with-param name="PARAM" select="$IN_PREC"/>
864 <xsl:with-param name="PAREN" select="$PAREN"/>
865 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
866 </xsl:apply-templates>
872 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
873 <xsl:param name="PARAM" select="$NO_PARAM"/>
874 <xsl:param name="PAREN" select="$PAR_NO"/>
875 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
876 <xsl:apply-templates select = "*[2]" mode = "semantics">
877 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
878 <xsl:with-param name="PARAM" select="$PARAM"/>
879 <xsl:with-param name="PAREN" select="$PAREN"/>
880 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
881 </xsl:apply-templates>
882 <xsl:if test="m:rem">
883 <m:mo><xsl:call-template name="insert1"/>%</m:mo>
885 <xsl:if test="m:divide">
886 <m:mo><xsl:call-template name="insert1"/>/</m:mo>
888 <xsl:apply-templates select = "*[3]" mode = "semantics">
889 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
890 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
891 <xsl:with-param name="PAREN" select="$PAREN"/>
892 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
893 </xsl:apply-templates>
896 <xsl:template match = "m:apply[m:times[1]]">
897 <xsl:param name="IN_PREC" select="$NO_PREC"/>
898 <xsl:param name="PARAM" select="$NO_PARAM"/>
899 <xsl:param name="PAREN" select="$PAR_NO"/>
900 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
902 <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME">
903 <m:mfenced separators="">
904 <xsl:call-template name="insert_xref"/>
905 <xsl:apply-templates select="." mode="times">
906 <xsl:with-param name="PARAM" select="$IN_PREC"/>
907 <xsl:with-param name="PAREN" select="$PAR_YES"/>
908 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
909 </xsl:apply-templates>
912 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
913 <xsl:apply-templates select="." mode="times">
914 <xsl:with-param name="PARAM" select="$PARAM"/>
915 <xsl:with-param name="PAREN" select="$PAREN"/>
916 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
917 </xsl:apply-templates>
921 <xsl:call-template name="insert_xref"/>
922 <xsl:apply-templates select="." mode="times">
923 <xsl:with-param name="PARAM" select="$IN_PREC"/>
924 <xsl:with-param name="PAREN" select="$PAREN"/>
925 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
926 </xsl:apply-templates>
932 <xsl:template match = "m:apply[m:times[1]]" mode="times">
933 <xsl:param name="PARAM" select="$NO_PARAM"/>
934 <xsl:param name="PAREN" select="$PAR_NO"/>
935 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
936 <xsl:apply-templates select="*[2]" mode = "semantics">
937 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
938 <xsl:with-param name="PARAM" select="$PARAM"/>
939 <xsl:with-param name="PAREN" select="$PAREN"/>
940 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
941 </xsl:apply-templates>
943 <xsl:for-each select = "*[position()>2]">
944 <!-- HELM: to distinguish between * and the application -->
945 <!-- <m:mo><xsl:call-template name="insert2"/>
946 <mchar name="InvisibleTimes"/> </m:mo> -->
947 <m:mo><xsl:call-template name="insert2"/>*</m:mo>
948 <xsl:apply-templates select="." mode = "semantics">
949 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
950 <xsl:with-param name="PAREN" select="$PAREN"/>
951 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
952 </xsl:apply-templates>
958 <xsl:template match = "m:apply[m:root[1]]">
960 <xsl:call-template name="insert1"/>
961 <xsl:call-template name="insert_xref"/>
962 <xsl:if test="*[2]=m:degree">
963 <xsl:apply-templates select="*[3]" mode = "semantics"/>
964 <xsl:apply-templates select="*[2]" mode = "semantics"/>
966 <xsl:if test="not(*[2]=m:degree)">
967 <xsl:apply-templates select="*[2]" mode = "semantics"/>
973 <xsl:template match = "m:apply[m:gcd[1]]">
975 <xsl:call-template name="insert_xref"/>
976 <xsl:if test="not(parent::m:apply[m:power[1]])">
977 <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
979 <xsl:if test="parent::m:apply[m:power[1]]">
981 <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
982 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
985 <m:mfenced separators=",">
986 <xsl:for-each select = "*[position()>1]">
987 <xsl:apply-templates select = "." mode="semantics"/>
993 <xsl:template match = "m:apply[m:and[1]]">
994 <xsl:param name="IN_PREC" select="$NO_PREC"/>
995 <xsl:param name="PAREN" select="$PAR_NO"/>
996 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
998 <xsl:when test="$IN_PREC > $AND_PREC">
999 <m:mfenced separators="">
1000 <xsl:call-template name="insert_xref"/>
1001 <xsl:apply-templates select="." mode="and">
1002 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1003 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1004 </xsl:apply-templates>
1007 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1008 <xsl:apply-templates select="." mode="and">
1009 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1010 <xsl:with-param name="PAREN" select="$PAREN"/>
1011 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1012 </xsl:apply-templates>
1016 <xsl:call-template name="insert_xref"/>
1017 <xsl:apply-templates select="." mode="and">
1018 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1019 <xsl:with-param name="PAREN" select="$PAREN"/>
1020 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1021 </xsl:apply-templates>
1027 <xsl:template match = "m:apply[m:and[1]]" mode="and">
1028 <xsl:param name="PARAM" select="$NO_PARAM"/>
1029 <xsl:param name="PAREN" select="$PAR_NO"/>
1030 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1031 <xsl:apply-templates select="*[2]" mode = "semantics">
1032 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1033 <xsl:with-param name="PARAM" select="$PARAM"/>
1034 <xsl:with-param name="PAREN" select="$PAREN"/>
1035 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1036 </xsl:apply-templates>
1037 <xsl:for-each select = "*[position()>2]">
1038 <m:mo><xsl:call-template name="insert2"/> <mchar name="wedge"/> </m:mo>
1039 <xsl:apply-templates select="." mode = "semantics">
1040 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1041 <xsl:with-param name="PAREN" select="$PAREN"/>
1042 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1043 </xsl:apply-templates>
1047 <xsl:template match = "m:apply[m:or[1]]">
1048 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1049 <xsl:param name="PAREN" select="$PAR_NO"/>
1050 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1052 <xsl:when test="$IN_PREC > $OR_PREC">
1053 <m:mfenced separators="">
1054 <xsl:call-template name="insert_xref"/>
1055 <xsl:apply-templates select="." mode="or">
1056 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1057 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1058 </xsl:apply-templates>
1061 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1062 <xsl:apply-templates select="." mode="or">
1063 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1064 <xsl:with-param name="PAREN" select="$PAREN"/>
1065 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1066 </xsl:apply-templates>
1070 <xsl:call-template name="insert_xref"/>
1071 <xsl:apply-templates select="." mode="or">
1072 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1073 <xsl:with-param name="PAREN" select="$PAREN"/>
1074 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1075 </xsl:apply-templates>
1081 <xsl:template match = "m:apply[m:or[1]]" mode="or">
1082 <xsl:param name="PARAM" select="$NO_PARAM"/>
1083 <xsl:param name="PAREN" select="$PAR_NO"/>
1084 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1085 <xsl:apply-templates select="*[2]" mode = "semantics">
1086 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1087 <xsl:with-param name="PARAM" select="$PARAM"/>
1088 <xsl:with-param name="PAREN" select="$PAREN"/>
1089 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1090 </xsl:apply-templates>
1091 <xsl:for-each select = "*[position()>2]">
1092 <m:mo><xsl:call-template name="insert2"/> <mchar name="vee"/> </m:mo>
1093 <xsl:apply-templates select="." mode = "semantics">
1094 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1095 <xsl:with-param name="PAREN" select="$PAREN"/>
1096 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1097 </xsl:apply-templates>
1101 <xsl:template match = "m:apply[m:xor[1]]">
1102 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1103 <xsl:param name="PAREN" select="$PAR_NO"/>
1104 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1106 <xsl:when test="$IN_PREC > $XOR_PREC">
1107 <m:mfenced separators="">
1108 <xsl:call-template name="insert_xref"/>
1109 <xsl:apply-templates select="." mode="xor">
1110 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1111 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1112 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1113 </xsl:apply-templates>
1116 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1117 <xsl:apply-templates select="." mode="xor">
1118 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1119 <xsl:with-param name="PAREN" select="$PAREN"/>
1120 </xsl:apply-templates>
1124 <xsl:call-template name="insert_xref"/>
1125 <xsl:apply-templates select="." mode="xor">
1126 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1127 <xsl:with-param name="PAREN" select="$PAREN"/>
1128 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1129 </xsl:apply-templates>
1135 <xsl:template match = "m:apply[m:xor[1]]" mode="xor">
1136 <xsl:param name="PARAM" select="$NO_PARAM"/>
1137 <xsl:param name="PAREN" select="$PAR_NO"/>
1138 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1139 <xsl:apply-templates select="*[2]" mode = "semantics">
1140 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1141 <xsl:with-param name="PARAM" select="$PARAM"/>
1142 <xsl:with-param name="PAREN" select="$PAREN"/>
1143 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1144 </xsl:apply-templates>
1145 <xsl:for-each select = "*[position()>2]">
1146 <m:mo><xsl:call-template name="insert2"/> <mchar name="xor"/> </m:mo>
1147 <xsl:apply-templates select="." mode = "semantics">
1148 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1149 <xsl:with-param name="PAREN" select="$PAREN"/>
1150 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1151 </xsl:apply-templates>
1155 <xsl:template match = "m:apply[m:not[1]]">
1157 <xsl:call-template name="insert_xref"/>
1158 <m:mo><xsl:call-template name="insert1"/>not</m:mo>
1159 <xsl:apply-templates select = "*[2]" mode = "semantics">
1160 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1161 </xsl:apply-templates>
1165 <xsl:template match = "m:apply[m:forall[1]]">
1167 <xsl:call-template name="insert_xref"/>
1168 <m:mo><xsl:call-template name="insert1"/>for all</m:mo>
1169 <m:mfenced separators=",">
1170 <xsl:for-each select = "m:bvar">
1171 <xsl:apply-templates select = "." mode="semantics"/>
1174 <xsl:if test="m:condition">
1176 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1179 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
1183 <xsl:template match = "m:apply[m:exists[1]]">
1185 <xsl:call-template name="insert_xref"/>
1186 <m:mo><xsl:call-template name="insert1"/> <mchar name="Exists"/> </m:mo>
1187 <m:mfenced separators=",">
1188 <xsl:for-each select = "m:bvar">
1189 <xsl:apply-templates select = "." mode="semantics"/>
1192 <xsl:if test="m:condition">
1194 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1197 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
1201 <xsl:template match = "m:apply[m:abs[1]]">
1202 <xsl:if test="not(parent::m:apply[m:power[1]])">
1203 <m:mfenced open="|" close="|" separators="">
1204 <xsl:call-template name="insert_xref"/>
1205 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1208 <xsl:if test="parent::m:apply[m:power[1]]">
1210 <m:mfenced open="|" close="|" separators="">
1211 <xsl:call-template name="insert_xref"/>
1212 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1214 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1219 <xsl:template match = "m:apply[m:conjugate[1]]">
1222 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
1224 <m:mo><xsl:call-template name="insert1"/> <mchar name="UnderBar"/> </m:mo>
1228 <xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
1230 <xsl:call-template name="insert_xref"/>
1232 <xsl:when test="m:arg">
1233 <m:mo><xsl:call-template name="insert1"/>arg</m:mo>
1235 <xsl:when test="m:real">
1236 <m:mo><xsl:call-template name="insert1"/>Real</m:mo>
1238 <xsl:when test="m:imaginary">
1239 <m:mo><xsl:call-template name="insert1"/>Imaginary</m:mo>
1242 <m:mfenced separators="">
1243 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1251 <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]">
1253 <xsl:call-template name="insert_xref"/>
1254 <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">
1255 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1256 <xsl:if test="*[1]=m:neq">
1257 <m:mo><xsl:call-template name="insert1"/> <mchar name="NotEqual"/> </m:mo>
1259 <xsl:if test="*[1]=m:approx">
1260 <m:mo><xsl:call-template name="insert1"/> <mchar name="approxeq"/> </m:mo>
1262 <xsl:if test="*[1]=m:tendsto">
1263 <m:mo><xsl:call-template name="insert1"/> <mchar name="RightArrow"/> </m:mo>
1265 <xsl:if test="*[1]=m:implies">
1266 <m:mo><xsl:call-template name="insert1"/> <mchar name="DoubleRightArrow"/> </m:mo>
1268 <xsl:if test="*[1]=m:in">
1269 <m:mo><xsl:call-template name="insert1"/>
1270 <mchar name="Element"/>
1273 <xsl:if test="*[1]=m:notin">
1274 <m:mo><xsl:call-template name="insert1"/> <mchar name="NotElement"/> </m:mo>
1276 <xsl:if test="*[1]=m:notsubset">
1277 <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubset"/> </m:mo>
1279 <xsl:if test="*[1]=m:notprsubset">
1280 <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubsetEqual"/> </m:mo>
1282 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1283 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
1284 <m:mo><xsl:call-template name="insert1"/>-</m:mo>
1286 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
1287 <m:mo><xsl:call-template name="insert1"/>+</m:mo>
1290 <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">
1291 <xsl:apply-templates select = "*[2]" mode="semantics"/>
1292 <xsl:for-each select = "*[position()>2]">
1293 <xsl:if test="../*[self::m:subset][1]">
1294 <m:mo> <xsl:call-template name="insert2"/> <mchar name="SubsetEqual"/> </m:mo>
1296 <xsl:if test="../*[self::m:prsubset][1]">
1297 <m:mo> <xsl:call-template name="insert2"/><mchar name="subset"/> </m:mo>
1299 <xsl:if test="../*[self::m:eq][1]">
1300 <m:mo><xsl:call-template name="insert2"/>=</m:mo>
1302 <xsl:if test="../*[self::m:gt][1]">
1303 <m:mo><xsl:call-template name="insert2"/>></m:mo>
1305 <xsl:if test="../*[self::m:lt][1]">
1306 <m:mo><xsl:call-template name="insert2"/><</m:mo>
1308 <xsl:if test="../*[self::m:geq][1]">
1309 <m:mo><xsl:call-template name="insert2"/> <mchar name="geq"/> </m:mo>
1311 <xsl:if test="../*[self::m:leq][1]">
1312 <m:mo><xsl:call-template name="insert2"/> <mchar name="leq"/> </m:mo>
1314 <xsl:if test="../*[self::m:equivalent][1]">
1315 <m:mo><xsl:call-template name="insert2"/> <mchar name="Congruent"/> </m:mo>
1317 <xsl:apply-templates select = "." mode="semantics"/>
1326 <xsl:template match = "m:apply[*[1][self::m:ln]]">
1328 <xsl:call-template name="insert_xref"/>
1330 <xsl:when test="parent::m:apply[m:power[1]]">
1332 <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
1333 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1337 <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
1340 <xsl:apply-templates select = "*[2]" mode = "semantics">
1341 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1342 </xsl:apply-templates>
1346 <xsl:template match = "m:apply[m:log[1]]">
1348 <xsl:call-template name="insert_xref"/>
1350 <xsl:when test="parent::m:apply[m:power[1]]">
1351 <xsl:if test="not(*[2]=m:logbase)">
1353 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1354 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1357 <xsl:if test="*[2]=m:logbase">
1359 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1360 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1361 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
1366 <xsl:if test="not(*[2]=m:logbase)">
1367 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1369 <xsl:if test="*[2]=m:logbase">
1371 <m:mo><xsl:call-template name="insert1"/>log</m:mo>
1372 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
1377 <xsl:if test="*[2]=m:logbase">
1378 <xsl:apply-templates select = "*[3]" mode = "semantics">
1379 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1380 </xsl:apply-templates>
1382 <xsl:if test="not(*[2]=m:logbase)">
1383 <xsl:apply-templates select = "*[2]" mode = "semantics">
1384 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1385 </xsl:apply-templates>
1390 <xsl:template match = "m:apply[m:diff[1]]">
1392 <xsl:call-template name="insert_xref"/>
1393 <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
1394 <m:mfrac><xsl:call-template name="insert1"/>
1397 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
1402 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
1403 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
1408 <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
1409 <m:mfrac><xsl:call-template name="insert1"/>
1413 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
1417 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1421 <xsl:template match = "m:apply[m:partialdiff[1]]">
1423 <xsl:call-template name="insert_xref"/>
1424 <xsl:for-each select = "m:bvar">
1425 <xsl:if test="*[last()]=m:degree">
1426 <m:mfrac><xsl:call-template name="insert1"/>
1429 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
1434 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
1435 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
1440 <xsl:if test="not(*[last()]=m:degree)">
1441 <m:mfrac><xsl:call-template name="insert1"/>
1445 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
1450 <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
1454 <xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
1455 <xsl:apply-templates mode = "semantics"/>
1458 <xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
1460 <xsl:call-template name="insert_xref"/>
1461 <xsl:if test="*[1]=m:divergence">
1462 <m:mo><xsl:call-template name="insert1"/>div</m:mo>
1464 <xsl:if test="*[1]=m:grad">
1465 <m:mo><xsl:call-template name="insert1"/>grad</m:mo>
1467 <xsl:if test="*[1]=m:curl">
1468 <m:mo><xsl:call-template name="insert1"/>curl</m:mo>
1471 <xsl:when test="*[2]=m:ci">
1472 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1475 <m:mfenced separators="">
1476 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1483 <xsl:template match = "m:apply[m:laplacian[1]]">
1485 <xsl:call-template name="insert_xref"/>
1486 <m:msup><xsl:call-template name="insert1"/>
1487 <m:mo> Δ </m:mo>
1490 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1497 <xsl:template match = "m:set | m:list">
1498 <m:mfenced open="{{" close="}}" separators="">
1499 <xsl:call-template name="insert_xref"/>
1500 <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
1501 <xsl:apply-templates select="m:bvar" mode = "semantics"/>
1503 <xsl:apply-templates select="m:condition" mode = "semantics"/>
1505 <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
1506 <m:mfenced open="" close="" separators=",">
1507 <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
1508 <xsl:apply-templates select = "." mode="semantics"/>
1512 <xsl:apply-templates select="m:condition" mode = "semantics"/>
1514 <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
1515 <m:mfenced open="" close="" separators=",">
1516 <xsl:for-each select = "*">
1517 <xsl:apply-templates select = "." mode="semantics"/>
1524 <xsl:template match = "m:apply[m:union[1]]">
1525 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1526 <xsl:param name="PARAM" select="$NO_PARAM"/>
1527 <xsl:param name="PAREN" select="$PAR_NO"/>
1528 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1530 <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC and $PARAM=$PAR_SAME">
1531 <m:mfenced separators="" helm:xref="{@helm:xref}">
1532 <xsl:call-template name="insert_xref"/>
1533 <xsl:apply-templates select="." mode="union">
1534 <xsl:with-param name="PARAM" select="$PARAM"/>
1535 <xsl:with-param name="PAREN" select="$PAREN"/>
1536 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1537 </xsl:apply-templates>
1540 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1541 <xsl:apply-templates select="." mode="union">
1542 <xsl:with-param name="PARAM" select="$PARAM"/>
1543 <xsl:with-param name="PAREN" select="$PAREN"/>
1544 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1545 </xsl:apply-templates>
1549 <xsl:call-template name="insert_xref"/>
1550 <xsl:apply-templates select="." mode="union">
1551 <xsl:with-param name="PARAM" select="$PARAM"/>
1552 <xsl:with-param name="PAREN" select="$PAREN"/>
1553 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1554 </xsl:apply-templates>
1560 <xsl:template match = "m:apply[m:union[1]]" mode="union">
1561 <xsl:param name="PARAM" select="$NO_PARAM"/>
1562 <xsl:param name="PAREN" select="$PAR_NO"/>
1563 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1564 <xsl:apply-templates select = "*[2]" mode="semantics">
1565 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
1566 <xsl:with-param name="PARAM" select="$PARAM"/>
1567 <xsl:with-param name="PAREN" select="$PAREN"/>
1568 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1569 </xsl:apply-templates>
1570 <xsl:for-each select = "*[position()>2]">
1571 <m:mo><xsl:call-template name="insert2"/> <mchar name="Union"/> </m:mo>
1572 <xsl:apply-templates select = "." mode="semantics">
1573 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
1574 <xsl:with-param name="PAREN" select="$PAREN"/>
1575 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1576 </xsl:apply-templates>
1580 <xsl:template match = "m:apply[m:intersect[1]]">
1581 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1582 <xsl:param name="PARAM" select="$NO_PARAM"/>
1583 <xsl:param name="PAREN" select="$PAR_NO"/>
1584 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1586 <xsl:when test="$IN_PREC > $INTERSECT_PREC">
1587 <m:mfenced separators="" helm:xref="{@helm:xref}">
1588 <xsl:call-template name="insert_xref"/>
1589 <xsl:apply-templates select="." mode="intersect">
1590 <xsl:with-param name="PARAM" select="$PARAM"/>
1591 <xsl:with-param name="PAREN" select="$PAREN"/>
1592 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1593 </xsl:apply-templates>
1596 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1597 <xsl:apply-templates select="." mode="intersect">
1598 <xsl:with-param name="PARAM" select="$PARAM"/>
1599 <xsl:with-param name="PAREN" select="$PAREN"/>
1600 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1601 </xsl:apply-templates>
1605 <xsl:call-template name="insert_xref"/>
1606 <xsl:apply-templates select="." mode="intersect">
1607 <xsl:with-param name="PARAM" select="$PARAM"/>
1608 <xsl:with-param name="PAREN" select="$PAREN"/>
1609 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1610 </xsl:apply-templates>
1616 <xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
1617 <xsl:param name="PARAM" select="$NO_PARAM"/>
1618 <xsl:param name="PAREN" select="$PAR_NO"/>
1619 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1620 <xsl:apply-templates select = "*[2]" mode="semantics">
1621 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
1622 <xsl:with-param name="PARAM" select="$PARAM"/>
1623 <xsl:with-param name="PAREN" select="$PAREN"/>
1624 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1625 </xsl:apply-templates>
1626 <xsl:for-each select = "*[position()>2]">
1627 <m:mo><xsl:call-template name="insert2"/> <mchar name="Intersection"/> </m:mo>
1628 <xsl:apply-templates select = "." mode="semantics">
1629 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
1630 <xsl:with-param name="PAREN" select="$PAREN"/>
1631 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1632 </xsl:apply-templates>
1636 <xsl:template match = "m:apply[m:setdiff[1]]">
1637 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1638 <xsl:param name="PARAM" select="$NO_PARAM"/>
1639 <xsl:param name="PAREN" select="$PAR_NO"/>
1640 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1642 <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC and $PARAM=$PAR_SAME">
1643 <m:mfenced separators="">
1644 <xsl:call-template name="insert_xref"/>
1645 <xsl:apply-templates select="." mode="setdiff">
1646 <xsl:with-param name="PARAM" select="$PARAM"/>
1647 <xsl:with-param name="PAREN" select="$PAREN"/>
1648 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1649 </xsl:apply-templates>
1652 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC and not($SEM_SW=2)">
1653 <xsl:apply-templates select="." mode="setdiff">
1654 <xsl:with-param name="PARAM" select="$PARAM"/>
1655 <xsl:with-param name="PAREN" select="$PAREN"/>
1656 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1657 </xsl:apply-templates>
1661 <xsl:call-template name="insert_xref"/>
1662 <xsl:apply-templates select="." mode="setdiff">
1663 <xsl:with-param name="PARAM" select="$PARAM"/>
1664 <xsl:with-param name="PAREN" select="$PAREN"/>
1665 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1666 </xsl:apply-templates>
1672 <xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
1673 <xsl:param name="PARAM" select="$NO_PARAM"/>
1674 <xsl:param name="PAREN" select="$PAR_NO"/>
1675 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1676 <xsl:apply-templates select = "*[2]" mode = "semantics">
1677 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
1678 <xsl:with-param name="PARAM" select="$PARAM"/>
1679 <xsl:with-param name="PAREN" select="$PAREN"/>
1680 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1681 </xsl:apply-templates>
1682 <m:mo><xsl:call-template name="insert1"/>\</m:mo>
1683 <xsl:apply-templates select = "*[3]" mode = "semantics">
1684 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
1685 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1686 <xsl:with-param name="PAREN" select="$PAREN"/>
1687 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1688 </xsl:apply-templates>
1691 <xsl:template match = "m:apply[m:card[1]]">
1692 <m:mfenced open="|" close="|" separators=",">
1693 <xsl:call-template name="insert_xref"/>
1694 <xsl:for-each select = "*[position()>1]">
1695 <xsl:apply-templates select = "." mode="semantics"/>
1701 <!-- SEQUENCES AND SERIES -->
1703 <xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
1705 <xsl:call-template name="insert_xref"/>
1707 <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
1709 <xsl:if test="*[1]=m:sum">
1710 <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
1712 <xsl:if test="*[1]=m:product">
1713 <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
1716 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1718 <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
1720 <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
1722 <xsl:apply-templates select = "*[5]" mode = "semantics"/>
1724 <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
1726 <xsl:if test="*[1]=m:sum">
1727 <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
1729 <xsl:if test="*[1]=m:product">
1730 <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
1732 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1734 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
1740 <xsl:template match = "m:apply[m:limit[1]]">
1742 <xsl:call-template name="insert_xref"/>
1744 <m:mo><xsl:call-template name="insert1"/>lim</m:mo>
1746 <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
1747 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1748 <m:mo> <mchar name="RightArrow"/> </m:mo>
1749 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1751 <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
1752 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1756 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
1761 <!-- TRIGONOMETRY -->
1763 <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]]">
1765 <xsl:call-template name="insert_xref"/>
1766 <xsl:if test="not(parent::m:apply[m:power[1]])">
1767 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
1769 <xsl:if test="parent::m:apply[m:power[1]]">
1771 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
1772 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1775 <xsl:apply-templates select = "*[2]" mode = "semantics">
1776 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1777 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1778 </xsl:apply-templates>
1782 <xsl:template match = "m:*" mode = "trigonometry">
1784 <xsl:when test="self::m:sin">
1787 <xsl:when test="self::m:cos">
1790 <xsl:when test="self::m:tan">
1793 <xsl:when test="self::m:sec">
1796 <xsl:when test="self::m:csc">
1799 <xsl:when test="self::m:cot">
1802 <xsl:when test="self::m:sinh">
1805 <xsl:when test="self::m:cosh">
1808 <xsl:when test="self::m:tanh">
1811 <xsl:when test="self::m:sech">
1814 <xsl:when test="self::m:csch">
1817 <xsl:when test="self::m:coth">
1820 <xsl:when test="self::m:arcsin">
1823 <xsl:when test="self::m:arccos">
1826 <xsl:when test="self::m:arctan">
1835 <xsl:template match = "m:apply[m:mean[1]]">
1836 <m:mfenced open="<" close=">" separators=",">
1837 <xsl:call-template name="insert_xref"/>
1838 <xsl:for-each select = "*[position()>1]">
1839 <xsl:apply-templates select = "." mode="semantics"/>
1844 <xsl:template match = "m:apply[m:sdev[1]]">
1846 <xsl:call-template name="insert_xref"/>
1847 <m:mo><xsl:call-template name="insert1"/> σ </m:mo>
1848 <m:mfenced separators=",">
1849 <xsl:for-each select = "*[position()>1]">
1850 <xsl:apply-templates select = "." mode="semantics"/>
1856 <xsl:template match = "m:apply[m:variance[1]]">
1858 <xsl:call-template name="insert_xref"/>
1859 <m:mo><xsl:call-template name="insert1"/> σ </m:mo>
1861 <m:mfenced separators=",">
1862 <xsl:for-each select = "*[position()>1]">
1863 <xsl:apply-templates select = "." mode="semantics"/>
1871 <xsl:template match = "m:apply[m:median[1]]">
1873 <xsl:call-template name="insert_xref"/>
1874 <m:mo><xsl:call-template name="insert1"/>median</m:mo>
1875 <m:mfenced separators=",">
1876 <xsl:for-each select = "*[position()>1]">
1877 <xsl:apply-templates select = "." mode="semantics"/>
1883 <xsl:template match = "m:apply[m:mode[1]]">
1885 <xsl:call-template name="insert_xref"/>
1886 <m:mo><xsl:call-template name="insert1"/>mode</m:mo>
1887 <m:mfenced separators=",">
1888 <xsl:for-each select = "*[position()>1]">
1889 <xsl:apply-templates select = "." mode="semantics"/>
1895 <xsl:template match = "m:apply[m:moment[1]]">
1896 <xsl:call-template name="insert_xref"/>
1897 <m:mfenced open="<" close=">" separators="">
1898 <xsl:if test="*[2]=m:degree">
1900 <xsl:apply-templates select="*[3]" mode = "semantics"/>
1901 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1904 <xsl:if test="not(*[2]=m:degree)">
1905 <xsl:for-each select = "*[position()>1]">
1906 <xsl:apply-templates select = "." mode="semantics"/>
1913 <!-- LINEAR ALGEBRA -->
1915 <xsl:template match="m:vector">
1916 <m:mfenced separators="">
1918 <xsl:for-each select="*">
1920 <xsl:apply-templates select="." mode = "semantics"/>
1927 <xsl:template match = "m:matrix">
1928 <m:mfenced separators="">
1930 <xsl:apply-templates mode = "semantics"/>
1935 <xsl:template match = "m:matrixrow">
1937 <xsl:for-each select="*">
1939 <xsl:apply-templates select="." mode = "semantics"/>
1945 <xsl:template match = "m:apply[m:determinant[1]]">
1947 <xsl:call-template name="insert_xref"/>
1948 <m:mo><xsl:call-template name="insert1"/>det</m:mo>
1949 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1953 <xsl:template match = "m:apply[m:transpose[1]]">
1955 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1960 <xsl:template match = "m:apply[m:selector[1]]">
1961 <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
1962 <xsl:variable name="m" select = "*[3]"/>
1964 <xsl:when test="*[4]=m:cn">
1965 <xsl:variable name="n" select = "*[4]"/>
1966 <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
1969 <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
1973 <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
1974 <xsl:variable name="m" select = "*[3]"/>
1975 <xsl:copy-of select = "*[2]/*[position()=$m]"/>
1979 <xsl:template match = "m:apply[m:vectorproduct[1] | m:scalarproduct[1] | m:outerproduct[1]]">
1981 <xsl:call-template name="insert_xref"/>
1982 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1984 <xsl:when test="m:vectorproduct[1]">
1985 <m:mo><xsl:call-template name="insert1"/> <mchar name="Cross"/> </m:mo>
1987 <xsl:when test="m:scalarproduct[1] | m:outerproduct[1]">
1988 <m:mo><xsl:call-template name="insert1"/>.</m:mo>
1991 <xsl:apply-templates select="*[3]" mode = "semantics"/>