3 <!-- ******************************************************** -->
4 <!-- XSL Transform of MathML content to MathML presentation -->
6 <!-- Authors Igor Rodionov <igor@csd.uwo.ca>, -->
7 <!-- Stephen Watt <watt@csd.uwo.ca>. -->
9 <!-- (C) Copyright 2000 Symbolic Computation Laboratory, -->
10 <!-- University of Western Ontario, -->
11 <!-- London, Canada N6A 5B7. -->
13 <!-- ******************************************************** -->
14 <!-- Updated Nov. 2001 by: -->
15 <!-- S. Huerter <huerter@csd.uwo.ca>. -->
17 <!-- Complies with the W3C MathML 2.0 Recommendation of -->
18 <!-- 21 February 2001. -->
19 <!-- ******************************************************** -->
21 <!-- ====================================================== -->
22 <!-- April, 10 2002 - HELM group: -->
23 <!-- Added the namespace prefix to all the output elements -->
24 <!-- Changed the mml prefix into m -->
25 <!-- Added xref to every mo element -->
26 <!-- New csymbol template -->
27 <!-- reln is not supported -->
28 <!-- First draft: April 10 2002, Irene Schena -->
29 <!-- ====================================================== -->
31 <xsl:stylesheet id="mmlctop.xsl"
33 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34 xmlns:m="http://www.w3.org/1998/Math/MathML">
36 <!-- HELM: we don't have a default namespace.
37 Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
40 <xsl:output method="xml" indent="yes"/>
42 <xsl:output method="xml"/>
44 <xsl:strip-space elements="apply semantics annotation-xml
45 csymbol fn cn ci interval matrix matrixrow vector
46 lambda bvar condition logbase degree set list
50 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
51 <!-- Parameters, variables and constants -->
52 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
54 <!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
56 <!-- Strip off semantics -->
57 <xsl:variable name="SEM_STRIP" select="-1"/>
59 <!-- Pass semantics "as is" -->
60 <xsl:variable name="SEM_PASS" select="0"/>
62 <!-- Add semantics at top level only -->
63 <xsl:variable name="SEM_TOP" select="1"/>
65 <!-- Add semantics at all levels -->
66 <xsl:variable name="SEM_ALL" select="2"/>
68 <!-- Semantics at top level only, with id refs -->
69 <!-- NOTE: ids have to be already present in the
70 input for this feature to work. -->
71 <xsl:variable name="SEM_XREF" select="3"/>
73 <!-- No semantics at top level, with id refs -->
74 <!-- NOTE: ids have to be already present in the
75 input for this feature to work. -->
76 <xsl:variable name="SEM_XREF_EXT" select="4"/>
79 <!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
80 <!-- Assumes one of the above values; SEM_PASS is the default -->
81 <!-- The default can be overridden by specifying different -->
82 <!-- value on the command line when the stylesheet is invoked -->
84 <!-- HELM: $SEM_SW was SEM_PASS (error!) -->
85 <xsl:param name="SEM_SW" select="$SEM_XREF"/>
88 <!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
89 <xsl:variable name="UNION_OP" select="2"/>
90 <xsl:variable name="INTERSECT_OP" select="6"/>
91 <xsl:variable name="SETDIFF_OP" select="4"/>
92 <xsl:variable name="NO_PREC" select="0"/>
93 <xsl:variable name="UNION_PREC" select="1"/>
94 <xsl:variable name="SETDIFF_PREC" select="1"/>
95 <xsl:variable name="INTERSECT_PREC" select="3"/>
96 <xsl:variable name="CARTPROD_PREC" select="3"/>
97 <xsl:variable name="OR_PREC" select="5"/>
98 <xsl:variable name="XOR_PREC" select="5"/>
99 <xsl:variable name="AND_PREC" select="7"/>
100 <xsl:variable name="PLUS_PREC" select="9"/>
101 <xsl:variable name="MINUS_PREC" select="9"/>
102 <xsl:variable name="MUL_PREC" select="11"/>
103 <xsl:variable name="DIV_PREC" select="11"/>
104 <xsl:variable name="NEG_PREC" select="13"/>
105 <xsl:variable name="FUNCTION_PREC" select="99"/>
107 <!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
109 <xsl:variable name="YES" select="1"/>
110 <xsl:variable name="NO" select="0"/>
111 <xsl:variable name="NO_PARAM" select="-1"/>
112 <xsl:variable name="PAR_SAME" select="-3"/>
113 <xsl:variable name="PAR_YES" select="-5"/>
114 <xsl:variable name="PAR_NO" select="-7"/>
115 <xsl:variable name="DOESNT_MATTER" select="-9"/>
117 <!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
119 <!-- All templates are subdivided into the following categories
120 (listed in the order of appearance in the stylesheet):
122 THE TOPMOST ELEMENT: MATH
128 BASIC CONTAINER ELEMENTS
131 BASIC CONTENT ELEMENTS
132 fn, interval, inverse, sep, condition, declare, lambda, compose, ident
134 *NEW: apply, piecewise, domain, codomain, image
136 ARITHMETIC, ALGEBRA & LOGIC
137 quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
138 times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate,
141 *NEW: floor, ceiling, lcm
144 neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
145 subset, prsubset, eq, gt, lt, geq, leq, equivalent
148 ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
149 logbase, divergence, grad, curl, laplacian
152 set, list, union, intersect, setdiff, card
154 *NEW: cartesianproduct
162 sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
163 arcsin, arccos, arctan
165 *NEW: arcsec, arccsc, arccot, arcsinh, arccosh, arctanh,
166 arcsech, arccsch, arccoth,
169 mean, sdev, variance, median, mode, moment
172 vector, matrix, matrixrow, determinant, transpose, selector,
173 vectorproduct, scalarproduct, outerproduct
177 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
178 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
179 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
182 <!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
184 <xsl:template match = "m:math">
185 <!-- HELM: <m:math> -->
187 <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or $SEM_SW=$SEM_XREF"> <m:semantics>
189 <xsl:apply-templates mode = "semantics"/>
191 <m:annotation-xml encoding="MathML">
192 <xsl:copy-of select="*"/>
198 <xsl:apply-templates mode = "semantics"/>
202 <!-- HELM: </m:math> -->
206 <!-- ***************** SEMANTICS HANDLING ***************** -->
208 <!-- This template is called recursively. At each level -->
209 <!-- in the source tree it decides whether to strip off, -->
210 <!-- pass or add semantics at that level (depending on the -->
211 <!-- value of SEM_SW parameter). Then the actual template -->
212 <!-- is applied to the node. -->
214 <xsl:template match = "m:*" mode = "semantics">
215 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
216 <xsl:param name="IN_PREC" select="$NO_PREC"/>
217 <xsl:param name="PARAM" select="$NO_PARAM"/>
218 <xsl:param name="PAREN" select="$PAR_NO"/>
219 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
221 <xsl:when test="$SEM_SW=$SEM_STRIP and self::m:semantics">
222 <xsl:apply-templates select="m:annotation-xml[@encoding='MathML']">
223 <xsl:with-param name="IN_OP" select="$IN_OP"/>
224 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
225 <xsl:with-param name="PARAM" select="$PARAM"/>
226 <xsl:with-param name="PAREN" select="$PAREN"/>
227 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
228 </xsl:apply-templates>
230 <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::m:semantics">
232 <xsl:apply-templates select="*[1]">
233 <xsl:with-param name="IN_OP" select="$IN_OP"/>
234 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
235 <xsl:with-param name="PARAM" select="$PARAM"/>
236 <xsl:with-param name="PAREN" select="$PAREN"/>
237 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
238 </xsl:apply-templates>
239 <xsl:copy-of select="m:annotation-xml"/>
242 <xsl:when test="$SEM_SW=$SEM_ALL">
245 <xsl:when test="self::m:semantics">
246 <xsl:apply-templates select="*[1]">
247 <xsl:with-param name="IN_OP" select="$IN_OP"/>
248 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
249 <xsl:with-param name="PARAM" select="$PARAM"/>
250 <xsl:with-param name="PAREN" select="$PAREN"/>
251 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
252 </xsl:apply-templates>
253 <xsl:copy-of select="m:annotation-xml"/>
256 <xsl:apply-templates select=".">
257 <xsl:with-param name="IN_OP" select="$IN_OP"/>
258 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
259 <xsl:with-param name="PARAM" select="$PARAM"/>
260 <xsl:with-param name="PAREN" select="$PAREN"/>
261 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
262 </xsl:apply-templates>
263 <m:annotation-xml encoding="MathML">
264 <xsl:copy-of select="."/>
270 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
272 <!-- HELM: syntax error, was sematics -->
273 <xsl:when test="self::m:semantics">
275 <xsl:copy-of select="@*"/>
276 <xsl:attribute name="xref">
277 <xsl:value-of select="@id"/>
279 <xsl:copy-of select="*[1]"/>
280 <xsl:copy-of select="m:annotation-xml"/>
284 <xsl:apply-templates select=".">
285 <xsl:with-param name="IN_OP" select="$IN_OP"/>
286 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
287 <xsl:with-param name="PARAM" select="$PARAM"/>
288 <xsl:with-param name="PAREN" select="$PAREN"/>
289 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
290 </xsl:apply-templates>
296 <xsl:when test="self::m:semantics">
297 <xsl:copy-of select="."/>
300 <xsl:apply-templates select=".">
301 <xsl:with-param name="IN_OP" select="$IN_OP"/>
302 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
303 <xsl:with-param name="PARAM" select="$PARAM"/>
304 <xsl:with-param name="PAREN" select="$PAREN"/>
305 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
306 </xsl:apply-templates>
313 <xsl:template match = "m:semantics">
314 <xsl:apply-templates select="." mode = "semantics"/>
318 <!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
320 <xsl:template match = "m:cn">
321 <xsl:param name="IN_PREC" select="$NO_PREC"/>
322 <xsl:param name="PAREN" select="$PAR_NO"/>
323 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
325 <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
326 and $PAR_NO_IGNORE=$NO">
327 <m:mfenced separators="">
328 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
329 <xsl:attribute name="xref">
330 <xsl:value-of select="@id"/>
333 <xsl:apply-templates select="." mode="cn"/>
338 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
339 <xsl:apply-templates select="." mode="cnid"/>
342 <xsl:apply-templates select="." mode="cn"/>
349 <!-- HELM: the entity ⁢ is not defined -->
350 <xsl:template match = "m:cn" mode="cn">
352 <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
354 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
355 <m:mn> <xsl:value-of select="@base"/> </m:mn>
358 <xsl:when test="@type='e-notation' and not(@base) and child::m:sep[1]">
359 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
360 <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
362 <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
363 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
365 <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
366 <m:mfenced separators="">
367 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
368 <xsl:if test="text()[2] < 0">
370 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
372 <xsl:if test="not(text()[2] < 0)">
374 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
376 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
380 <xsl:when test="@type='complex' and @base and child::m:sep[1]">
382 <m:mfenced separators="">
383 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
384 <xsl:if test="text()[2] < 0">
386 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
388 <xsl:if test="not(text()[2] < 0)">
390 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
392 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
395 <m:mn> <xsl:value-of select="@base"/> </m:mn>
398 <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
400 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
401 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
404 <xsl:when test="@type='rational' and @base and child::m:sep[1]">
408 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
409 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
412 <m:mn> <xsl:value-of select="@base"/> </m:mn>
415 <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
418 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
419 <m:mfenced separators=",">
420 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
421 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
425 <xsl:when test="@type='polar' and @base and child::m:sep[1]">
429 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
430 <m:mfenced separators=",">
431 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
432 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
435 <m:mn> <xsl:value-of select="@base"/> </m:mn>
439 <!-- HELM: cn could contain MathML presentation -->
441 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
444 <xsl:when test="child::text() and not(*[1])">
445 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
449 <xsl:when test="not(*[2])">
450 <xsl:copy-of select="*[1]"/>
454 <xsl:copy-of select="*|text()"/>
465 <xsl:template match = "m:cn" mode="cnid">
467 <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
468 <m:msub xref="{@id}">
469 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
470 <m:mn> <xsl:value-of select="@base"/> </m:mn>
473 <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
474 <m:mfenced separators="" xref="{@id}">
475 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
476 <xsl:if test="text()[2] < 0">
478 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
480 <xsl:if test="not(text()[2] < 0)">
482 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
484 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
488 <xsl:when test="@type='complex' and @base and child::m:sep[1]">
489 <m:msub xref="{@id}">
490 <m:mfenced separators="">
491 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
492 <xsl:if test="text()[2] < 0">
494 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
496 <xsl:if test="not(text()[2] < 0)">
498 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
500 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
503 <m:mn> <xsl:value-of select="@base"/> </m:mn>
506 <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
507 <m:mfrac xref="{@id}">
508 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
509 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
512 <xsl:when test="@type='rational' and @base and child::m:sep[1]">
513 <m:msub xref="{@id}">
516 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
517 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
520 <m:mn> <xsl:value-of select="@base"/> </m:mn>
523 <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
524 <m:mrow xref="{@id}">
526 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
527 <m:mfenced separators=",">
528 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
529 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
533 <xsl:when test="@type='polar' and @base and child::m:sep[1]">
534 <m:msub xref="{@id}">
537 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
538 <m:mfenced separators=",">
539 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
540 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
543 <m:mn> <xsl:value-of select="@base"/> </m:mn>
547 <!-- HELM: cn could contain MathML presentation -->
549 <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
552 <xsl:when test="child::text() and not(*[1])">
553 <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
556 <xsl:variable name="id" select="@id"/>
558 <xsl:when test="not(*[2])">
559 <xsl:for-each select="*[1]">
561 <xsl:attribute name="xref">
562 <xsl:value-of select="$id"/>
564 <xsl:copy-of select="@*|*"/>
569 <m:mrow xref="{$id}">
570 <xsl:copy-of select="*|text()"/>
581 <xsl:template match = "m:ci">
583 <xsl:when test="@type='vector' or @type=matrix or @type=set">
584 <m:mi mathvariant="bold">
585 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
586 <xsl:attribute name="xref">
587 <xsl:value-of select="@id"/>
590 <xsl:apply-templates mode = "semantics"/>
593 <xsl:when test="child::text() and not(child::*[1])">
595 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
596 <xsl:attribute name="xref">
597 <xsl:value-of select="@id"/>
600 <!-- HELM: ERROR, added mode="semantics", it didn't generate identifiers -->
601 <xsl:apply-templates mode = "semantics"/>
604 <!-- HELM: text & markup !!! Not compliant with the specification -->
605 <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
607 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
608 <xsl:attribute name="xref">
609 <xsl:value-of select="@id"/>
612 <!-- HELM: added semantics mode -->
613 <xsl:apply-templates mode="semantics"/>
620 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
621 <xsl:attribute name="xref">
622 <xsl:value-of select="@id"/>
625 <xsl:apply-templates select="*"/>
628 <xsl:if test="not(*[2])">
629 <!-- HELM: ci could contain MathML presentation -->
631 <xsl:apply-templates select="*[1]"/>
633 <xsl:variable name="id" select="@id"/>
634 <xsl:for-each select="*[1]">
636 <xsl:attribute name="xref">
637 <xsl:value-of select="$id"/>
639 <xsl:copy-of select="@*|*"/>
648 <xsl:template match = "m:ci/m:*[not(self::m:sep)]">
649 <xsl:copy-of select = "."/>
652 <!-- HELM: revised version previous Version x.xx from Feb. 18, 2000 -->
653 <xsl:template match = "m:csymbol">
654 <!-- HELM: mrow to maintain csymbol id -->
656 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
657 <xsl:attribute name="xref">
658 <xsl:value-of select="@id"/>
661 <xsl:for-each select="* and text()">
663 <xsl:when test="text()">
664 <m:mo><xsl:value-of select="."/></m:mo>
667 <xsl:copy-of select = "."/>
674 <!-- HELM: csymbol cannot contain ci or cn elements, but only text and/or
675 presentation elements. PCDATA should render as if it were wrapped in
676 an mo. Mixed content: mrow which contains mo + presentation elements -->
677 <!-- <xsl:template match = "m:csymbol/m:*">
679 <xsl:when test="self::m:cn or self::m:ci">
680 <xsl:apply-templates mode = "semantics"/>
683 <xsl:copy-of select = "."/>
688 <xsl:template match = "m:csymbol/text()">
690 <xsl:when test=". < 0 or . = 0 or . > 0">
691 <m:mn> <xsl:copy-of select = "."/> </m:mn>
694 <m:mi> <xsl:copy-of select = "."/> </m:mi>
700 <!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
702 <!-- HELM: the entity ⁡ is not defined: -->
703 <!-- fn and domainofapplication are rendered as their content -->
704 <xsl:template match = "m:apply[m:*[1][self::m:fn]]">
706 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
707 <xsl:attribute name="xref">
708 <xsl:value-of select="@id"/>
711 <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
713 <!-- HELM: xref added -->
714 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:fn/@id">
715 <xsl:attribute name="xref">
716 <xsl:value-of select="m:fn/@id"/>
718 </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
719 <m:mfenced separators=",">
720 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
725 <!-- fn has been deprecated, so now we use: -->
726 <xsl:template match = "m:apply">
728 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
729 <xsl:attribute name="xref">
730 <xsl:value-of select="@id"/>
734 <xsl:when test="*[2]=m:domainofapplication">
736 <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
737 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
738 </xsl:apply-templates>
739 <xsl:apply-templates select = "*[position()=2]" mode = "semantics"/>
742 <!-- HELM: xref added -->
743 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:domainofapplication/@id">
744 <xsl:attribute name="xref">
745 <xsl:value-of select="m:domainofapplication/@id"/>
747 </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
748 <m:mfenced separators=",">
749 <xsl:apply-templates select = "*[position()>2]" mode = "semantics"/>
753 <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
754 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
755 </xsl:apply-templates>
756 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
757 <m:mfenced separators=",">
758 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
765 <xsl:template match = "m:domainofapplication">
766 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
769 <xsl:template match = "m:fn">
770 <xsl:apply-templates select = "*[1]" mode = "semantics">
771 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
772 </xsl:apply-templates>
775 <xsl:template match = "m:interval">
776 <m:mfenced separators=",">
777 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
778 <xsl:attribute name="xref">
779 <xsl:value-of select="@id"/>
782 <xsl:if test="@closure='closed' or @closure='closed-open'">
783 <xsl:attribute name="open">[</xsl:attribute>
785 <xsl:if test="@closure='closed' or @closure='open-closed'">
786 <xsl:attribute name="close">]</xsl:attribute>
788 <xsl:apply-templates select="*" mode = "semantics"/>
792 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
794 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
795 <xsl:attribute name="xref">
796 <xsl:value-of select="@id"/>
799 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
800 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
801 <m:mfenced separators=",">
802 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
807 <xsl:template match = "m:apply[*[1][self::m:inverse]]">
809 <xsl:when test="*[2]=m:exp or *[2]=m:ln or *[2]=m:sin or *[2]=m:cos or
810 *[2]=m:tan or *[2]=m:sec or *[2]=m:csc or *[2]=m:cot or
811 *[2]=m:sinh or *[2]=m:cosh or *[2]=m:tanh or *[2]=m:sech or
812 *[2]=m:csch or *[2]=m:coth or *[2]=m:arcsin or
813 *[2]=m:arccos or *[2]=m:arctan">
815 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
816 <xsl:attribute name="xref">
817 <xsl:value-of select="@id"/>
820 <xsl:apply-templates select="*[2]" mode="inverse"/>
825 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
826 <xsl:attribute name="xref">
827 <xsl:value-of select="@id"/>
830 <xsl:apply-templates select = "*[2]"/>
832 <!-- HELM: xref added -->
833 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:inverse/@id">
834 <xsl:attribute name="xref">
835 <xsl:value-of select="m:inverse/@id"/>
845 <xsl:template match = "*" mode="inverse">
847 <xsl:when test="self::m:exp">
848 <xsl:value-of select="'ln'"/>
850 <xsl:when test="self::m:ln">
851 <xsl:value-of select="'exp'"/>
853 <xsl:when test="self::m:sin">
854 <xsl:value-of select="'arcsin'"/>
856 <xsl:when test="self::m:cos">
857 <xsl:value-of select="'arccos'"/>
859 <xsl:when test="self::m:tan">
860 <xsl:value-of select="'arctan'"/>
862 <xsl:when test="self::m:sec">
863 <xsl:value-of select="'arcsec'"/>
865 <xsl:when test="self::m:csc">
866 <xsl:value-of select="'arccsc'"/>
868 <xsl:when test="self::m:cot">
869 <xsl:value-of select="'arccot'"/>
871 <xsl:when test="self::m:sinh">
872 <xsl:value-of select="'arcsinh'"/>
874 <xsl:when test="self::m:cosh">
875 <xsl:value-of select="'arccosh'"/>
877 <xsl:when test="self::m:tanh">
878 <xsl:value-of select="'arctanh'"/>
880 <xsl:when test="self::m:sech">
881 <xsl:value-of select="'arcsech'"/>
883 <xsl:when test="self::m:csch">
884 <xsl:value-of select="'arccsch'"/>
886 <xsl:when test="self::m:coth">
887 <xsl:value-of select="'arccoth'"/>
889 <xsl:when test="self::m:arcsin">
890 <xsl:value-of select="'sin'"/>
892 <xsl:when test="self::m:arccos">
893 <xsl:value-of select="'cos'"/>
895 <xsl:when test="self::m:arctan">
896 <xsl:value-of select="'tan'"/>
901 <xsl:template match = "m:sep"/>
903 <xsl:template match = "m:condition">
905 <xsl:when test="parent::m:apply[m:forall[1]]"/>
908 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
909 <m:mrow xref="{@id}">
910 <xsl:apply-templates select="*" mode = "semantics"/>
914 <xsl:if test="not(*[2])">
915 <xsl:apply-templates select="*" mode = "semantics"/>
919 <xsl:apply-templates select="*" mode = "semantics"/>
928 <xsl:template match = "m:declare"/>
930 <xsl:template match = "m:lambda">
932 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
933 <xsl:attribute name="xref">
934 <xsl:value-of select="@id"/>
937 <m:mo><xsl:text disable-output-escaping='yes'>Λ</xsl:text> </m:mo>
938 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
939 <m:mfenced separators=",">
940 <xsl:for-each select = "*">
942 <xsl:when test="self::m:ci or self::m:cn">
943 <xsl:apply-templates select = "." mode="semantics"/>
947 <xsl:apply-templates select = "." mode="semantics"/>
956 <xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
958 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
959 <xsl:attribute name="xref">
960 <xsl:value-of select="@id"/>
963 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
964 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
965 <m:mfenced separators=",">
966 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
971 <xsl:template match = "m:apply[*[1][self::m:compose]]">
972 <m:mfenced separators="">
973 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
974 <xsl:attribute name="xref">
975 <xsl:value-of select="@id"/>
978 <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] |
979 self::m:fn]" mode="semantics"/>
980 <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] |
983 <!-- HELM: xref added -->
984 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:compose/@id">
985 <xsl:attribute name="xref">
986 <xsl:value-of select="../m:compose/@id"/>
988 </xsl:if><xsl:text disable-output-escaping='yes'>∘</xsl:text></m:mo>
989 <xsl:apply-templates select = "." mode="semantics"/>
994 <xsl:template match = "m:ident">
996 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
997 <m:mo xref="{@id}">id</m:mo>
1005 <xsl:template match="m:piecewise">
1007 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1008 <xsl:attribute name="xref">
1009 <xsl:value-of select="@id"/>
1012 <xsl:element name="m:mfenced">
1013 <xsl:attribute name="open">{</xsl:attribute>
1014 <xsl:attribute name="close"></xsl:attribute>
1015 <m:mtable groupalign="left left left">
1016 <xsl:for-each select="m:piece">
1017 <m:mtr columnalign="left">
1020 <xsl:apply-templates select="*[position()=1]" mode = "semantics"/>
1025 <m:mtext>if <m:mspace width="5"/></m:mtext>
1026 <xsl:apply-templates select="*[position()=2]" mode = "semantics"/>
1031 <xsl:if test="m:otherwise">
1032 <m:mtr columnalign="left">
1035 <xsl:apply-templates select="m:otherwise/*" mode = "semantics"/>
1050 <!-- HELM: was (it didn't match with prefixed MathML)
1051 <xsl:template match="m:apply[child::*[position()=1 and name()='domain']]">
1053 <xsl:template match="m:apply[child::*[position()=1 and self::m:domain]]">
1055 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1056 <xsl:attribute name="xref">
1057 <xsl:value-of select="@id"/>
1061 <m:mfenced open="(" close=")">
1062 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1067 <!-- HELM: was (it didn't match with prefixed MathML)
1068 <xsl:template match="m:apply[child::*[position()=1 and name()='codomain']]">
1070 <xsl:template match="m:apply[child::*[position()=1 and self::m:codomain]]">
1072 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1073 <xsl:attribute name="xref">
1074 <xsl:value-of select="@id"/>
1077 <m:mi>codomain</m:mi>
1078 <m:mfenced open="(" close=")">
1079 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1084 <!-- HELM: was (it didn't match with prefixed MathML)
1085 <xsl:template match="m:apply[child::*[position()=1 and name()='image']]">
1087 <xsl:template match="m:apply[child::*[position()=1 and self::m:image]]">
1089 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1090 <xsl:attribute name="xref">
1091 <xsl:value-of select="@id"/>
1095 <m:mfenced open="(" close=")">
1096 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1102 <!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
1104 <xsl:template match = "m:apply[m:quotient[1]]">
1106 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1107 <xsl:attribute name="xref">
1108 <xsl:value-of select="@id"/>
1111 <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">
1112 <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
1115 <!-- HELM: xref added -->
1116 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:quotient/@id">
1117 <xsl:attribute name="xref">
1118 <xsl:value-of select="m:quotient/@id"/>
1122 <xsl:apply-templates select="*[2]" mode = "semantics">
1123 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1124 </xsl:apply-templates>
1127 <xsl:apply-templates select="*[3]" mode = "semantics">
1128 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1129 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1130 </xsl:apply-templates>
1133 <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">
1134 <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
1139 <xsl:template match = "m:apply[*[1][self::m:exp]]">
1141 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1142 <xsl:attribute name="xref">
1143 <xsl:value-of select="@id"/>
1147 <!-- HELM: xref added -->
1148 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exp/@id">
1149 <xsl:attribute name="xref">
1150 <xsl:value-of select="m:exp/@id"/>
1153 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1157 <xsl:template match = "m:apply[m:factorial[1]]">
1159 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1160 <xsl:attribute name="xref">
1161 <xsl:value-of select="@id"/>
1164 <xsl:apply-templates select = "*[2]" mode = "semantics">
1165 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1166 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1167 </xsl:apply-templates>
1169 <!-- HELM: xref added -->
1170 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorial/@id">
1171 <xsl:attribute name="xref">
1172 <xsl:value-of select="m:factorial/@id"/>
1178 <xsl:template match = "m:apply[m:max[1] | m:min[1]]">
1180 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1181 <xsl:attribute name="xref">
1182 <xsl:value-of select="@id"/>
1185 <xsl:if test="*[2]=m:bvar">
1187 <xsl:if test="*[1]=m:max">
1189 <!-- HELM: xref added -->
1190 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1191 <xsl:attribute name="xref">
1192 <xsl:value-of select="m:max/@id"/>
1196 <xsl:if test="*[1]=m:min">
1198 <!-- HELM: xref added -->
1199 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1200 <xsl:attribute name="xref">
1201 <xsl:value-of select="m:min/@id"/>
1205 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1207 <xsl:if test="*[3]=m:condition">
1208 <m:mfenced open="{{" close="}}" separators="">
1209 <m:mfenced open="" close="" separators=",">
1210 <xsl:for-each select = "*[position()>3]">
1211 <xsl:apply-templates select = "." mode="semantics"/>
1215 <xsl:apply-templates select="*[3]" mode = "semantics"/>
1218 <xsl:if test="not(*[3]=m:condition)">
1219 <m:mfenced open="{{" close="}}" separators=",">
1220 <xsl:for-each select = "*[position()>2]">
1221 <xsl:apply-templates select = "." mode="semantics"/>
1226 <xsl:if test="*[2]=m:condition">
1227 <xsl:if test="*[1]=m:max">
1229 <!-- HELM: xref added -->
1230 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1231 <xsl:attribute name="xref">
1232 <xsl:value-of select="m:max/@id"/>
1236 <xsl:if test="*[1]=m:min">
1238 <!-- HELM: xref added -->
1239 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1240 <xsl:attribute name="xref">
1241 <xsl:value-of select="m:min/@id"/>
1245 <m:mfenced open="{{" close="}}" separators="">
1246 <xsl:if test="*[3]">
1247 <m:mfenced open="" close="" separators=",">
1248 <xsl:for-each select = "*[position()>2]">
1249 <xsl:apply-templates select = "." mode="semantics"/>
1254 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1257 <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
1258 <xsl:if test="*[1]=m:max">
1260 <!-- HELM: xref added -->
1261 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1262 <xsl:attribute name="xref">
1263 <xsl:value-of select="m:max/@id"/>
1267 <xsl:if test="*[1]=m:min">
1269 <!-- HELM: xref added -->
1270 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1271 <xsl:attribute name="xref">
1272 <xsl:value-of select="m:min/@id"/>
1276 <m:mfenced open="{{" close="}}" separators=",">
1277 <xsl:for-each select = "*[position()>1]">
1278 <xsl:apply-templates select = "." mode="semantics"/>
1285 <xsl:template match = "m:apply[m:minus[1]]">
1286 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1287 <xsl:param name="PARAM" select="$NO_PARAM"/>
1288 <xsl:param name="PAREN" select="$PAR_NO"/>
1289 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1291 <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and
1293 <m:mfenced separators="">
1294 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1295 <xsl:attribute name="xref">
1296 <xsl:value-of select="@id"/>
1299 <xsl:apply-templates select="." mode="minus">
1300 <xsl:with-param name="PARAM" select="$PARAM"/>
1301 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1302 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1303 </xsl:apply-templates>
1306 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1307 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1308 and not($SEM_SW=$SEM_XREF_EXT)">
1309 <xsl:apply-templates select="." mode="minus">
1310 <xsl:with-param name="PARAM" select="$PARAM"/>
1311 <xsl:with-param name="PAREN" select="$PAREN"/>
1312 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1313 </xsl:apply-templates>
1317 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1318 <xsl:attribute name="xref">
1319 <xsl:value-of select="@id"/>
1322 <xsl:apply-templates select="." mode="minus">
1323 <xsl:with-param name="PARAM" select="$PARAM"/>
1324 <xsl:with-param name="PAREN" select="$PAREN"/>
1325 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1326 </xsl:apply-templates>
1332 <xsl:template match = "m:apply[m:minus[1]]" mode="minus">
1333 <xsl:param name="PARAM" select="$NO_PARAM"/>
1334 <xsl:param name="PAREN" select="$PAR_NO"/>
1335 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1336 <xsl:if test="not(*[3])">
1338 <!-- HELM: xref added -->
1339 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
1340 <xsl:attribute name="xref">
1341 <xsl:value-of select="m:minus/@id"/>
1344 <xsl:apply-templates select="*[2]" mode = "semantics">
1345 <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
1346 <xsl:with-param name="PAREN" select="$PAREN"/>
1347 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1348 </xsl:apply-templates>
1350 <xsl:if test="*[3]">
1351 <xsl:apply-templates select="*[2]" mode = "semantics">
1352 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
1353 <xsl:with-param name="PARAM" select="$PARAM"/>
1354 <xsl:with-param name="PAREN" select="$PAREN"/>
1355 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1356 </xsl:apply-templates>
1358 <!-- HELM: xref added -->
1359 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
1360 <xsl:attribute name="xref">
1361 <xsl:value-of select="m:minus/@id"/>
1364 <xsl:apply-templates select="*[3]" mode = "semantics">
1365 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
1366 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1367 <xsl:with-param name="PAREN" select="$PAREN"/>
1368 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1369 </xsl:apply-templates>
1373 <xsl:template match = "m:apply[m:plus[1]]">
1374 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1375 <xsl:param name="PARAM" select="$NO_PARAM"/>
1376 <xsl:param name="PAREN" select="$PAR_NO"/>
1377 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1379 <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and
1381 <m:mfenced separators="">
1382 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1383 <xsl:attribute name="xref">
1384 <xsl:value-of select="@id"/>
1387 <xsl:apply-templates select="." mode="plus">
1388 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1389 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1390 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1391 </xsl:apply-templates>
1394 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1395 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1396 and not($SEM_SW=$SEM_XREF_EXT)">
1397 <xsl:apply-templates select="." mode="plus">
1398 <xsl:with-param name="PARAM" select="$PARAM"/>
1399 <xsl:with-param name="PAREN" select="$PAREN"/>
1400 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1401 </xsl:apply-templates>
1405 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1406 <xsl:attribute name="xref">
1407 <xsl:value-of select="@id"/>
1410 <xsl:apply-templates select="." mode="plus">
1411 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1412 <xsl:with-param name="PAREN" select="$PAREN"/>
1413 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1414 </xsl:apply-templates>
1420 <xsl:template match = "m:apply[m:plus[1]]" mode="plus">
1421 <xsl:param name="PARAM" select="$NO_PARAM"/>
1422 <xsl:param name="PAREN" select="$PAR_NO"/>
1423 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1424 <xsl:if test="*[2]">
1425 <xsl:apply-templates select="*[2]" mode = "semantics">
1426 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1427 <xsl:with-param name="PARAM" select="$PARAM"/>
1428 <xsl:with-param name="PAREN" select="$PAREN"/>
1429 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1430 </xsl:apply-templates>
1431 <xsl:for-each select = "*[position()>2]">
1433 <xsl:when test=". < 0">
1435 <m:mn> <xsl:value-of select="-."/> </m:mn>
1437 <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
1438 <xsl:apply-templates select="." mode = "semantics">
1439 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1440 <xsl:with-param name="PAREN" select="$PAREN"/>
1441 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1442 </xsl:apply-templates>
1446 <!-- HELM: xref added -->
1447 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:plus/@id">
1448 <xsl:attribute name="xref">
1449 <xsl:value-of select="../m:plus/@id"/>
1452 <xsl:apply-templates select="." mode = "semantics">
1453 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1454 <xsl:with-param name="PAREN" select="$PAREN"/>
1455 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1456 </xsl:apply-templates>
1463 <!-- HELM WARNING: power id is lost! -->
1464 <!-- msup should maintain the power definitionURL info but also the
1465 reference to apply -->
1466 <xsl:template match = "m:apply[m:power[1]]">
1468 <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] |
1469 m:gcd[1] | m:lcm[1] | m:sin[1] | m:cos[1] | m:tan[1] |
1470 m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] |
1471 m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] |
1472 m:coth[1] | m:arcsin[1] | m:arccos[1] |
1473 m:arctan[1] | m:arcsec[1] | m:arccsc[1] |
1474 m:arccot[1] | m:arcsinh[1] | m:arccosh[1] |
1475 m:arctanh[1] | m:arcsech[1] | m:arccsch [1]|
1477 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1481 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1482 <xsl:attribute name="xref">
1483 <xsl:value-of select="@id"/>
1486 <xsl:apply-templates select = "*[2]" mode = "semantics">
1487 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1488 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1489 </xsl:apply-templates>
1490 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1496 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
1497 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1498 <xsl:param name="PARAM" select="$NO_PARAM"/>
1499 <xsl:param name="PAREN" select="$PAR_NO"/>
1500 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1502 <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and
1504 <m:mfenced separators="">
1505 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1506 <xsl:attribute name="xref">
1507 <xsl:value-of select="@id"/>
1510 <xsl:apply-templates select="." mode="remdiv">
1511 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1512 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1513 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1514 </xsl:apply-templates>
1517 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1518 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1519 and not($SEM_SW=$SEM_XREF_EXT)">
1520 <xsl:apply-templates select="." mode="remdiv">
1521 <xsl:with-param name="PARAM" select="$PARAM"/>
1522 <xsl:with-param name="PAREN" select="$PAREN"/>
1523 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1524 </xsl:apply-templates>
1528 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1529 <xsl:attribute name="xref">
1530 <xsl:value-of select="@id"/>
1533 <xsl:apply-templates select="." mode="remdiv">
1534 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1535 <xsl:with-param name="PAREN" select="$PAREN"/>
1536 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1537 </xsl:apply-templates>
1543 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
1544 <xsl:param name="PARAM" select="$NO_PARAM"/>
1545 <xsl:param name="PAREN" select="$PAR_NO"/>
1546 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1547 <xsl:apply-templates select = "*[2]" mode = "semantics">
1548 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
1549 <xsl:with-param name="PARAM" select="$PARAM"/>
1550 <xsl:with-param name="PAREN" select="$PAREN"/>
1551 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1552 </xsl:apply-templates>
1554 <xsl:if test="m:rem">
1555 <!-- HELM: xref added -->
1556 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rem/@id">
1557 <xsl:attribute name="xref">
1558 <xsl:value-of select="m:rem/@id"/>
1561 <xsl:value-of select="'%'"/>
1563 <xsl:if test="m:divide">
1564 <!-- HELM: xref added -->
1565 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divide/@id">
1566 <xsl:attribute name="xref">
1567 <xsl:value-of select="m:divide/@id"/>
1570 <xsl:value-of select="'/'"/>
1573 <xsl:apply-templates select = "*[3]" mode = "semantics">
1574 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
1575 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1576 <xsl:with-param name="PAREN" select="$PAREN"/>
1577 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1578 </xsl:apply-templates>
1581 <xsl:template match = "m:apply[m:times[1]]">
1582 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1583 <xsl:param name="PARAM" select="$NO_PARAM"/>
1584 <xsl:param name="PAREN" select="$PAR_NO"/>
1585 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1587 <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and
1589 <m:mfenced separators="">
1590 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1591 <xsl:attribute name="xref">
1592 <xsl:value-of select="@id"/>
1595 <xsl:apply-templates select="." mode="times">
1596 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1597 <xsl:with-param name="PAREN" select="$PAR_YES"/>
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
1603 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1604 and not($SEM_SW=$SEM_XREF_EXT)">
1605 <xsl:apply-templates select="." mode="times">
1606 <xsl:with-param name="PARAM" select="$PARAM"/>
1607 <xsl:with-param name="PAREN" select="$PAREN"/>
1608 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1609 </xsl:apply-templates>
1613 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1614 <xsl:attribute name="xref">
1615 <xsl:value-of select="@id"/>
1618 <xsl:apply-templates select="." mode="times">
1619 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1620 <xsl:with-param name="PAREN" select="$PAREN"/>
1621 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1622 </xsl:apply-templates>
1628 <xsl:template match = "m:apply[m:times[1]]" mode="times">
1629 <xsl:param name="PARAM" select="$NO_PARAM"/>
1630 <xsl:param name="PAREN" select="$PAR_NO"/>
1631 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1632 <xsl:apply-templates select="*[2]" mode = "semantics">
1633 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
1634 <xsl:with-param name="PARAM" select="$PARAM"/>
1635 <xsl:with-param name="PAREN" select="$PAREN"/>
1636 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1637 </xsl:apply-templates>
1638 <xsl:if test="*[3]">
1639 <xsl:for-each select = "*[position()>2]">
1640 <!-- HELM: to distinguish between * and the application -->
1642 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
1645 <!-- HELM: xref added -->
1646 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:times/@id">
1647 <xsl:attribute name="xref">
1648 <xsl:value-of select="../m:times/@id"/>
1651 <xsl:apply-templates select="." mode = "semantics">
1652 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
1653 <xsl:with-param name="PAREN" select="$PAREN"/>
1654 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1655 </xsl:apply-templates>
1660 <xsl:template match = "m:apply[m:root[1]]">
1662 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1663 <xsl:attribute name="xref">
1664 <xsl:value-of select="@id"/>
1667 <xsl:if test="*[2]=m:degree">
1668 <xsl:apply-templates select="*[3]" mode = "semantics">
1669 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1670 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1671 </xsl:apply-templates>
1672 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1674 <xsl:if test="not(*[2]=m:degree)">
1675 <xsl:apply-templates select="*[2]" mode = "semantics">
1676 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1677 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1678 </xsl:apply-templates>
1684 <xsl:template match = "m:apply[m:gcd[1]]">
1686 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1687 <xsl:attribute name="xref">
1688 <xsl:value-of select="@id"/>
1691 <xsl:if test="not(parent::m:apply[m:power[1]])">
1693 <!-- HELM: xref added -->
1694 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
1695 <xsl:attribute name="xref">
1696 <xsl:value-of select="m:gcd/@id"/>
1700 <xsl:if test="parent::m:apply[m:power[1]]">
1703 <!-- HELM: xref added -->
1704 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
1705 <xsl:attribute name="xref">
1706 <xsl:value-of select="m:gcd/@id"/>
1709 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1712 <m:mfenced separators=",">
1713 <xsl:for-each select = "*[position()>1]">
1714 <xsl:apply-templates select = "." mode="semantics"/>
1720 <xsl:template match = "m:apply[m:and[1]]">
1721 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1722 <xsl:param name="PAREN" select="$PAR_NO"/>
1723 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1725 <xsl:when test="$IN_PREC > $AND_PREC">
1726 <m:mfenced separators="">
1727 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1728 <xsl:attribute name="xref">
1729 <xsl:value-of select="@id"/>
1732 <xsl:apply-templates select="." mode="and">
1733 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1734 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1735 </xsl:apply-templates>
1738 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1739 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1740 and not($SEM_SW=$SEM_XREF_EXT)">
1741 <xsl:apply-templates select="." mode="and">
1742 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1743 <xsl:with-param name="PAREN" select="$PAREN"/>
1744 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1745 </xsl:apply-templates>
1749 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1750 <xsl:attribute name="xref">
1751 <xsl:value-of select="@id"/>
1754 <xsl:apply-templates select="." mode="and">
1755 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1756 <xsl:with-param name="PAREN" select="$PAREN"/>
1757 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1758 </xsl:apply-templates>
1764 <xsl:template match = "m:apply[m:and[1]]" mode="and">
1765 <xsl:param name="PARAM" select="$NO_PARAM"/>
1766 <xsl:param name="PAREN" select="$PAR_NO"/>
1767 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1768 <xsl:apply-templates select="*[2]" mode = "semantics">
1769 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1770 <xsl:with-param name="PARAM" select="$PARAM"/>
1771 <xsl:with-param name="PAREN" select="$PAREN"/>
1772 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1773 </xsl:apply-templates>
1774 <xsl:for-each select = "*[position()>2]">
1776 <!-- HELM: xref added -->
1777 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:and/@id">
1778 <xsl:attribute name="xref">
1779 <xsl:value-of select="../m:and/@id"/>
1781 </xsl:if><xsl:text disable-output-escaping='yes'>∧</xsl:text></m:mo>
1782 <xsl:apply-templates select="." mode = "semantics">
1783 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1784 <xsl:with-param name="PAREN" select="$PAREN"/>
1785 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1786 </xsl:apply-templates>
1790 <xsl:template match = "m:apply[m:or[1]]">
1791 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1792 <xsl:param name="PAREN" select="$PAR_NO"/>
1793 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1795 <xsl:when test="$IN_PREC > $OR_PREC">
1796 <m:mfenced separators="">
1797 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1798 <xsl:attribute name="xref">
1799 <xsl:value-of select="@id"/>
1802 <xsl:apply-templates select="." mode="or">
1803 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1804 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1805 </xsl:apply-templates>
1808 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1809 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1810 and not($SEM_SW=$SEM_XREF_EXT)">
1811 <xsl:apply-templates select="." mode="or">
1812 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1813 <xsl:with-param name="PAREN" select="$PAREN"/>
1814 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1815 </xsl:apply-templates>
1819 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1820 <xsl:attribute name="xref">
1821 <xsl:value-of select="@id"/>
1824 <xsl:apply-templates select="." mode="or">
1825 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1826 <xsl:with-param name="PAREN" select="$PAREN"/>
1827 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1828 </xsl:apply-templates>
1834 <xsl:template match = "m:apply[m:or[1]]" mode="or">
1835 <xsl:param name="PARAM" select="$NO_PARAM"/>
1836 <xsl:param name="PAREN" select="$PAR_NO"/>
1837 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1838 <xsl:apply-templates select="*[2]" mode = "semantics">
1839 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1840 <xsl:with-param name="PARAM" select="$PARAM"/>
1841 <xsl:with-param name="PAREN" select="$PAREN"/>
1842 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1843 </xsl:apply-templates>
1844 <xsl:for-each select = "*[position()>2]">
1846 <!-- HELM: xref added -->
1847 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:or/@id">
1848 <xsl:attribute name="xref">
1849 <xsl:value-of select="../m:or/@id"/>
1851 </xsl:if><xsl:text disable-output-escaping='yes'>∨</xsl:text></m:mo>
1852 <xsl:apply-templates select="." mode = "semantics">
1853 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1854 <xsl:with-param name="PAREN" select="$PAREN"/>
1855 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1856 </xsl:apply-templates>
1860 <xsl:template match = "m:apply[m:xor[1]]">
1861 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1862 <xsl:param name="PAREN" select="$PAR_NO"/>
1863 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1865 <xsl:when test="$IN_PREC > $XOR_PREC">
1866 <m:mfenced separators="">
1867 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1868 <xsl:attribute name="xref">
1869 <xsl:value-of select="@id"/>
1872 <xsl:apply-templates select="." mode="xor">
1873 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1874 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1875 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1876 </xsl:apply-templates>
1879 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1880 and not($SEM_SW=$SEM_ALL)">
1881 <xsl:apply-templates select="." mode="xor">
1882 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1883 <xsl:with-param name="PAREN" select="$PAREN"/>
1884 </xsl:apply-templates>
1888 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1889 <xsl:attribute name="xref">
1890 <xsl:value-of select="@id"/>
1893 <xsl:apply-templates select="." mode="xor">
1894 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1895 <xsl:with-param name="PAREN" select="$PAREN"/>
1896 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1897 </xsl:apply-templates>
1903 <xsl:template match = "m:apply[m:xor[1]]" mode="xor">
1904 <xsl:param name="PARAM" select="$NO_PARAM"/>
1905 <xsl:param name="PAREN" select="$PAR_NO"/>
1906 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1907 <xsl:apply-templates select="*[2]" mode = "semantics">
1908 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1909 <xsl:with-param name="PARAM" select="$PARAM"/>
1910 <xsl:with-param name="PAREN" select="$PAREN"/>
1911 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1912 </xsl:apply-templates>
1913 <xsl:for-each select = "*[position()>2]">
1915 <!-- HELM: xref added -->
1916 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:xor/@id">
1917 <xsl:attribute name="xref">
1918 <xsl:value-of select="../m:xor/@id"/>
1920 </xsl:if><xsl:text disable-output-escaping='yes'>⊻</xsl:text></m:mo>
1921 <xsl:apply-templates select="." mode = "semantics">
1922 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1923 <xsl:with-param name="PAREN" select="$PAREN"/>
1924 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1925 </xsl:apply-templates>
1929 <xsl:template match = "m:apply[m:not[1]]">
1931 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1932 <xsl:attribute name="xref">
1933 <xsl:value-of select="@id"/>
1936 <!-- HELM: was <m:mo>not</m:mo>
1939 <!-- HELM: xref added -->
1940 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:not/@id">
1941 <xsl:attribute name="xref">
1942 <xsl:value-of select="m:not/@id"/>
1944 </xsl:if>¬</m:mo>
1945 <xsl:apply-templates select = "*[2]" mode = "semantics">
1946 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1947 </xsl:apply-templates>
1951 <xsl:template match = "m:apply[m:forall[1]]">
1953 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1954 <xsl:attribute name="xref">
1955 <xsl:value-of select="@id"/>
1959 <!-- HELM: xref added -->
1960 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:forall/@id">
1961 <xsl:attribute name="xref">
1962 <xsl:value-of select="m:forall/@id"/>
1964 </xsl:if>for all</m:mo>
1965 <xsl:if test="count(m:bvar) > 1">
1966 <m:mfenced separators=",">
1967 <xsl:for-each select = "m:bvar">
1968 <xsl:apply-templates select = "." mode="semantics"/>
1972 <xsl:if test="count(m:bvar)=1">
1973 <xsl:apply-templates select = "m:bvar" mode="semantics"/>
1975 <xsl:if test="m:condition">
1977 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1980 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
1981 not(self::m:condition)]" mode = "semantics"/>
1985 <xsl:template match = "m:apply[m:exists[1]]">
1987 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1988 <xsl:attribute name="xref">
1989 <xsl:value-of select="@id"/>
1993 <!-- HELM: xref added -->
1994 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exists/@id">
1995 <xsl:attribute name="xref">
1996 <xsl:value-of select="m:exists/@id"/>
1998 </xsl:if><xsl:text disable-output-escaping='yes'>∃</xsl:text> </m:mo>
1999 <xsl:if test="count(m:bvar) > 1">
2000 <m:mfenced separators=",">
2001 <xsl:for-each select = "m:bvar">
2002 <xsl:apply-templates select = "." mode="semantics"/>
2006 <xsl:if test="count(m:bvar)=1">
2007 <xsl:apply-templates select = "m:bvar" mode="semantics"/>
2009 <xsl:if test="m:condition">
2011 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
2013 <xsl:if test="*[position()>1 and not(self::m:bvar) and not(self::m:condition)]">
2015 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
2016 not(self::m:condition)]" mode = "semantics"/>
2021 <!-- HELM WARNING: abs id was lost! -->
2022 <xsl:template match = "m:apply[m:abs[1]]">
2023 <xsl:if test="not(parent::m:apply[m:power[1]])">
2025 <m:mfenced open="|" close="|" separators="">
2026 Now is: mrow + mo -->
2028 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2029 <xsl:attribute name="xref">
2030 <xsl:value-of select="@id"/>
2034 <!-- HELM: xref added -->
2035 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2036 <xsl:attribute name="xref">
2037 <xsl:value-of select="m:abs/@id"/>
2040 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2042 <!-- HELM: xref added -->
2043 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2044 <xsl:attribute name="xref">
2045 <xsl:value-of select="m:abs/@id"/>
2048 <!-- HELM: </m:mfenced> -->
2051 <xsl:if test="parent::m:apply[m:power[1]]">
2054 <m:mfenced open="|" close="|" separators="">
2055 Now is: mrow + mo -->
2057 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2058 <xsl:attribute name="xref">
2059 <xsl:value-of select="@id"/>
2063 <!-- HELM: xref added -->
2064 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2065 <xsl:attribute name="xref">
2066 <xsl:value-of select="m:abs/@id"/>
2069 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2071 <!-- HELM: xref added -->
2072 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2073 <xsl:attribute name="xref">
2074 <xsl:value-of select="m:abs/@id"/>
2077 <!-- HELM: </m:mfenced> -->
2079 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2084 <xsl:template match = "m:apply[m:conjugate[1]]">
2086 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2087 <xsl:attribute name="xref">
2088 <xsl:value-of select="@id"/>
2092 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2095 <!-- HELM: xref added -->
2096 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:conjugate/@id">
2097 <xsl:attribute name="xref">
2098 <xsl:value-of select="m:conjugate/@id"/>
2100 </xsl:if><xsl:text disable-output-escaping='yes'>̲</xsl:text> </m:mo>
2104 <xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
2106 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2107 <xsl:attribute name="xref">
2108 <xsl:value-of select="@id"/>
2112 <xsl:if test="m:arg">
2113 <!-- HELM: xref added -->
2114 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:arg/@id">
2115 <xsl:attribute name="xref">
2116 <xsl:value-of select="m:arg/@id"/>
2119 <xsl:value-of select="'Arg'"/>
2121 <xsl:if test="m:real">
2122 <!-- HELM: xref added -->
2123 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:real/@id">
2124 <xsl:attribute name="xref">
2125 <xsl:value-of select="m:real/@id"/>
2128 <xsl:value-of select="'Re'"/>
2130 <xsl:if test="m:imaginary">
2131 <!-- HELM: xref added -->
2132 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginary/@id">
2133 <xsl:attribute name="xref">
2134 <xsl:value-of select="m:imaginary/@id"/>
2137 <xsl:value-of select="'Im'"/>
2140 <m:mfenced separators="">
2141 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2146 <!-- HELM: was (it didn't match with prefixed MathML)
2147 <xsl:template match="m:apply[child::*[position()=1 and name()='lcm']]">
2149 <xsl:template match="m:apply[child::*[position()=1 and self::m:lcm]]">
2151 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2152 <xsl:attribute name="xref">
2153 <xsl:value-of select="@id"/>
2156 <xsl:if test="not(parent::m:apply[m:power[1]])">
2158 <!-- HELM: xref added -->
2159 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
2160 <xsl:attribute name="xref">
2161 <xsl:value-of select="m:lcm/@id"/>
2165 <xsl:if test="parent::m:apply[m:power[1]]">
2168 <!-- HELM: xref added -->
2169 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
2170 <xsl:attribute name="xref">
2171 <xsl:value-of select="m:lcm/@id"/>
2174 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2177 <m:mfenced separators=",">
2178 <xsl:for-each select = "*[position()>1]">
2179 <xsl:apply-templates select = "." mode="semantics"/>
2185 <!-- HELM: was (it didn't match with prefixed MathML)
2186 <xsl:template match="m:apply[child::*[position()=1 and name()='floor']]">
2188 <xsl:template match="m:apply[child::*[position()=1 and self::m:floor]]">
2190 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2191 <xsl:attribute name="xref">
2192 <xsl:value-of select="@id"/>
2196 <!-- HELM: xref added -->
2197 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
2198 <xsl:attribute name="xref">
2199 <xsl:value-of select="m:floor/@id"/>
2202 <!-- HELM: not rendered correctly <![CDATA[⌊]]> -->
2203 <xsl:text disable-output-escaping="yes">⌊</xsl:text>
2205 <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
2207 <!-- HELM: xref added -->
2208 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
2209 <xsl:attribute name="xref">
2210 <xsl:value-of select="m:floor/@id"/>
2213 <!-- HELM: not rendered correctly <![CDATA[⌋]]> -->
2214 <xsl:text disable-output-escaping="yes">⌋</xsl:text>
2219 <!-- HELM: was (it didn't match with prefixed MathML)
2220 <xsl:template match="m:apply[child::*[position()=1 and name()='ceiling']]">
2222 <xsl:template match="m:apply[child::*[position()=1 and self::m:ceiling]]">
2224 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2225 <xsl:attribute name="xref">
2226 <xsl:value-of select="@id"/>
2230 <!-- HELM: xref added -->
2231 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
2232 <xsl:attribute name="xref">
2233 <xsl:value-of select="m:ceiling/@id"/>
2236 <!-- HELM: not rendered correctly <![CDATA[⌈]]> -->
2237 <xsl:text disable-output-escaping="yes">⌈</xsl:text>
2239 <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
2241 <!-- HELM: xref added -->
2242 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
2243 <xsl:attribute name="xref">
2244 <xsl:value-of select="m:ceiling/@id"/>
2247 <!-- HELM: not rendered correctly <![CDATA[⌉]]> -->
2248 <xsl:text disable-output-escaping="yes">⌉</xsl:text>
2254 <!-- ***************** RELATIONS ***************** -->
2256 <xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies
2257 | m:in | m:notin | m:notsubset | m:notprsubset
2258 | m:subset | m:prsubset | m:eq | m:gt | m:lt
2259 | m:geq | m:leq | m:equivalent | m:factorof]">
2261 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2262 <xsl:attribute name="xref">
2263 <xsl:value-of select="@id"/>
2266 <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:factorof or *[1]=m:tendsto or
2267 *[1]=m:implies or *[1]=m:in or *[1]=m:notin or
2268 *[1]=m:notsubset or *[1]=m:notprsubset">
2269 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2271 <xsl:if test="*[1]=m:neq">
2272 <!-- HELM: xref added -->
2273 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:neq/@id">
2274 <xsl:attribute name="xref">
2275 <xsl:value-of select="m:neq/@id"/>
2278 <xsl:text disable-output-escaping='yes'>≠</xsl:text>
2280 <xsl:if test="*[1]=m:approx">
2281 <!-- HELM: xref added -->
2282 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:approx/@id">
2283 <xsl:attribute name="xref">
2284 <xsl:value-of select="m:approx/@id"/>
2287 <xsl:text disable-output-escaping='yes'>≊</xsl:text>
2289 <xsl:if test="*[1]=m:factorof">
2290 <!-- HELM: xref added -->
2291 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorof/@id">
2292 <xsl:attribute name="xref">
2293 <xsl:value-of select="m:factorof/@id"/>
2298 <xsl:if test="*[1]=m:tendsto">
2299 <!-- HELM: xref added -->
2300 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2301 <xsl:attribute name="xref">
2302 <xsl:value-of select="m:tendsto/@id"/>
2305 <xsl:text disable-output-escaping='yes'>→</xsl:text>
2307 <xsl:if test="*[1]=m:implies">
2308 <!-- HELM: xref added -->
2309 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:implies/@id">
2310 <xsl:attribute name="xref">
2311 <xsl:value-of select="m:implies/@id"/>
2314 <xsl:text disable-output-escaping='yes'>⇒</xsl:text>
2316 <xsl:if test="*[1]=m:in">
2317 <!-- HELM: xref added -->
2318 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:in/@id">
2319 <xsl:attribute name="xref">
2320 <xsl:value-of select="m:in/@id"/>
2323 <xsl:text disable-output-escaping='yes'>∈</xsl:text>
2325 <xsl:if test="*[1]=m:notin">
2326 <!-- HELM: xref added -->
2327 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notin/@id">
2328 <xsl:attribute name="xref">
2329 <xsl:value-of select="m:notin/@id"/>
2332 <xsl:text disable-output-escaping='yes'>∉</xsl:text>
2334 <xsl:if test="*[1]=m:notsubset">
2335 <!-- HELM: xref added -->
2336 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notsubset/@id">
2337 <xsl:attribute name="xref">
2338 <xsl:value-of select="m:notsubset/@id"/>
2341 <xsl:text disable-output-escaping='yes'>⊄</xsl:text>
2343 <xsl:if test="*[1]=m:notprsubset">
2344 <!-- HELM: xref added -->
2345 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notprsubset/@id">
2346 <xsl:attribute name="xref">
2347 <xsl:value-of select="m:notprsubset/@id"/>
2350 <xsl:text disable-output-escaping='yes'>⊈</xsl:text>
2353 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
2354 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
2356 <!-- HELM: xref added -->
2357 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2358 <xsl:attribute name="xref">
2359 <xsl:value-of select="m:tendsto/@id"/>
2363 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
2365 <!-- HELM: xref added -->
2366 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2367 <xsl:attribute name="xref">
2368 <xsl:value-of select="m:tendsto/@id"/>
2373 <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt
2374 or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
2375 <xsl:apply-templates select = "*[2]" mode="semantics"/>
2376 <xsl:for-each select = "*[position()>2]">
2378 <xsl:if test="../*[self::m:subset][1]">
2379 <!-- HELM: xref added -->
2380 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:subset/@id">
2381 <xsl:attribute name="xref">
2382 <xsl:value-of select="../m:subset/@id"/>
2385 <xsl:text disable-output-escaping='yes'>⊆</xsl:text>
2387 <xsl:if test="../*[self::m:prsubset][1]">
2388 <!-- HELM: xref added -->
2389 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:prsubset/@id">
2390 <xsl:attribute name="xref">
2391 <xsl:value-of select="../m:prsubset/@id"/>
2394 <xsl:text disable-output-escaping='yes'>⊂</xsl:text>
2396 <xsl:if test="../*[self::m:eq][1]">
2397 <!-- HELM: xref added -->
2398 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:eq/@id">
2399 <xsl:attribute name="xref">
2400 <xsl:value-of select="../m:eq/@id"/>
2403 <xsl:value-of select="'='"/>
2405 <xsl:if test="../*[self::m:gt][1]">
2406 <!-- HELM: xref added -->
2407 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:gt/@id">
2408 <xsl:attribute name="xref">
2409 <xsl:value-of select="../m:gt/@id"/>
2412 <xsl:value-of select="'>'"/>
2414 <xsl:if test="../*[self::m:lt][1]">
2415 <!-- HELM: xref added -->
2416 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:lt/@id">
2417 <xsl:attribute name="xref">
2418 <xsl:value-of select="../m:lt/@id"/>
2421 <xsl:value-of select="'<'"/>
2423 <xsl:if test="../*[self::m:geq][1]">
2424 <!-- HELM: xref added -->
2425 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:geq/@id">
2426 <xsl:attribute name="xref">
2427 <xsl:value-of select="../m:geq/@id"/>
2430 <xsl:text disable-output-escaping='yes'>≥</xsl:text>
2432 <xsl:if test="../*[self::m:leq][1]">
2433 <!-- HELM: xref added -->
2434 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:leq/@id">
2435 <xsl:attribute name="xref">
2436 <xsl:value-of select="../m:leq/@id"/>
2439 <xsl:text disable-output-escaping='yes'>≤</xsl:text>
2441 <xsl:if test="../*[self::m:equivalent][1]">
2442 <!-- HELM: xref added -->
2443 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:equivalent/@id">
2444 <xsl:attribute name="xref">
2445 <xsl:value-of select="../m:equivalent/@id"/>
2448 <xsl:text disable-output-escaping='yes'>≡</xsl:text>
2451 <xsl:apply-templates select = "." mode="semantics"/>
2458 <!-- ***************** CALCULUS ***************** -->
2460 <xsl:template match = "m:apply[*[1][self::m:ln]]">
2462 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2463 <xsl:attribute name="xref">
2464 <xsl:value-of select="@id"/>
2468 <xsl:when test="parent::m:apply[m:power[1]]">
2471 <!-- HELM: xref added -->
2472 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
2473 <xsl:attribute name="xref">
2474 <xsl:value-of select="m:ln/@id"/>
2477 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2482 <!-- HELM: xref added -->
2483 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
2484 <xsl:attribute name="xref">
2485 <xsl:value-of select="m:ln/@id"/>
2490 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
2491 <xsl:apply-templates select = "*[2]" mode = "semantics">
2492 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2493 </xsl:apply-templates>
2497 <xsl:template match = "m:apply[m:log[1]]">
2499 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2500 <xsl:attribute name="xref">
2501 <xsl:value-of select="@id"/>
2505 <xsl:when test="parent::m:apply[m:power[1]]">
2506 <xsl:if test="not(*[2]=m:logbase)">
2509 <!-- HELM: xref added -->
2510 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2511 <xsl:attribute name="xref">
2512 <xsl:value-of select="m:log/@id"/>
2515 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2518 <xsl:if test="*[2]=m:logbase">
2521 <!-- HELM: xref added -->
2522 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2523 <xsl:attribute name="xref">
2524 <xsl:value-of select="m:log/@id"/>
2527 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2528 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
2533 <xsl:if test="not(*[2]=m:logbase)">
2535 <!-- HELM: xref added -->
2536 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2537 <xsl:attribute name="xref">
2538 <xsl:value-of select="m:log/@id"/>
2542 <xsl:if test="*[2]=m:logbase">
2545 <!-- HELM: xref added -->
2546 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2547 <xsl:attribute name="xref">
2548 <xsl:value-of select="m:log/@id"/>
2551 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
2556 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
2557 <xsl:if test="*[2]=m:logbase">
2558 <xsl:apply-templates select = "*[3]" mode = "semantics">
2559 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2560 </xsl:apply-templates>
2562 <xsl:if test="not(*[2]=m:logbase)">
2563 <xsl:apply-templates select = "*[2]" mode = "semantics">
2564 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2565 </xsl:apply-templates>
2570 <xsl:template match = "m:apply[m:diff[1]]">
2572 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2573 <xsl:attribute name="xref">
2574 <xsl:value-of select="@id"/>
2577 <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
2579 <!-- HELM: xref added -->
2580 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
2581 <xsl:attribute name="xref">
2582 <xsl:value-of select="m:diff/@id"/>
2587 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
2592 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
2593 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
2598 <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
2600 <!-- HELM: xref added -->
2601 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
2602 <xsl:attribute name="xref">
2603 <xsl:value-of select="m:diff/@id"/>
2609 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
2613 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
2617 <xsl:template match = "m:apply[m:partialdiff[1]]">
2619 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2620 <xsl:attribute name="xref">
2621 <xsl:value-of select="@id"/>
2624 <xsl:for-each select = "m:bvar">
2625 <xsl:if test="*[last()]=m:degree">
2627 <!-- HELM: xref added -->
2628 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
2629 <xsl:attribute name="xref">
2630 <xsl:value-of select="../m:partialdiff/@id"/>
2635 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
2640 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
2641 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
2646 <xsl:if test="not(*[last()]=m:degree)">
2648 <!-- HELM: xref added -->
2649 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
2650 <xsl:attribute name="xref">
2651 <xsl:value-of select="../m:partialdiff/@id"/>
2657 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
2662 <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
2666 <xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
2667 <xsl:apply-templates select="*" mode = "semantics"/>
2670 <xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
2672 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2673 <xsl:attribute name="xref">
2674 <xsl:value-of select="@id"/>
2678 <xsl:if test="*[1]=m:divergence">
2679 <!-- HELM: xref added -->
2680 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divergence/@id">
2681 <xsl:attribute name="xref">
2682 <xsl:value-of select="m:divergence/@id"/>
2685 <xsl:value-of select="'div'"/>
2687 <xsl:if test="*[1]=m:grad">
2688 <!-- HELM: xref added -->
2689 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:grad/@id">
2690 <xsl:attribute name="xref">
2691 <xsl:value-of select="m:grad/@id"/>
2694 <xsl:value-of select="'grad'"/>
2696 <xsl:if test="*[1]=m:curl">
2697 <!-- HELM: xref added -->
2698 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:curl/@id">
2699 <xsl:attribute name="xref">
2700 <xsl:value-of select="m:curl/@id"/>
2703 <xsl:value-of select="'curl'"/>
2707 <xsl:when test="*[2]=m:ci">
2708 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2711 <m:mfenced separators="">
2712 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2719 <xsl:template match = "m:apply[m:laplacian[1]]">
2721 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2722 <xsl:attribute name="xref">
2723 <xsl:value-of select="@id"/>
2728 <!-- HELM: xref added -->
2729 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:laplacian/@id">
2730 <xsl:attribute name="xref">
2731 <xsl:value-of select="m:laplacian/@id"/>
2734 <xsl:text disable-output-escaping='yes'>Δ</xsl:text></m:mo>
2737 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2742 <!-- ***************** SET THEORY ***************** -->
2744 <xsl:template match = "m:set | m:list">
2745 <m:mfenced open="{{" close="}}" separators="">
2746 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2747 <xsl:attribute name="xref">
2748 <xsl:value-of select="@id"/>
2751 <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
2752 <xsl:apply-templates select="m:bvar" mode = "semantics"/>
2754 <xsl:apply-templates select="m:condition" mode = "semantics"/>
2756 <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
2757 <m:mfenced open="" close="" separators=",">
2758 <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
2759 <xsl:apply-templates select = "." mode="semantics"/>
2763 <xsl:apply-templates select="m:condition" mode = "semantics"/>
2765 <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
2766 <m:mfenced open="" close="" separators=",">
2767 <xsl:for-each select = "*">
2768 <xsl:apply-templates select = "." mode="semantics"/>
2775 <xsl:template match = "m:apply[m:union[1]]">
2776 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2777 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2778 <xsl:param name="PARAM" select="$NO_PARAM"/>
2779 <xsl:param name="PAREN" select="$PAR_NO"/>
2780 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2782 <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
2783 and $PARAM=$PAR_SAME and not($IN_OP=$UNION_OP)">
2784 <m:mfenced separators="">
2785 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2786 <xsl:attribute name="xref">
2787 <xsl:value-of select="@id"/>
2790 <xsl:apply-templates select="." mode="union">
2791 <xsl:with-param name="PARAM" select="$PARAM"/>
2792 <xsl:with-param name="PAREN" select="$PAREN"/>
2793 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2794 </xsl:apply-templates>
2797 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2798 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2799 and not($SEM_SW=$SEM_XREF_EXT)">
2800 <xsl:apply-templates select="." mode="union">
2801 <xsl:with-param name="PARAM" select="$PARAM"/>
2802 <xsl:with-param name="PAREN" select="$PAREN"/>
2803 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2804 </xsl:apply-templates>
2808 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2809 <xsl:attribute name="xref">
2810 <xsl:value-of select="@id"/>
2813 <xsl:apply-templates select="." mode="union">
2814 <xsl:with-param name="IN_OP" select="$UNION_OP"/>
2815 <xsl:with-param name="PARAM" select="$PARAM"/>
2816 <xsl:with-param name="PAREN" select="$PAREN"/>
2817 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2818 </xsl:apply-templates>
2824 <xsl:template match = "m:apply[m:union[1]]" mode="union">
2825 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2826 <xsl:param name="PARAM" select="$NO_PARAM"/>
2827 <xsl:param name="PAREN" select="$PAR_NO"/>
2828 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2829 <xsl:apply-templates select = "*[2]" mode="semantics">
2830 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
2831 <xsl:with-param name="PARAM" select="$PARAM"/>
2832 <xsl:with-param name="PAREN" select="$PAREN"/>
2833 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2834 </xsl:apply-templates>
2835 <xsl:for-each select = "*[position()>2]">
2837 <!-- HELM: xref added -->
2838 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:union/@id">
2839 <xsl:attribute name="xref">
2840 <xsl:value-of select="../m:union/@id"/>
2842 </xsl:if>⋃</m:mo>
2843 <!-- HELM: not rendered correctly <![CDATA[⋃]]> -->
2844 <!-- <xsl:text disable-output-escaping="yes">⋃</xsl:text></m:mo>-->
2845 <xsl:apply-templates select = "." mode="semantics">
2846 <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
2847 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
2848 <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
2849 <xsl:with-param name="PAREN" select="$PAREN"/>
2850 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
2851 </xsl:apply-templates>
2855 <xsl:template match = "m:apply[m:intersect[1]]">
2856 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2857 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2858 <xsl:param name="PARAM" select="$NO_PARAM"/>
2859 <xsl:param name="PAREN" select="$PAR_NO"/>
2860 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2862 <xsl:when test="$IN_PREC > $INTERSECT_PREC or $IN_PREC=$INTERSECT_PREC
2863 and $PARAM=$PAR_SAME and not($IN_OP=$INTERSECT_OP)">
2864 <m:mfenced separators="">
2865 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2866 <xsl:attribute name="xref">
2867 <xsl:value-of select="@id"/>
2870 <xsl:apply-templates select="." mode="intersect">
2871 <xsl:with-param name="PARAM" select="$PARAM"/>
2872 <xsl:with-param name="PAREN" select="$PAREN"/>
2873 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2874 </xsl:apply-templates>
2877 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2878 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2879 and not($SEM_SW=$SEM_XREF_EXT)">
2880 <xsl:apply-templates select="." mode="intersect">
2881 <xsl:with-param name="PARAM" select="$PARAM"/>
2882 <xsl:with-param name="PAREN" select="$PAREN"/>
2883 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2884 </xsl:apply-templates>
2888 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2889 <xsl:attribute name="xref">
2890 <xsl:value-of select="@id"/>
2893 <xsl:apply-templates select="." mode="intersect">
2894 <xsl:with-param name="IN_OP" select="$INTERSECT_OP"/>
2895 <xsl:with-param name="PARAM" select="$PARAM"/>
2896 <xsl:with-param name="PAREN" select="$PAREN"/>
2897 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2898 </xsl:apply-templates>
2904 <xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
2905 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2906 <xsl:param name="PARAM" select="$NO_PARAM"/>
2907 <xsl:param name="PAREN" select="$PAR_NO"/>
2908 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2909 <xsl:apply-templates select = "*[2]" mode="semantics">
2910 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
2911 <xsl:with-param name="PARAM" select="$PARAM"/>
2912 <xsl:with-param name="PAREN" select="$PAREN"/>
2913 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2914 </xsl:apply-templates>
2915 <xsl:for-each select = "*[position()>2]">
2917 <!-- HELM: xref added -->
2918 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:intersect/@id">
2919 <xsl:attribute name="xref">
2920 <xsl:value-of select="../m:intersect/@id"/>
2923 <!-- HELM: not rendered correctly <![CDATA[⋂]]> -->
2924 <xsl:text disable-output-escaping="yes">⋂</xsl:text></m:mo>
2925 <xsl:apply-templates select = "." mode="semantics">
2926 <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
2927 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
2928 <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
2929 <xsl:with-param name="PAREN" select="$PAREN"/>
2930 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
2931 </xsl:apply-templates>
2935 <xsl:template match = "m:apply[m:setdiff[1]]">
2936 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2937 <xsl:param name="PARAM" select="$NO_PARAM"/>
2938 <xsl:param name="PAREN" select="$PAR_NO"/>
2939 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2941 <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
2942 and $PARAM=$PAR_SAME">
2943 <m:mfenced separators="">
2944 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2945 <xsl:attribute name="xref">
2946 <xsl:value-of select="@id"/>
2949 <xsl:apply-templates select="." mode="setdiff">
2950 <xsl:with-param name="PARAM" select="$PARAM"/>
2951 <xsl:with-param name="PAREN" select="$PAREN"/>
2952 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2953 </xsl:apply-templates>
2956 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2957 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2958 and not($SEM_SW=$SEM_XREF_EXT)">
2959 <xsl:apply-templates select="." mode="setdiff">
2960 <xsl:with-param name="PARAM" select="$PARAM"/>
2961 <xsl:with-param name="PAREN" select="$PAREN"/>
2962 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2963 </xsl:apply-templates>
2967 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2968 <xsl:attribute name="xref">
2969 <xsl:value-of select="@id"/>
2972 <xsl:apply-templates select="." mode="setdiff">
2973 <xsl:with-param name="PARAM" select="$PARAM"/>
2974 <xsl:with-param name="PAREN" select="$PAREN"/>
2975 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2976 </xsl:apply-templates>
2982 <xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
2983 <xsl:param name="PARAM" select="$NO_PARAM"/>
2984 <xsl:param name="PAREN" select="$PAR_NO"/>
2985 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2986 <xsl:apply-templates select = "*[2]" mode = "semantics">
2987 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
2988 <xsl:with-param name="PARAM" select="$PARAM"/>
2989 <xsl:with-param name="PAREN" select="$PAREN"/>
2990 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2991 </xsl:apply-templates>
2993 <!-- HELM: xref added -->
2994 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
2995 <xsl:attribute name="xref">
2996 <xsl:value-of select="m:setdiff/@id"/>
2999 <xsl:apply-templates select = "*[3]" mode = "semantics">
3000 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
3001 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
3002 <xsl:with-param name="PAREN" select="$PAREN"/>
3003 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3004 </xsl:apply-templates>
3007 <xsl:template match = "m:apply[m:cartesianproduct[1]]">
3008 <xsl:param name="IN_PREC" select="$NO_PREC"/>
3009 <xsl:param name="PARAM" select="$NO_PARAM"/>
3010 <xsl:param name="PAREN" select="$PAR_NO"/>
3011 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
3013 <xsl:when test="$IN_PREC > $CARTPROD_PREC or $IN_PREC=$CARTPROD_PREC
3014 and $PARAM=$PAR_SAME">
3015 <m:mfenced separators="">
3016 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3017 <xsl:attribute name="xref">
3018 <xsl:value-of select="@id"/>
3021 <xsl:apply-templates select="." mode="cartprod">
3022 <xsl:with-param name="PARAM" select="$PARAM"/>
3023 <xsl:with-param name="PAREN" select="$PAREN"/>
3024 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3025 </xsl:apply-templates>
3028 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
3029 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
3030 and not($SEM_SW=$SEM_XREF_EXT)">
3031 <xsl:apply-templates select="." mode="cartprod">
3032 <xsl:with-param name="PARAM" select="$PARAM"/>
3033 <xsl:with-param name="PAREN" select="$PAREN"/>
3034 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3035 </xsl:apply-templates>
3039 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3040 <xsl:attribute name="xref">
3041 <xsl:value-of select="@id"/>
3044 <xsl:apply-templates select="." mode="cartprod">
3045 <xsl:with-param name="PARAM" select="$PARAM"/>
3046 <xsl:with-param name="PAREN" select="$PAREN"/>
3047 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3048 </xsl:apply-templates>
3054 <xsl:template match = "m:apply[m:cartesianproduct[1]]" mode="cartprod">
3055 <xsl:param name="PARAM" select="$NO_PARAM"/>
3056 <xsl:param name="PAREN" select="$PAR_NO"/>
3057 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
3058 <xsl:apply-templates select = "*[2]" mode = "semantics">
3059 <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
3060 <xsl:with-param name="PARAM" select="$PARAM"/>
3061 <xsl:with-param name="PAREN" select="$PAREN"/>
3062 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3063 </xsl:apply-templates>
3064 <xsl:for-each select = "*[position()>2]">
3066 <!-- HELM: xref added -->
3067 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:cartesianproduct/@id">
3068 <xsl:attribute name="xref">
3069 <xsl:value-of select="../m:cartesianproduct/@id"/>
3072 <!-- HELM: not rendered correctly <![CDATA[×]]> -->
3073 <xsl:text disable-output-escaping="yes">×</xsl:text></m:mo>
3074 <xsl:apply-templates select = "." mode="semantics">
3075 <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
3076 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
3077 <xsl:with-param name="PAREN" select="$PAREN"/>
3078 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3079 </xsl:apply-templates>
3083 <!-- HELM WARNING: card id was lost! -->
3084 <xsl:template match = "m:apply[m:card[1]]">
3086 <m:mfenced open="|" close="|" separators=",">
3087 Now is: mrow + mo -->
3089 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3090 <xsl:attribute name="xref">
3091 <xsl:value-of select="@id"/>
3095 <!-- HELM: xref added -->
3096 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:card/@id">
3097 <xsl:attribute name="xref">
3098 <xsl:value-of select="m:card/@id"/>
3101 <xsl:for-each select = "*[position()>1]">
3102 <xsl:apply-templates select = "." mode="semantics"/>
3105 <!-- HELM: xref added -->
3106 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
3107 <xsl:attribute name="xref">
3108 <xsl:value-of select="m:setdiff/@id"/>
3112 <!-- HELM: </m:mfenced> -->
3116 <!-- ***************** SEQUENCES AND SERIES ***************** -->
3118 <xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
3120 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3121 <xsl:attribute name="xref">
3122 <xsl:value-of select="@id"/>
3126 <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
3129 <xsl:if test="*[1]=m:sum">
3130 <!-- HELM: xref added -->
3131 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
3132 <xsl:attribute name="xref">
3133 <xsl:value-of select="m:sum/@id"/>
3136 <xsl:text disable-output-escaping='yes'>∑</xsl:text>
3138 <xsl:if test="*[1]=m:product">
3139 <!-- HELM: xref added -->
3140 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
3141 <xsl:attribute name="xref">
3142 <xsl:value-of select="m:product/@id"/>
3145 <xsl:text disable-output-escaping='yes'>∏</xsl:text>
3149 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3151 <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
3153 <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
3155 <xsl:apply-templates select = "*[5]" mode = "semantics"/>
3157 <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
3160 <xsl:if test="*[1]=m:sum">
3161 <xsl:text disable-output-escaping='yes'>∑</xsl:text>
3163 <xsl:if test="*[1]=m:product">
3164 <xsl:text disable-output-escaping='yes'>∏</xsl:text>
3167 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3169 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
3171 <xsl:when test="*[2]=m:domainofapplication">
3174 <xsl:if test="*[1]=m:sum">
3175 <!-- HELM: xref added -->
3176 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
3177 <xsl:attribute name="xref">
3178 <xsl:value-of select="m:sum/@id"/>
3181 <!-- HELM: not rendered correctly <![CDATA[∑]]> -->
3182 <xsl:text disable-output-escaping="yes">∑</xsl:text>
3184 <xsl:if test="*[1]=m:product">
3185 <!-- HELM: xref added -->
3186 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
3187 <xsl:attribute name="xref">
3188 <xsl:value-of select="m:product/@id"/>
3191 <!-- HELM: not rendered correctly <![CDATA[∏]]> -->
3192 <xsl:text disable-output-escaping="yes">∏</xsl:text>
3195 <xsl:apply-templates select="m:domainofapplication" mode = "semantics"/>
3198 <xsl:apply-templates select="*[position()=last()]" mode = "semantics"/>
3205 <!-- HELM: was (it didn't match with prefixed MathML)
3206 <xsl:template match="m:apply[child::*[position()=1 and name()='int']]">
3208 <xsl:template match="m:apply[child::*[position()=1 and self::m:int]]">
3210 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3211 <xsl:attribute name="xref">
3212 <xsl:value-of select="@id"/>
3216 <xsl:when test="m:condition">
3219 <!-- HELM: xref added -->
3220 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3221 <xsl:attribute name="xref">
3222 <xsl:value-of select="m:int/@id"/>
3225 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3226 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3227 <xsl:apply-templates select="m:condition" mode="semantics"/>
3230 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3234 <xsl:apply-templates select="m:bvar" mode="semantics"/>
3237 <xsl:when test="m:domainofapplication">
3240 <!-- HELM: xref added -->
3241 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3242 <xsl:attribute name="xref">
3243 <xsl:value-of select="m:int/@id"/>
3246 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3247 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3248 <xsl:apply-templates select="m:domainofapplication" mode="semantics"/>
3251 <xsl:apply-templates select="*[position()=last()]" mode="semantics" />
3256 <xsl:when test="m:interval">
3259 <!-- HELM: xref added -->
3260 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3261 <xsl:attribute name="xref">
3262 <xsl:value-of select="m:int/@id"/>
3265 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3266 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3267 <xsl:apply-templates select="m:interval/*[position()=1]" mode="semantics" />
3268 <xsl:apply-templates select="m:interval/*[position()=2]" mode="semantics"/>
3270 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3272 <xsl:apply-templates select="m:bvar" mode="semantics"/>
3274 <xsl:when test="m:lowlimit">
3277 <!-- HELM: xref added -->
3278 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3279 <xsl:attribute name="xref">
3280 <xsl:value-of select="m:int/@id"/>
3283 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3284 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3285 <m:mrow><xsl:apply-templates select="m:lowlimit" mode="semantics"/></m:mrow>
3286 <m:mrow><xsl:apply-templates select="m:uplimit" mode="semantics"/></m:mrow>
3288 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3289 <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
3293 <!-- HELM: xref added -->
3294 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3295 <xsl:attribute name="xref">
3296 <xsl:value-of select="m:int/@id"/>
3299 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3300 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3301 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3302 <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
3310 <xsl:template match = "m:apply[m:limit[1]]">
3312 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3313 <xsl:attribute name="xref">
3314 <xsl:value-of select="@id"/>
3319 <!-- HELM: xref added -->
3320 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lim/@id">
3321 <xsl:attribute name="xref">
3322 <xsl:value-of select="m:lim/@id"/>
3326 <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
3327 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3328 <m:mo><xsl:text disable-output-escaping='yes'>→</xsl:text></m:mo>
3329 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3331 <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
3332 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3336 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
3341 <!-- ***************** TRIGONOMETRY ***************** -->
3343 <xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos |
3344 self::m:tan | self::m:sec | self::m:csc |
3345 self::m:cot | self::m:sinh | self::m:cosh |
3346 self::m:tanh | self::m:sech | self::m:csch |
3347 self::m:coth | self::m:arcsin | self::m:arccos |
3348 self::m:arctan | self::m:arcsec | self::m:arccsc |
3349 self::m:arccot | self::m:arcsinh | self::m:arccosh |
3350 self::m:arctanh | self::m:arcsech | self::m:arccsch |
3351 self::m:arccoth ] ]">
3354 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3355 <xsl:attribute name="xref">
3356 <xsl:value-of select="@id"/>
3359 <xsl:if test="not(parent::m:apply[m:power[1]])">
3360 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
3362 <xsl:if test="parent::m:apply[m:power[1]]">
3364 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
3365 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
3368 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
3369 <xsl:apply-templates select = "*[2]" mode = "semantics">
3370 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
3371 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3372 </xsl:apply-templates>
3376 <xsl:template match = "*" mode="trigonometry">
3378 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3379 <xsl:attribute name="xref">
3380 <xsl:value-of select="@id"/>
3384 <xsl:when test="self::m:sin">
3385 <xsl:value-of select="'sin'"/>
3387 <xsl:when test="self::m:cos">
3388 <xsl:value-of select="'cos'"/>
3390 <xsl:when test="self::m:tan">
3391 <xsl:value-of select="'tan'"/>
3393 <xsl:when test="self::m:sec">
3394 <xsl:value-of select="'sec'"/>
3396 <xsl:when test="self::m:csc">
3397 <xsl:value-of select="'csc'"/>
3399 <xsl:when test="self::m:cot">
3400 <xsl:value-of select="'cot'"/>
3402 <xsl:when test="self::m:sinh">
3403 <xsl:value-of select="'sinh'"/>
3405 <xsl:when test="self::m:cosh">
3406 <xsl:value-of select="'cosh'"/>
3408 <xsl:when test="self::m:tanh">
3409 <xsl:value-of select="'tanh'"/>
3411 <xsl:when test="self::m:sech">
3412 <xsl:value-of select="'sech'"/>
3414 <xsl:when test="self::m:csch">
3415 <xsl:value-of select="'csch'"/>
3417 <xsl:when test="self::m:coth">
3418 <xsl:value-of select="'coth'"/>
3420 <xsl:when test="self::m:arcsin">
3421 <xsl:value-of select="'arcsin'"/>
3423 <xsl:when test="self::m:arccos">
3424 <xsl:value-of select="'arccos'"/>
3426 <xsl:when test="self::m:arctan">
3427 <xsl:value-of select="'arctan'"/>
3429 <xsl:when test="self::m:arcsec">
3430 <xsl:value-of select="'arcsec'"/>
3432 <xsl:when test="self::m:arccsc">
3433 <xsl:value-of select="'arccsc'"/>
3435 <xsl:when test="self::m:arccot">
3436 <xsl:value-of select="'arccot'"/>
3438 <xsl:when test="self::m:arcsinh">
3439 <xsl:value-of select="'arcsinh'"/>
3441 <xsl:when test="self::m:arccosh">
3442 <xsl:value-of select="'arccosh'"/>
3444 <xsl:when test="self::m:arctanh">
3445 <xsl:value-of select="'arctanh'"/>
3447 <xsl:when test="self::m:arcsech">
3448 <xsl:value-of select="'arcsech'"/>
3450 <xsl:when test="self::m:arccsch">
3451 <xsl:value-of select="'arccsch'"/>
3453 <xsl:when test="self::m:arccoth">
3454 <xsl:value-of select="'arccot'"/>
3461 <!-- ***************** STATISTICS ***************** -->
3463 <!-- HELM WARNING: mean id was lost! -->
3464 <xsl:template match = "m:apply[m:mean[1]]">
3466 <m:mfenced open="<" close=">" separators=",">
3467 Now is: mrow + mo + separator (mo) -->
3469 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3470 <xsl:attribute name="xref">
3471 <xsl:value-of select="@id"/>
3475 <!-- HELM: xref added -->
3476 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3477 <xsl:attribute name="xref">
3478 <xsl:value-of select="m:mean/@id"/>
3480 </xsl:if><</m:mo>
3481 <xsl:for-each select = "*[position()>1]">
3482 <!-- HELM: if added -->
3483 <xsl:if test="position() != 1">
3484 <m:mo separator="true">,</m:mo>
3486 <xsl:apply-templates select = "." mode="semantics"/>
3489 <!-- HELM: xref added -->
3490 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3491 <xsl:attribute name="xref">
3492 <xsl:value-of select="m:mean/@id"/>
3494 </xsl:if>></m:mo>
3496 <!-- HELM: </m:mfenced> -->
3499 <xsl:template match = "m:apply[m:sdev[1]]">
3501 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3502 <xsl:attribute name="xref">
3503 <xsl:value-of select="@id"/>
3507 <!-- HELM: xref added -->
3508 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sdev/@id">
3509 <xsl:attribute name="xref">
3510 <xsl:value-of select="m:sdev/@id"/>
3513 <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
3514 <m:mfenced separators=",">
3515 <xsl:for-each select = "*[position()>1]">
3516 <xsl:apply-templates select = "." mode="semantics"/>
3522 <xsl:template match = "m:apply[m:variance[1]]">
3524 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3525 <xsl:attribute name="xref">
3526 <xsl:value-of select="@id"/>
3530 <!-- HELM: xref added -->
3531 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:variance/@id">
3532 <xsl:attribute name="xref">
3533 <xsl:value-of select="m:variance/@id"/>
3536 <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
3538 <m:mfenced separators=",">
3539 <xsl:for-each select = "*[position()>1]">
3540 <xsl:apply-templates select = "." mode="semantics"/>
3548 <xsl:template match = "m:apply[m:median[1]]">
3550 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3551 <xsl:attribute name="xref">
3552 <xsl:value-of select="@id"/>
3556 <!-- HELM: xref added -->
3557 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:median/@id">
3558 <xsl:attribute name="xref">
3559 <xsl:value-of select="m:median/@id"/>
3561 </xsl:if>median</m:mo>
3562 <m:mfenced separators=",">
3563 <xsl:for-each select = "*[position()>1]">
3564 <xsl:apply-templates select = "." mode="semantics"/>
3570 <xsl:template match = "m:apply[m:mode[1]]">
3572 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3573 <xsl:attribute name="xref">
3574 <xsl:value-of select="@id"/>
3578 <!-- HELM: xref added -->
3579 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mode/@id">
3580 <xsl:attribute name="xref">
3581 <xsl:value-of select="m:mode/@id"/>
3583 </xsl:if>mode</m:mo>
3584 <m:mfenced separators=",">
3585 <xsl:for-each select = "*[position()>1]">
3586 <xsl:apply-templates select = "." mode="semantics"/>
3592 <!-- HELM WARNING: mean id was lost! -->
3593 <xsl:template match = "m:apply[m:moment[1]]">
3595 <m:mfenced open="<" close=">" separators="">
3596 Now is: mrow + mo -->
3598 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3599 <xsl:attribute name="xref">
3600 <xsl:value-of select="@id"/>
3604 <!-- HELM: xref added -->
3605 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:moment/@id">
3606 <xsl:attribute name="xref">
3607 <xsl:value-of select="m:momemt/@id"/>
3609 </xsl:if><</m:mo>
3610 <xsl:if test="*[2]=m:degree and not(*[3]=m:momentabout)">
3612 <xsl:apply-templates select="*[3]" mode = "semantics"/>
3613 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3616 <xsl:if test="*[2]=m:degree and *[3]=m:momentabout">
3618 <xsl:apply-templates select="*[4]" mode = "semantics"/>
3619 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3622 <xsl:if test="not(*[2]=m:degree) and *[2]=m:momentabout">
3623 <xsl:for-each select = "*[position()>2]">
3624 <xsl:apply-templates select = "." mode="semantics"/>
3627 <xsl:if test="not(*[2]=m:degree) and not(*[2]=m:momentabout)">
3628 <xsl:for-each select = "*[position()>1]">
3629 <xsl:apply-templates select = "." mode="semantics"/>
3633 <!-- HELM: xref added -->
3634 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3635 <xsl:attribute name="xref">
3636 <xsl:value-of select="m:mean/@id"/>
3638 </xsl:if>></m:mo>
3640 <!-- HELM: </m:mfenced> -->
3644 <!-- ***************** LINEAR ALGEBRA ***************** -->
3646 <xsl:template match="m:vector">
3647 <m:mfenced separators="">
3648 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3649 <xsl:attribute name="xref">
3650 <xsl:value-of select="@id"/>
3654 <xsl:for-each select="*">
3656 <xsl:apply-templates select="." mode = "semantics"/>
3663 <xsl:template match = "m:matrix">
3664 <m:mfenced separators="">
3665 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3666 <xsl:attribute name="xref">
3667 <xsl:value-of select="@id"/>
3671 <xsl:apply-templates select="*" mode = "semantics"/>
3676 <xsl:template match = "m:matrixrow">
3678 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3679 <xsl:attribute name="xref">
3680 <xsl:value-of select="@id"/>
3683 <xsl:for-each select="*">
3685 <xsl:apply-templates select="." mode = "semantics"/>
3691 <xsl:template match = "m:apply[m:determinant[1]]">
3693 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3694 <xsl:attribute name="xref">
3695 <xsl:value-of select="@id"/>
3699 <!-- HELM: xref added -->
3700 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:determinant/@id">
3701 <xsl:attribute name="xref">
3702 <xsl:value-of select="m:determinant/@id"/>
3705 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3709 <xsl:template match = "m:apply[m:transpose[1]]">
3711 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3712 <xsl:attribute name="xref">
3713 <xsl:value-of select="@id"/>
3716 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3718 <!-- HELM: xref added -->
3719 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:transpose/@id">
3720 <xsl:attribute name="xref">
3721 <xsl:value-of select="m:transpose/@id"/>
3727 <!-- HELM: ERROR, this template generates the selected content elements
3728 and doesn't generate the presentation for selector -->
3729 <!--<xsl:template match = "m:apply[m:selector[1]]">
3730 <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
3731 <xsl:variable name="m" select = "*[3]"/>
3733 <xsl:when test="*[4]=m:cn">
3734 <xsl:variable name="n" select = "*[4]"/>
3735 <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
3738 <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
3742 <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
3743 <xsl:variable name="m" select = "*[3]"/>
3744 <xsl:copy-of select = "*[2]/*[position()=$m]"/>
3748 <xsl:template match = "m:apply[m:selector[1]]">
3750 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3751 <xsl:attribute name="xref">
3752 <xsl:value-of select="@id"/>
3755 <xsl:apply-templates select = "*[2]" mode="semantics"/>
3757 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:selector/@id">
3758 <xsl:attribute name="xref">
3759 <xsl:value-of select="m:selector/@id"/>
3763 <xsl:when test="*[3]=m:cn">
3764 <xsl:apply-templates select = "*[3]" mode="semantics"/>
3770 <xsl:if test="*[2]=m:matrix and *[4]=m:cn">
3771 <xsl:apply-templates select = "*[4]" mode="semantics"/>
3777 <xsl:template match = "m:apply[m:vectorproduct[1] |
3778 m:scalarproduct[1] | m:outerproduct[1]]">
3780 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3781 <xsl:attribute name="xref">
3782 <xsl:value-of select="@id"/>
3785 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3787 <xsl:if test="m:vectorproduct[1]">
3788 <!-- HELM: xref added -->
3789 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:vectorproduct/@id">
3790 <xsl:attribute name="xref">
3791 <xsl:value-of select="m:vectorproduct/@id"/>
3794 <xsl:text disable-output-escaping='yes'>⨯</xsl:text>
3796 <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
3797 <!-- HELM: xref added -->
3798 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and *[1]/@id">
3799 <xsl:attribute name="xref">
3800 <xsl:value-of select="*[1]/@id"/>
3803 <xsl:value-of select="'.'"/>
3806 <xsl:apply-templates select="*[3]" mode = "semantics"/>
3811 <!-- ***************** CONSTANT and SYMBOL ELEMENTS ***************** -->
3813 <xsl:template match="m:integers">
3815 <!-- HELM: xref added -->
3816 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:integers/@id">
3817 <xsl:attribute name="xref">
3818 <xsl:value-of select="m:integers/@id"/>
3821 <xsl:text disable-output-escaping='yes'>ℤ</xsl:text></m:mi>
3824 <xsl:template match="m:reals">
3826 <!-- HELM: xref added -->
3827 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:reals/@id">
3828 <xsl:attribute name="xref">
3829 <xsl:value-of select="m:reals/@id"/>
3832 <xsl:text disable-output-escaping='yes'>ℝ</xsl:text></m:mi>
3835 <xsl:template match="m:rationals">
3837 <!-- HELM: xref added -->
3838 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rationals/@id">
3839 <xsl:attribute name="xref">
3840 <xsl:value-of select="m:rationals/@id"/>
3843 <xsl:text disable-output-escaping='yes'>ℚ</xsl:text></m:mi>
3846 <xsl:template match="m:naturalnumbers">
3848 <!-- HELM: xref added -->
3849 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:naturalnumbers/@id">
3850 <xsl:attribute name="xref">
3851 <xsl:value-of select="m:naturalnumbers/@id"/>
3854 <xsl:text disable-output-escaping='yes'>ℕ</xsl:text></m:mi>
3857 <xsl:template match="m:complexes">
3859 <!-- HELM: xref added -->
3860 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:complexes/@id">
3861 <xsl:attribute name="xref">
3862 <xsl:value-of select="m:complexes/@id"/>
3865 <xsl:text disable-output-escaping='yes'>ℂ</xsl:text></m:mi>
3868 <xsl:template match="m:primes">
3870 <!-- HELM: xref added -->
3871 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:primes/@id">
3872 <xsl:attribute name="xref">
3873 <xsl:value-of select="m:primes/@id"/>
3876 <xsl:text disable-output-escaping='yes'>ℙ</xsl:text></m:mi>
3879 <xsl:template match="m:exponentiale">
3881 <!-- HELM: xref added -->
3882 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exponentiale/@id">
3883 <xsl:attribute name="xref">
3884 <xsl:value-of select="m:exponentiale/@id"/>
3887 <xsl:text disable-output-escaping="yes">ⅇ</xsl:text></m:mi>
3890 <xsl:template match="m:imaginaryi">
3892 <!-- HELM: xref added -->
3893 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginaryi/@id">
3894 <xsl:attribute name="xref">
3895 <xsl:value-of select="m:imaginaryi/@id"/>
3898 <!-- HELM: not rendered correctly <![CDATA[ⅈ]]> -->
3899 <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
3902 <xsl:template match="m:notanumber">
3904 <!-- HELM: xref added -->
3905 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notanumber/@id">
3906 <xsl:attribute name="xref">
3907 <xsl:value-of select="m:notanumber/@id"/>
3912 <xsl:template match="m:true">
3914 <!-- HELM: xref added -->
3915 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:true/@id">
3916 <xsl:attribute name="xref">
3917 <xsl:value-of select="m:true/@id"/>
3919 </xsl:if>true</m:mi>
3922 <xsl:template match="m:false">
3924 <!-- HELM: xref added -->
3925 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:false/@id">
3926 <xsl:attribute name="xref">
3927 <xsl:value-of select="m:false/@id"/>
3929 </xsl:if>false</m:mi>
3932 <xsl:template match="m:emptyset">
3934 <!-- HELM: xref added -->
3935 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:emptyset/@id">
3936 <xsl:attribute name="xref">
3937 <xsl:value-of select="m:emptyset/@id"/>
3940 <!-- HELM: not rendered correctly <![CDATA[∅]]> -->
3941 <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
3944 <xsl:template match="m:pi">
3946 <!-- HELM: xref added -->
3947 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:pi/@id">
3948 <xsl:attribute name="xref">
3949 <xsl:value-of select="m:pi/@id"/>
3952 <!-- HELM: not rendered correctly <![CDATA[π]]> -->
3953 <xsl:text disable-output-escaping="yes">π</xsl:text></m:mi>
3956 <xsl:template match="m:eulergamma">
3958 <!-- HELM: xref added -->
3959 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:eulergamma/@id">
3960 <xsl:attribute name="xref">
3961 <xsl:value-of select="m:eulergamma/@id"/>
3964 <!-- HELM: not rendered correctly <![CDATA[γ]]> -->
3965 <xsl:text disable-output-escaping="yes">γ</xsl:text></m:mi>
3968 <xsl:template match="m:infinity">
3970 <!-- HELM: xref added -->
3971 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:infinity/@id">
3972 <xsl:attribute name="xref">
3973 <xsl:value-of select="m:infinity/@id"/>
3976 <!-- HELM: not rendered correctly <![CDATA[∞]]> -->
3977 <xsl:text disable-output-escaping="yes">∞</xsl:text></m:mi>