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 <!-- (see 7.1.1.2) -->
25 <!-- Changed the mml prefix into m (see A.3) -->
26 <!-- Added xref to every mo element -->
27 <!-- New csymbol template -->
28 <!-- reln is not supported -->
29 <!-- HELM tag used for changes -->
30 <!-- First draft: April 10 2002, Irene Schena -->
31 <!-- ====================================================== -->
33 <xsl:stylesheet id="mmlctop.xsl"
35 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
36 xmlns:m="http://www.w3.org/1998/Math/MathML">
38 <!-- HELM: we don't have a default namespace.
39 Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
42 <xsl:output method="xml" indent="yes"/>
45 <xsl:output method="xml"/>
47 <xsl:strip-space elements="apply semantics annotation-xml
48 csymbol fn cn ci interval matrix matrixrow vector
49 lambda bvar condition logbase degree set list
53 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
54 <!-- Parameters, variables and constants -->
55 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
57 <!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
59 <!-- Strip off semantics -->
60 <xsl:variable name="SEM_STRIP" select="-1"/>
62 <!-- Pass semantics "as is" -->
63 <xsl:variable name="SEM_PASS" select="0"/>
65 <!-- Add semantics at top level only -->
66 <xsl:variable name="SEM_TOP" select="1"/>
68 <!-- Add semantics at all levels -->
69 <xsl:variable name="SEM_ALL" select="2"/>
71 <!-- Semantics at top level only, with id refs -->
72 <!-- NOTE: ids have to be already present in the
73 input for this feature to work. -->
74 <xsl:variable name="SEM_XREF" select="3"/>
76 <!-- No semantics at top level, with id refs -->
77 <!-- NOTE: ids have to be already present in the
78 input for this feature to work. -->
79 <xsl:variable name="SEM_XREF_EXT" select="4"/>
82 <!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
83 <!-- Assumes one of the above values; SEM_PASS is the default -->
84 <!-- The default can be overridden by specifying different -->
85 <!-- value on the command line when the stylesheet is invoked -->
87 <!-- HELM: $SEM_SW was SEM_PASS (error!) -->
88 <xsl:param name="SEM_SW" select="$SEM_XREF"/>
91 <!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
92 <xsl:variable name="UNION_OP" select="2"/>
93 <xsl:variable name="INTERSECT_OP" select="6"/>
94 <xsl:variable name="SETDIFF_OP" select="4"/>
95 <xsl:variable name="NO_PREC" select="0"/>
96 <xsl:variable name="UNION_PREC" select="1"/>
97 <xsl:variable name="SETDIFF_PREC" select="1"/>
98 <xsl:variable name="INTERSECT_PREC" select="3"/>
99 <xsl:variable name="CARTPROD_PREC" select="3"/>
100 <xsl:variable name="OR_PREC" select="5"/>
101 <xsl:variable name="XOR_PREC" select="5"/>
102 <xsl:variable name="AND_PREC" select="7"/>
103 <xsl:variable name="PLUS_PREC" select="9"/>
104 <xsl:variable name="MINUS_PREC" select="9"/>
105 <xsl:variable name="MUL_PREC" select="11"/>
106 <xsl:variable name="DIV_PREC" select="11"/>
107 <xsl:variable name="NEG_PREC" select="13"/>
108 <xsl:variable name="FUNCTION_PREC" select="99"/>
110 <!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
112 <xsl:variable name="YES" select="1"/>
113 <xsl:variable name="NO" select="0"/>
114 <xsl:variable name="NO_PARAM" select="-1"/>
115 <xsl:variable name="PAR_SAME" select="-3"/>
116 <xsl:variable name="PAR_YES" select="-5"/>
117 <xsl:variable name="PAR_NO" select="-7"/>
118 <xsl:variable name="DOESNT_MATTER" select="-9"/>
120 <!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
122 <!-- All templates are subdivided into the following categories
123 (listed in the order of appearance in the stylesheet):
125 THE TOPMOST ELEMENT: MATH
131 BASIC CONTAINER ELEMENTS
134 BASIC CONTENT ELEMENTS
135 fn, interval, inverse, sep, condition, declare, lambda, compose, ident
137 *NEW: apply, piecewise, domain, codomain, image
139 ARITHMETIC, ALGEBRA & LOGIC
140 quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
141 times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate,
144 *NEW: floor, ceiling, lcm
147 neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
148 subset, prsubset, eq, gt, lt, geq, leq, equivalent
151 ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
152 logbase, divergence, grad, curl, laplacian
155 set, list, union, intersect, setdiff, card
157 *NEW: cartesianproduct
165 sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
166 arcsin, arccos, arctan
168 *NEW: arcsec, arccsc, arccot, arcsinh, arccosh, arctanh,
169 arcsech, arccsch, arccoth,
172 mean, sdev, variance, median, mode, moment
175 vector, matrix, matrixrow, determinant, transpose, selector,
176 vectorproduct, scalarproduct, outerproduct
180 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
181 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
182 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
185 <!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
187 <xsl:template match = "m:math">
188 <!-- HELM: <m:math> only for HELM! -->
190 <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or $SEM_SW=$SEM_XREF"> <m:semantics>
192 <xsl:apply-templates mode = "semantics"/>
194 <m:annotation-xml encoding="MathML">
195 <xsl:copy-of select="*"/>
201 <xsl:apply-templates mode = "semantics"/>
205 <!-- HELM: </m:math> -->
209 <!-- ***************** SEMANTICS HANDLING ***************** -->
211 <!-- This template is called recursively. At each level -->
212 <!-- in the source tree it decides whether to strip off, -->
213 <!-- pass or add semantics at that level (depending on the -->
214 <!-- value of SEM_SW parameter). Then the actual template -->
215 <!-- is applied to the node. -->
217 <xsl:template match = "m:*" mode = "semantics">
218 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
219 <xsl:param name="IN_PREC" select="$NO_PREC"/>
220 <xsl:param name="PARAM" select="$NO_PARAM"/>
221 <xsl:param name="PAREN" select="$PAR_NO"/>
222 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
224 <xsl:when test="$SEM_SW=$SEM_STRIP and self::m:semantics">
225 <xsl:apply-templates select="m:annotation-xml[@encoding='MathML']">
226 <xsl:with-param name="IN_OP" select="$IN_OP"/>
227 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
228 <xsl:with-param name="PARAM" select="$PARAM"/>
229 <xsl:with-param name="PAREN" select="$PAREN"/>
230 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
231 </xsl:apply-templates>
233 <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::m:semantics">
235 <xsl:apply-templates select="*[1]">
236 <xsl:with-param name="IN_OP" select="$IN_OP"/>
237 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
238 <xsl:with-param name="PARAM" select="$PARAM"/>
239 <xsl:with-param name="PAREN" select="$PAREN"/>
240 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
241 </xsl:apply-templates>
242 <xsl:copy-of select="m:annotation-xml"/>
245 <xsl:when test="$SEM_SW=$SEM_ALL">
248 <xsl:when test="self::m:semantics">
249 <xsl:apply-templates select="*[1]">
250 <xsl:with-param name="IN_OP" select="$IN_OP"/>
251 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
252 <xsl:with-param name="PARAM" select="$PARAM"/>
253 <xsl:with-param name="PAREN" select="$PAREN"/>
254 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
255 </xsl:apply-templates>
256 <xsl:copy-of select="m:annotation-xml"/>
259 <xsl:apply-templates select=".">
260 <xsl:with-param name="IN_OP" select="$IN_OP"/>
261 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
262 <xsl:with-param name="PARAM" select="$PARAM"/>
263 <xsl:with-param name="PAREN" select="$PAREN"/>
264 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
265 </xsl:apply-templates>
266 <m:annotation-xml encoding="MathML">
267 <xsl:copy-of select="."/>
273 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
275 <!-- HELM: syntax error, was sematics -->
276 <xsl:when test="self::m:semantics">
278 <xsl:copy-of select="@*"/>
279 <xsl:attribute name="xref">
280 <xsl:value-of select="@id"/>
282 <xsl:copy-of select="*[1]"/>
283 <xsl:copy-of select="m:annotation-xml"/>
287 <xsl:apply-templates select=".">
288 <xsl:with-param name="IN_OP" select="$IN_OP"/>
289 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
290 <xsl:with-param name="PARAM" select="$PARAM"/>
291 <xsl:with-param name="PAREN" select="$PAREN"/>
292 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
293 </xsl:apply-templates>
299 <xsl:when test="self::m:semantics">
300 <xsl:copy-of select="."/>
303 <xsl:apply-templates select=".">
304 <xsl:with-param name="IN_OP" select="$IN_OP"/>
305 <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
306 <xsl:with-param name="PARAM" select="$PARAM"/>
307 <xsl:with-param name="PAREN" select="$PAREN"/>
308 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
309 </xsl:apply-templates>
316 <xsl:template match = "m:semantics">
317 <xsl:apply-templates select="." mode = "semantics"/>
321 <!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
323 <xsl:template match = "m:cn">
324 <xsl:param name="IN_PREC" select="$NO_PREC"/>
325 <xsl:param name="PAREN" select="$PAR_NO"/>
326 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
328 <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
329 and $PAR_NO_IGNORE=$NO">
330 <m:mfenced separators="">
331 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
332 <xsl:attribute name="xref">
333 <xsl:value-of select="@id"/>
336 <xsl:apply-templates select="." mode="cn"/>
341 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
342 <xsl:apply-templates select="." mode="cnid"/>
345 <xsl:apply-templates select="." mode="cn"/>
352 <!-- HELM: the entity ⁢ is not defined -->
353 <xsl:template match = "m:cn" mode="cn">
355 <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
357 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
358 <m:mn> <xsl:value-of select="@base"/> </m:mn>
361 <xsl:when test="@type='e-notation' and not(@base) and child::m:sep[1]">
362 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
363 <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
365 <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
366 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
368 <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
369 <m:mfenced separators="">
370 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
371 <xsl:if test="text()[2] < 0">
373 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
375 <xsl:if test="not(text()[2] < 0)">
377 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
379 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
383 <xsl:when test="@type='complex' and @base and child::m:sep[1]">
385 <m:mfenced separators="">
386 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
387 <xsl:if test="text()[2] < 0">
389 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
391 <xsl:if test="not(text()[2] < 0)">
393 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
395 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
398 <m:mn> <xsl:value-of select="@base"/> </m:mn>
401 <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
403 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
404 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
407 <xsl:when test="@type='rational' and @base and child::m:sep[1]">
411 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
412 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
415 <m:mn> <xsl:value-of select="@base"/> </m:mn>
418 <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
421 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
422 <m:mfenced separators=",">
423 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
424 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
428 <xsl:when test="@type='polar' and @base and child::m:sep[1]">
432 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
433 <m:mfenced separators=",">
434 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
435 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
438 <m:mn> <xsl:value-of select="@base"/> </m:mn>
442 <!-- HELM: cn could contain MathML presentation -->
444 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
447 <xsl:when test="child::text() and not(*[1])">
448 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
452 <xsl:when test="not(*[2])">
453 <xsl:copy-of select="*[1]"/>
457 <xsl:copy-of select="*|text()"/>
468 <xsl:template match = "m:cn" mode="cnid">
470 <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
471 <m:msub xref="{@id}">
472 <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
473 <m:mn> <xsl:value-of select="@base"/> </m:mn>
476 <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
477 <m:mfenced separators="" xref="{@id}">
478 <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
479 <xsl:if test="text()[2] < 0">
481 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
483 <xsl:if test="not(text()[2] < 0)">
485 <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
487 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
491 <xsl:when test="@type='complex' and @base and child::m:sep[1]">
492 <m:msub xref="{@id}">
493 <m:mfenced separators="">
494 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
495 <xsl:if test="text()[2] < 0">
497 <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
499 <xsl:if test="not(text()[2] < 0)">
501 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
503 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
506 <m:mn> <xsl:value-of select="@base"/> </m:mn>
509 <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
510 <m:mfrac xref="{@id}">
511 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
512 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
515 <xsl:when test="@type='rational' and @base and child::m:sep[1]">
516 <m:msub xref="{@id}">
519 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
520 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
523 <m:mn> <xsl:value-of select="@base"/> </m:mn>
526 <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
527 <m:mrow xref="{@id}">
529 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
530 <m:mfenced separators=",">
531 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
532 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
536 <xsl:when test="@type='polar' and @base and child::m:sep[1]">
537 <m:msub xref="{@id}">
540 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
541 <m:mfenced separators=",">
542 <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
543 <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
546 <m:mn> <xsl:value-of select="@base"/> </m:mn>
550 <!-- HELM: cn could contain MathML presentation -->
552 <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
555 <xsl:when test="child::text() and not(*[1])">
556 <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
559 <xsl:variable name="id" select="@id"/>
561 <xsl:when test="not(*[2])">
562 <xsl:for-each select="*[1]">
564 <xsl:attribute name="xref">
565 <xsl:value-of select="$id"/>
567 <xsl:copy-of select="@*|*"/>
572 <m:mrow xref="{$id}">
573 <xsl:copy-of select="*|text()"/>
584 <xsl:template match = "m:ci">
586 <xsl:when test="@type='vector' or @type=matrix or @type=set">
587 <m:mi mathvariant="bold">
588 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
589 <xsl:attribute name="xref">
590 <xsl:value-of select="@id"/>
593 <xsl:apply-templates mode = "semantics"/>
596 <xsl:when test="child::text() and not(child::*[1])">
598 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
599 <xsl:attribute name="xref">
600 <xsl:value-of select="@id"/>
603 <!-- HELM: ERROR, added mode="semantics", it didn't generate identifiers -->
604 <xsl:apply-templates mode = "semantics"/>
607 <!-- HELM: text & markup !!! Not compliant with the specification -->
608 <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
610 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
611 <xsl:attribute name="xref">
612 <xsl:value-of select="@id"/>
615 <!-- HELM: added semantics mode -->
616 <xsl:apply-templates mode="semantics"/>
623 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
624 <xsl:attribute name="xref">
625 <xsl:value-of select="@id"/>
628 <xsl:apply-templates select="*"/>
631 <xsl:if test="not(*[2])">
632 <!-- HELM: ci could contain MathML presentation -->
634 <xsl:apply-templates select="*[1]"/>
636 <xsl:variable name="id" select="@id"/>
637 <xsl:for-each select="*[1]">
639 <xsl:attribute name="xref">
640 <xsl:value-of select="$id"/>
642 <xsl:copy-of select="@*|*"/>
651 <xsl:template match = "m:ci/m:*[not(self::m:sep)]">
652 <xsl:copy-of select = "."/>
655 <!-- HELM: revised version previous Version x.xx from Feb. 18, 2000 -->
656 <xsl:template match = "m:csymbol">
657 <!-- HELM: mrow to maintain csymbol id -->
659 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
660 <xsl:attribute name="xref">
661 <xsl:value-of select="@id"/>
664 <xsl:for-each select="* and text()">
666 <xsl:when test="text()">
667 <m:mo><xsl:value-of select="."/></m:mo>
670 <xsl:copy-of select = "."/>
677 <!-- HELM: csymbol cannot contain ci or cn elements, but only text and/or
678 presentation elements. PCDATA should render as if it were wrapped in
679 an mo. Mixed content: mrow which contains mo + presentation elements -->
680 <!-- <xsl:template match = "m:csymbol/m:*">
682 <xsl:when test="self::m:cn or self::m:ci">
683 <xsl:apply-templates mode = "semantics"/>
686 <xsl:copy-of select = "."/>
691 <xsl:template match = "m:csymbol/text()">
693 <xsl:when test=". < 0 or . = 0 or . > 0">
694 <m:mn> <xsl:copy-of select = "."/> </m:mn>
697 <m:mi> <xsl:copy-of select = "."/> </m:mi>
703 <!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
705 <!-- HELM: the entity ⁡ is not defined: -->
706 <!-- fn and domainofapplication are rendered as their content -->
707 <xsl:template match = "m:apply[m:*[1][self::m:fn]]">
709 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
710 <xsl:attribute name="xref">
711 <xsl:value-of select="@id"/>
714 <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
716 <!-- HELM: xref added -->
717 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:fn/@id">
718 <xsl:attribute name="xref">
719 <xsl:value-of select="m:fn/@id"/>
721 </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
722 <m:mfenced separators=",">
723 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
728 <!-- fn has been deprecated, so now we use: -->
729 <xsl:template match = "m:apply">
731 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
732 <xsl:attribute name="xref">
733 <xsl:value-of select="@id"/>
737 <xsl:when test="*[2]=m:domainofapplication">
739 <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
740 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
741 </xsl:apply-templates>
742 <xsl:apply-templates select = "*[position()=2]" mode = "semantics"/>
745 <!-- HELM: xref added -->
746 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:domainofapplication/@id">
747 <xsl:attribute name="xref">
748 <xsl:value-of select="m:domainofapplication/@id"/>
750 </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
751 <m:mfenced separators=",">
752 <xsl:apply-templates select = "*[position()>2]" mode = "semantics"/>
756 <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
757 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
758 </xsl:apply-templates>
759 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
760 <m:mfenced separators=",">
761 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
768 <xsl:template match = "m:domainofapplication">
769 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
772 <xsl:template match = "m:fn">
773 <xsl:apply-templates select = "*[1]" mode = "semantics">
774 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
775 </xsl:apply-templates>
778 <xsl:template match = "m:interval">
779 <m:mfenced separators=",">
780 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
781 <xsl:attribute name="xref">
782 <xsl:value-of select="@id"/>
785 <xsl:if test="@closure='closed' or @closure='closed-open'">
786 <xsl:attribute name="open">[</xsl:attribute>
788 <xsl:if test="@closure='closed' or @closure='open-closed'">
789 <xsl:attribute name="close">]</xsl:attribute>
791 <xsl:apply-templates select="*" mode = "semantics"/>
795 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
797 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
798 <xsl:attribute name="xref">
799 <xsl:value-of select="@id"/>
802 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
803 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
804 <m:mfenced separators=",">
805 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
810 <xsl:template match = "m:apply[*[1][self::m:inverse]]">
812 <xsl:when test="*[2]=m:exp or *[2]=m:ln or *[2]=m:sin or *[2]=m:cos or
813 *[2]=m:tan or *[2]=m:sec or *[2]=m:csc or *[2]=m:cot or
814 *[2]=m:sinh or *[2]=m:cosh or *[2]=m:tanh or *[2]=m:sech or
815 *[2]=m:csch or *[2]=m:coth or *[2]=m:arcsin or
816 *[2]=m:arccos or *[2]=m:arctan">
818 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
819 <xsl:attribute name="xref">
820 <xsl:value-of select="@id"/>
823 <xsl:apply-templates select="*[2]" mode="inverse"/>
828 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
829 <xsl:attribute name="xref">
830 <xsl:value-of select="@id"/>
833 <xsl:apply-templates select = "*[2]"/>
835 <!-- HELM: xref added -->
836 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:inverse/@id">
837 <xsl:attribute name="xref">
838 <xsl:value-of select="m:inverse/@id"/>
848 <xsl:template match = "*" mode="inverse">
850 <xsl:when test="self::m:exp">
851 <xsl:value-of select="'ln'"/>
853 <xsl:when test="self::m:ln">
854 <xsl:value-of select="'exp'"/>
856 <xsl:when test="self::m:sin">
857 <xsl:value-of select="'arcsin'"/>
859 <xsl:when test="self::m:cos">
860 <xsl:value-of select="'arccos'"/>
862 <xsl:when test="self::m:tan">
863 <xsl:value-of select="'arctan'"/>
865 <xsl:when test="self::m:sec">
866 <xsl:value-of select="'arcsec'"/>
868 <xsl:when test="self::m:csc">
869 <xsl:value-of select="'arccsc'"/>
871 <xsl:when test="self::m:cot">
872 <xsl:value-of select="'arccot'"/>
874 <xsl:when test="self::m:sinh">
875 <xsl:value-of select="'arcsinh'"/>
877 <xsl:when test="self::m:cosh">
878 <xsl:value-of select="'arccosh'"/>
880 <xsl:when test="self::m:tanh">
881 <xsl:value-of select="'arctanh'"/>
883 <xsl:when test="self::m:sech">
884 <xsl:value-of select="'arcsech'"/>
886 <xsl:when test="self::m:csch">
887 <xsl:value-of select="'arccsch'"/>
889 <xsl:when test="self::m:coth">
890 <xsl:value-of select="'arccoth'"/>
892 <xsl:when test="self::m:arcsin">
893 <xsl:value-of select="'sin'"/>
895 <xsl:when test="self::m:arccos">
896 <xsl:value-of select="'cos'"/>
898 <xsl:when test="self::m:arctan">
899 <xsl:value-of select="'tan'"/>
904 <xsl:template match = "m:sep"/>
906 <xsl:template match = "m:condition">
908 <xsl:when test="parent::m:apply[m:forall[1]]"/>
911 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
912 <m:mrow xref="{@id}">
913 <xsl:apply-templates select="*" mode = "semantics"/>
917 <xsl:if test="not(*[2])">
918 <xsl:apply-templates select="*" mode = "semantics"/>
922 <xsl:apply-templates select="*" mode = "semantics"/>
931 <xsl:template match = "m:declare"/>
933 <xsl:template match = "m:lambda">
935 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
936 <xsl:attribute name="xref">
937 <xsl:value-of select="@id"/>
940 <m:mo><xsl:text disable-output-escaping='yes'>Λ</xsl:text> </m:mo>
941 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
942 <m:mfenced separators=",">
943 <xsl:for-each select = "*">
945 <xsl:when test="self::m:ci or self::m:cn">
946 <xsl:apply-templates select = "." mode="semantics"/>
950 <xsl:apply-templates select = "." mode="semantics"/>
959 <xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
961 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
962 <xsl:attribute name="xref">
963 <xsl:value-of select="@id"/>
966 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
967 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
968 <m:mfenced separators=",">
969 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
974 <xsl:template match = "m:apply[*[1][self::m:compose]]">
975 <m:mfenced separators="">
976 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
977 <xsl:attribute name="xref">
978 <xsl:value-of select="@id"/>
981 <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] |
982 self::m:fn]" mode="semantics"/>
983 <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] |
986 <!-- HELM: xref added -->
987 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:compose/@id">
988 <xsl:attribute name="xref">
989 <xsl:value-of select="../m:compose/@id"/>
991 </xsl:if><xsl:text disable-output-escaping='yes'>∘</xsl:text></m:mo>
992 <xsl:apply-templates select = "." mode="semantics"/>
997 <xsl:template match = "m:ident">
999 <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1000 <m:mo xref="{@id}">id</m:mo>
1008 <xsl:template match="m:piecewise">
1010 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1011 <xsl:attribute name="xref">
1012 <xsl:value-of select="@id"/>
1015 <xsl:element name="m:mfenced">
1016 <xsl:attribute name="open">{</xsl:attribute>
1017 <xsl:attribute name="close"></xsl:attribute>
1018 <m:mtable groupalign="left left left">
1019 <xsl:for-each select="m:piece">
1020 <m:mtr columnalign="left">
1023 <xsl:apply-templates select="*[position()=1]" mode = "semantics"/>
1028 <m:mtext>if <m:mspace width="5"/></m:mtext>
1029 <xsl:apply-templates select="*[position()=2]" mode = "semantics"/>
1034 <xsl:if test="m:otherwise">
1035 <m:mtr columnalign="left">
1038 <xsl:apply-templates select="m:otherwise/*" mode = "semantics"/>
1053 <!-- HELM: was (it didn't match with prefixed MathML)
1054 <xsl:template match="m:apply[child::*[position()=1 and name()='domain']]">
1056 <xsl:template match="m:apply[child::*[position()=1 and self::m:domain]]">
1058 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1059 <xsl:attribute name="xref">
1060 <xsl:value-of select="@id"/>
1064 <m:mfenced open="(" close=")">
1065 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1070 <!-- HELM: was (it didn't match with prefixed MathML)
1071 <xsl:template match="m:apply[child::*[position()=1 and name()='codomain']]">
1073 <xsl:template match="m:apply[child::*[position()=1 and self::m:codomain]]">
1075 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1076 <xsl:attribute name="xref">
1077 <xsl:value-of select="@id"/>
1080 <m:mi>codomain</m:mi>
1081 <m:mfenced open="(" close=")">
1082 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1087 <!-- HELM: was (it didn't match with prefixed MathML)
1088 <xsl:template match="m:apply[child::*[position()=1 and name()='image']]">
1090 <xsl:template match="m:apply[child::*[position()=1 and self::m:image]]">
1092 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1093 <xsl:attribute name="xref">
1094 <xsl:value-of select="@id"/>
1098 <m:mfenced open="(" close=")">
1099 <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
1105 <!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
1107 <xsl:template match = "m:apply[m:quotient[1]]">
1109 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1110 <xsl:attribute name="xref">
1111 <xsl:value-of select="@id"/>
1114 <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">
1115 <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
1118 <!-- HELM: xref added -->
1119 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:quotient/@id">
1120 <xsl:attribute name="xref">
1121 <xsl:value-of select="m:quotient/@id"/>
1125 <xsl:apply-templates select="*[2]" mode = "semantics">
1126 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1127 </xsl:apply-templates>
1130 <xsl:apply-templates select="*[3]" mode = "semantics">
1131 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1132 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1133 </xsl:apply-templates>
1136 <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">
1137 <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
1142 <xsl:template match = "m:apply[*[1][self::m:exp]]">
1144 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1145 <xsl:attribute name="xref">
1146 <xsl:value-of select="@id"/>
1150 <!-- HELM: xref added -->
1151 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exp/@id">
1152 <xsl:attribute name="xref">
1153 <xsl:value-of select="m:exp/@id"/>
1156 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
1160 <xsl:template match = "m:apply[m:factorial[1]]">
1162 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1163 <xsl:attribute name="xref">
1164 <xsl:value-of select="@id"/>
1167 <xsl:apply-templates select = "*[2]" mode = "semantics">
1168 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1169 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1170 </xsl:apply-templates>
1172 <!-- HELM: xref added -->
1173 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorial/@id">
1174 <xsl:attribute name="xref">
1175 <xsl:value-of select="m:factorial/@id"/>
1181 <xsl:template match = "m:apply[m:max[1] | m:min[1]]">
1183 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1184 <xsl:attribute name="xref">
1185 <xsl:value-of select="@id"/>
1188 <xsl:if test="*[2]=m:bvar">
1190 <xsl:if test="*[1]=m:max">
1192 <!-- HELM: xref added -->
1193 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1194 <xsl:attribute name="xref">
1195 <xsl:value-of select="m:max/@id"/>
1199 <xsl:if test="*[1]=m:min">
1201 <!-- HELM: xref added -->
1202 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1203 <xsl:attribute name="xref">
1204 <xsl:value-of select="m:min/@id"/>
1208 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1210 <xsl:if test="*[3]=m:condition">
1211 <m:mfenced open="{{" close="}}" separators="">
1212 <m:mfenced open="" close="" separators=",">
1213 <xsl:for-each select = "*[position()>3]">
1214 <xsl:apply-templates select = "." mode="semantics"/>
1218 <xsl:apply-templates select="*[3]" mode = "semantics"/>
1221 <xsl:if test="not(*[3]=m:condition)">
1222 <m:mfenced open="{{" close="}}" separators=",">
1223 <xsl:for-each select = "*[position()>2]">
1224 <xsl:apply-templates select = "." mode="semantics"/>
1229 <xsl:if test="*[2]=m:condition">
1230 <xsl:if test="*[1]=m:max">
1232 <!-- HELM: xref added -->
1233 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1234 <xsl:attribute name="xref">
1235 <xsl:value-of select="m:max/@id"/>
1239 <xsl:if test="*[1]=m:min">
1241 <!-- HELM: xref added -->
1242 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1243 <xsl:attribute name="xref">
1244 <xsl:value-of select="m:min/@id"/>
1248 <m:mfenced open="{{" close="}}" separators="">
1249 <xsl:if test="*[3]">
1250 <m:mfenced open="" close="" separators=",">
1251 <xsl:for-each select = "*[position()>2]">
1252 <xsl:apply-templates select = "." mode="semantics"/>
1257 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1260 <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
1261 <xsl:if test="*[1]=m:max">
1263 <!-- HELM: xref added -->
1264 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
1265 <xsl:attribute name="xref">
1266 <xsl:value-of select="m:max/@id"/>
1270 <xsl:if test="*[1]=m:min">
1272 <!-- HELM: xref added -->
1273 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
1274 <xsl:attribute name="xref">
1275 <xsl:value-of select="m:min/@id"/>
1279 <m:mfenced open="{{" close="}}" separators=",">
1280 <xsl:for-each select = "*[position()>1]">
1281 <xsl:apply-templates select = "." mode="semantics"/>
1288 <xsl:template match = "m:apply[m:minus[1]]">
1289 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1290 <xsl:param name="PARAM" select="$NO_PARAM"/>
1291 <xsl:param name="PAREN" select="$PAR_NO"/>
1292 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1294 <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and
1296 <m:mfenced separators="">
1297 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1298 <xsl:attribute name="xref">
1299 <xsl:value-of select="@id"/>
1302 <xsl:apply-templates select="." mode="minus">
1303 <xsl:with-param name="PARAM" select="$PARAM"/>
1304 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1305 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1306 </xsl:apply-templates>
1309 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1310 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1311 and not($SEM_SW=$SEM_XREF_EXT)">
1312 <xsl:apply-templates select="." mode="minus">
1313 <xsl:with-param name="PARAM" select="$PARAM"/>
1314 <xsl:with-param name="PAREN" select="$PAREN"/>
1315 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1316 </xsl:apply-templates>
1320 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1321 <xsl:attribute name="xref">
1322 <xsl:value-of select="@id"/>
1325 <xsl:apply-templates select="." mode="minus">
1326 <xsl:with-param name="PARAM" select="$PARAM"/>
1327 <xsl:with-param name="PAREN" select="$PAREN"/>
1328 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1329 </xsl:apply-templates>
1335 <xsl:template match = "m:apply[m:minus[1]]" mode="minus">
1336 <xsl:param name="PARAM" select="$NO_PARAM"/>
1337 <xsl:param name="PAREN" select="$PAR_NO"/>
1338 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1339 <xsl:if test="not(*[3])">
1341 <!-- HELM: xref added -->
1342 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
1343 <xsl:attribute name="xref">
1344 <xsl:value-of select="m:minus/@id"/>
1347 <xsl:apply-templates select="*[2]" mode = "semantics">
1348 <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
1349 <xsl:with-param name="PAREN" select="$PAREN"/>
1350 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1351 </xsl:apply-templates>
1353 <xsl:if test="*[3]">
1354 <xsl:apply-templates select="*[2]" mode = "semantics">
1355 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
1356 <xsl:with-param name="PARAM" select="$PARAM"/>
1357 <xsl:with-param name="PAREN" select="$PAREN"/>
1358 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1359 </xsl:apply-templates>
1361 <!-- HELM: xref added -->
1362 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
1363 <xsl:attribute name="xref">
1364 <xsl:value-of select="m:minus/@id"/>
1367 <xsl:apply-templates select="*[3]" mode = "semantics">
1368 <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
1369 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1370 <xsl:with-param name="PAREN" select="$PAREN"/>
1371 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1372 </xsl:apply-templates>
1376 <xsl:template match = "m:apply[m:plus[1]]">
1377 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1378 <xsl:param name="PARAM" select="$NO_PARAM"/>
1379 <xsl:param name="PAREN" select="$PAR_NO"/>
1380 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1382 <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and
1384 <m:mfenced separators="">
1385 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1386 <xsl:attribute name="xref">
1387 <xsl:value-of select="@id"/>
1390 <xsl:apply-templates select="." mode="plus">
1391 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1392 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1393 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1394 </xsl:apply-templates>
1397 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1398 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1399 and not($SEM_SW=$SEM_XREF_EXT)">
1400 <xsl:apply-templates select="." mode="plus">
1401 <xsl:with-param name="PARAM" select="$PARAM"/>
1402 <xsl:with-param name="PAREN" select="$PAREN"/>
1403 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1404 </xsl:apply-templates>
1408 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1409 <xsl:attribute name="xref">
1410 <xsl:value-of select="@id"/>
1413 <xsl:apply-templates select="." mode="plus">
1414 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1415 <xsl:with-param name="PAREN" select="$PAREN"/>
1416 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1417 </xsl:apply-templates>
1423 <xsl:template match = "m:apply[m:plus[1]]" mode="plus">
1424 <xsl:param name="PARAM" select="$NO_PARAM"/>
1425 <xsl:param name="PAREN" select="$PAR_NO"/>
1426 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1427 <xsl:if test="*[2]">
1428 <xsl:apply-templates select="*[2]" mode = "semantics">
1429 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1430 <xsl:with-param name="PARAM" select="$PARAM"/>
1431 <xsl:with-param name="PAREN" select="$PAREN"/>
1432 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1433 </xsl:apply-templates>
1434 <xsl:for-each select = "*[position()>2]">
1436 <xsl:when test=". < 0">
1438 <m:mn> <xsl:value-of select="-."/> </m:mn>
1440 <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
1441 <xsl:apply-templates select="." mode = "semantics">
1442 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1443 <xsl:with-param name="PAREN" select="$PAREN"/>
1444 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1445 </xsl:apply-templates>
1449 <!-- HELM: xref added -->
1450 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:plus/@id">
1451 <xsl:attribute name="xref">
1452 <xsl:value-of select="../m:plus/@id"/>
1455 <xsl:apply-templates select="." mode = "semantics">
1456 <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
1457 <xsl:with-param name="PAREN" select="$PAREN"/>
1458 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1459 </xsl:apply-templates>
1466 <!-- HELM WARNING: power id is lost! -->
1467 <!-- msup should maintain the power definitionURL info but also the
1468 reference to apply -->
1469 <xsl:template match = "m:apply[m:power[1]]">
1471 <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] |
1472 m:gcd[1] | m:lcm[1] | m:sin[1] | m:cos[1] | m:tan[1] |
1473 m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] |
1474 m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] |
1475 m:coth[1] | m:arcsin[1] | m:arccos[1] |
1476 m:arctan[1] | m:arcsec[1] | m:arccsc[1] |
1477 m:arccot[1] | m:arcsinh[1] | m:arccosh[1] |
1478 m:arctanh[1] | m:arcsech[1] | m:arccsch [1]|
1480 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1484 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1485 <xsl:attribute name="xref">
1486 <xsl:value-of select="@id"/>
1489 <xsl:apply-templates select = "*[2]" mode = "semantics">
1490 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1491 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1492 </xsl:apply-templates>
1493 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
1499 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
1500 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1501 <xsl:param name="PARAM" select="$NO_PARAM"/>
1502 <xsl:param name="PAREN" select="$PAR_NO"/>
1503 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1505 <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and
1507 <m:mfenced separators="">
1508 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1509 <xsl:attribute name="xref">
1510 <xsl:value-of select="@id"/>
1513 <xsl:apply-templates select="." mode="remdiv">
1514 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1515 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1516 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1517 </xsl:apply-templates>
1520 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1521 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1522 and not($SEM_SW=$SEM_XREF_EXT)">
1523 <xsl:apply-templates select="." mode="remdiv">
1524 <xsl:with-param name="PARAM" select="$PARAM"/>
1525 <xsl:with-param name="PAREN" select="$PAREN"/>
1526 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1527 </xsl:apply-templates>
1531 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1532 <xsl:attribute name="xref">
1533 <xsl:value-of select="@id"/>
1536 <xsl:apply-templates select="." mode="remdiv">
1537 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1538 <xsl:with-param name="PAREN" select="$PAREN"/>
1539 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1540 </xsl:apply-templates>
1546 <xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
1547 <xsl:param name="PARAM" select="$NO_PARAM"/>
1548 <xsl:param name="PAREN" select="$PAR_NO"/>
1549 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1550 <xsl:apply-templates select = "*[2]" mode = "semantics">
1551 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
1552 <xsl:with-param name="PARAM" select="$PARAM"/>
1553 <xsl:with-param name="PAREN" select="$PAREN"/>
1554 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1555 </xsl:apply-templates>
1557 <xsl:if test="m:rem">
1558 <!-- HELM: xref added -->
1559 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rem/@id">
1560 <xsl:attribute name="xref">
1561 <xsl:value-of select="m:rem/@id"/>
1564 <xsl:value-of select="'%'"/>
1566 <xsl:if test="m:divide">
1567 <!-- HELM: xref added -->
1568 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divide/@id">
1569 <xsl:attribute name="xref">
1570 <xsl:value-of select="m:divide/@id"/>
1573 <xsl:value-of select="'/'"/>
1576 <xsl:apply-templates select = "*[3]" mode = "semantics">
1577 <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
1578 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
1579 <xsl:with-param name="PAREN" select="$PAREN"/>
1580 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1581 </xsl:apply-templates>
1584 <xsl:template match = "m:apply[m:times[1]]">
1585 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1586 <xsl:param name="PARAM" select="$NO_PARAM"/>
1587 <xsl:param name="PAREN" select="$PAR_NO"/>
1588 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1590 <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and
1592 <m:mfenced separators="">
1593 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1594 <xsl:attribute name="xref">
1595 <xsl:value-of select="@id"/>
1598 <xsl:apply-templates select="." mode="times">
1599 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1600 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1601 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1602 </xsl:apply-templates>
1605 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1606 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1607 and not($SEM_SW=$SEM_XREF_EXT)">
1608 <xsl:apply-templates select="." mode="times">
1609 <xsl:with-param name="PARAM" select="$PARAM"/>
1610 <xsl:with-param name="PAREN" select="$PAREN"/>
1611 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1612 </xsl:apply-templates>
1616 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1617 <xsl:attribute name="xref">
1618 <xsl:value-of select="@id"/>
1621 <xsl:apply-templates select="." mode="times">
1622 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1623 <xsl:with-param name="PAREN" select="$PAREN"/>
1624 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1625 </xsl:apply-templates>
1631 <xsl:template match = "m:apply[m:times[1]]" mode="times">
1632 <xsl:param name="PARAM" select="$NO_PARAM"/>
1633 <xsl:param name="PAREN" select="$PAR_NO"/>
1634 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1635 <xsl:apply-templates select="*[2]" mode = "semantics">
1636 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
1637 <xsl:with-param name="PARAM" select="$PARAM"/>
1638 <xsl:with-param name="PAREN" select="$PAREN"/>
1639 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1640 </xsl:apply-templates>
1641 <xsl:if test="*[3]">
1642 <xsl:for-each select = "*[position()>2]">
1643 <!-- HELM: to distinguish between * and the application -->
1645 <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
1648 <!-- HELM: xref added -->
1649 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:times/@id">
1650 <xsl:attribute name="xref">
1651 <xsl:value-of select="../m:times/@id"/>
1654 <xsl:apply-templates select="." mode = "semantics">
1655 <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
1656 <xsl:with-param name="PAREN" select="$PAREN"/>
1657 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1658 </xsl:apply-templates>
1663 <xsl:template match = "m:apply[m:root[1]]">
1665 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1666 <xsl:attribute name="xref">
1667 <xsl:value-of select="@id"/>
1670 <xsl:if test="*[2]=m:degree">
1671 <xsl:apply-templates select="*[3]" mode = "semantics">
1672 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1673 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1674 </xsl:apply-templates>
1675 <xsl:apply-templates select="*[2]" mode = "semantics"/>
1677 <xsl:if test="not(*[2]=m:degree)">
1678 <xsl:apply-templates select="*[2]" mode = "semantics">
1679 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1680 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1681 </xsl:apply-templates>
1687 <xsl:template match = "m:apply[m:gcd[1]]">
1689 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1690 <xsl:attribute name="xref">
1691 <xsl:value-of select="@id"/>
1694 <xsl:if test="not(parent::m:apply[m:power[1]])">
1696 <!-- HELM: xref added -->
1697 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
1698 <xsl:attribute name="xref">
1699 <xsl:value-of select="m:gcd/@id"/>
1703 <xsl:if test="parent::m:apply[m:power[1]]">
1706 <!-- HELM: xref added -->
1707 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
1708 <xsl:attribute name="xref">
1709 <xsl:value-of select="m:gcd/@id"/>
1712 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
1715 <m:mfenced separators=",">
1716 <xsl:for-each select = "*[position()>1]">
1717 <xsl:apply-templates select = "." mode="semantics"/>
1723 <xsl:template match = "m:apply[m:and[1]]">
1724 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1725 <xsl:param name="PAREN" select="$PAR_NO"/>
1726 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1728 <xsl:when test="$IN_PREC > $AND_PREC">
1729 <m:mfenced separators="">
1730 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1731 <xsl:attribute name="xref">
1732 <xsl:value-of select="@id"/>
1735 <xsl:apply-templates select="." mode="and">
1736 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1737 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1738 </xsl:apply-templates>
1741 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1742 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1743 and not($SEM_SW=$SEM_XREF_EXT)">
1744 <xsl:apply-templates select="." mode="and">
1745 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1746 <xsl:with-param name="PAREN" select="$PAREN"/>
1747 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1748 </xsl:apply-templates>
1752 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1753 <xsl:attribute name="xref">
1754 <xsl:value-of select="@id"/>
1757 <xsl:apply-templates select="." mode="and">
1758 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1759 <xsl:with-param name="PAREN" select="$PAREN"/>
1760 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1761 </xsl:apply-templates>
1767 <xsl:template match = "m:apply[m:and[1]]" mode="and">
1768 <xsl:param name="PARAM" select="$NO_PARAM"/>
1769 <xsl:param name="PAREN" select="$PAR_NO"/>
1770 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1771 <xsl:apply-templates select="*[2]" mode = "semantics">
1772 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1773 <xsl:with-param name="PARAM" select="$PARAM"/>
1774 <xsl:with-param name="PAREN" select="$PAREN"/>
1775 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1776 </xsl:apply-templates>
1777 <xsl:for-each select = "*[position()>2]">
1779 <!-- HELM: xref added -->
1780 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:and/@id">
1781 <xsl:attribute name="xref">
1782 <xsl:value-of select="../m:and/@id"/>
1784 </xsl:if><xsl:text disable-output-escaping='yes'>∧</xsl:text></m:mo>
1785 <xsl:apply-templates select="." mode = "semantics">
1786 <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
1787 <xsl:with-param name="PAREN" select="$PAREN"/>
1788 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1789 </xsl:apply-templates>
1793 <xsl:template match = "m:apply[m:or[1]]">
1794 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1795 <xsl:param name="PAREN" select="$PAR_NO"/>
1796 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1798 <xsl:when test="$IN_PREC > $OR_PREC">
1799 <m:mfenced separators="">
1800 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1801 <xsl:attribute name="xref">
1802 <xsl:value-of select="@id"/>
1805 <xsl:apply-templates select="." mode="or">
1806 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1807 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1808 </xsl:apply-templates>
1811 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1812 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
1813 and not($SEM_SW=$SEM_XREF_EXT)">
1814 <xsl:apply-templates select="." mode="or">
1815 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1816 <xsl:with-param name="PAREN" select="$PAREN"/>
1817 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1818 </xsl:apply-templates>
1822 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1823 <xsl:attribute name="xref">
1824 <xsl:value-of select="@id"/>
1827 <xsl:apply-templates select="." mode="or">
1828 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1829 <xsl:with-param name="PAREN" select="$PAREN"/>
1830 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1831 </xsl:apply-templates>
1837 <xsl:template match = "m:apply[m:or[1]]" mode="or">
1838 <xsl:param name="PARAM" select="$NO_PARAM"/>
1839 <xsl:param name="PAREN" select="$PAR_NO"/>
1840 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1841 <xsl:apply-templates select="*[2]" mode = "semantics">
1842 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1843 <xsl:with-param name="PARAM" select="$PARAM"/>
1844 <xsl:with-param name="PAREN" select="$PAREN"/>
1845 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1846 </xsl:apply-templates>
1847 <xsl:for-each select = "*[position()>2]">
1849 <!-- HELM: xref added -->
1850 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:or/@id">
1851 <xsl:attribute name="xref">
1852 <xsl:value-of select="../m:or/@id"/>
1854 </xsl:if><xsl:text disable-output-escaping='yes'>∨</xsl:text></m:mo>
1855 <xsl:apply-templates select="." mode = "semantics">
1856 <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
1857 <xsl:with-param name="PAREN" select="$PAREN"/>
1858 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1859 </xsl:apply-templates>
1863 <xsl:template match = "m:apply[m:xor[1]]">
1864 <xsl:param name="IN_PREC" select="$NO_PREC"/>
1865 <xsl:param name="PAREN" select="$PAR_NO"/>
1866 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1868 <xsl:when test="$IN_PREC > $XOR_PREC">
1869 <m:mfenced separators="">
1870 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1871 <xsl:attribute name="xref">
1872 <xsl:value-of select="@id"/>
1875 <xsl:apply-templates select="." mode="xor">
1876 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1877 <xsl:with-param name="PAREN" select="$PAR_YES"/>
1878 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1879 </xsl:apply-templates>
1882 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
1883 and not($SEM_SW=$SEM_ALL)">
1884 <xsl:apply-templates select="." mode="xor">
1885 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1886 <xsl:with-param name="PAREN" select="$PAREN"/>
1887 </xsl:apply-templates>
1891 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1892 <xsl:attribute name="xref">
1893 <xsl:value-of select="@id"/>
1896 <xsl:apply-templates select="." mode="xor">
1897 <xsl:with-param name="PARAM" select="$IN_PREC"/>
1898 <xsl:with-param name="PAREN" select="$PAREN"/>
1899 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1900 </xsl:apply-templates>
1906 <xsl:template match = "m:apply[m:xor[1]]" mode="xor">
1907 <xsl:param name="PARAM" select="$NO_PARAM"/>
1908 <xsl:param name="PAREN" select="$PAR_NO"/>
1909 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
1910 <xsl:apply-templates select="*[2]" mode = "semantics">
1911 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1912 <xsl:with-param name="PARAM" select="$PARAM"/>
1913 <xsl:with-param name="PAREN" select="$PAREN"/>
1914 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
1915 </xsl:apply-templates>
1916 <xsl:for-each select = "*[position()>2]">
1918 <!-- HELM: xref added -->
1919 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:xor/@id">
1920 <xsl:attribute name="xref">
1921 <xsl:value-of select="../m:xor/@id"/>
1923 </xsl:if><xsl:text disable-output-escaping='yes'>⊻</xsl:text></m:mo>
1924 <xsl:apply-templates select="." mode = "semantics">
1925 <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
1926 <xsl:with-param name="PAREN" select="$PAREN"/>
1927 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
1928 </xsl:apply-templates>
1932 <xsl:template match = "m:apply[m:not[1]]">
1934 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1935 <xsl:attribute name="xref">
1936 <xsl:value-of select="@id"/>
1939 <!-- HELM: was <m:mo>not</m:mo>
1942 <!-- HELM: xref added -->
1943 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:not/@id">
1944 <xsl:attribute name="xref">
1945 <xsl:value-of select="m:not/@id"/>
1947 </xsl:if>¬</m:mo>
1948 <xsl:apply-templates select = "*[2]" mode = "semantics">
1949 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
1950 </xsl:apply-templates>
1954 <xsl:template match = "m:apply[m:forall[1]]">
1956 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1957 <xsl:attribute name="xref">
1958 <xsl:value-of select="@id"/>
1962 <!-- HELM: xref added -->
1963 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:forall/@id">
1964 <xsl:attribute name="xref">
1965 <xsl:value-of select="m:forall/@id"/>
1967 </xsl:if>for all</m:mo>
1968 <xsl:if test="count(m:bvar) > 1">
1969 <m:mfenced separators=",">
1970 <xsl:for-each select = "m:bvar">
1971 <xsl:apply-templates select = "." mode="semantics"/>
1975 <xsl:if test="count(m:bvar)=1">
1976 <xsl:apply-templates select = "m:bvar" mode="semantics"/>
1978 <xsl:if test="m:condition">
1980 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
1983 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
1984 not(self::m:condition)]" mode = "semantics"/>
1988 <xsl:template match = "m:apply[m:exists[1]]">
1990 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
1991 <xsl:attribute name="xref">
1992 <xsl:value-of select="@id"/>
1996 <!-- HELM: xref added -->
1997 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exists/@id">
1998 <xsl:attribute name="xref">
1999 <xsl:value-of select="m:exists/@id"/>
2001 </xsl:if><xsl:text disable-output-escaping='yes'>∃</xsl:text> </m:mo>
2002 <xsl:if test="count(m:bvar) > 1">
2003 <m:mfenced separators=",">
2004 <xsl:for-each select = "m:bvar">
2005 <xsl:apply-templates select = "." mode="semantics"/>
2009 <xsl:if test="count(m:bvar)=1">
2010 <xsl:apply-templates select = "m:bvar" mode="semantics"/>
2012 <xsl:if test="m:condition">
2014 <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
2016 <xsl:if test="*[position()>1 and not(self::m:bvar) and not(self::m:condition)]">
2018 <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
2019 not(self::m:condition)]" mode = "semantics"/>
2024 <!-- HELM WARNING: abs id was lost! -->
2025 <xsl:template match = "m:apply[m:abs[1]]">
2026 <xsl:if test="not(parent::m:apply[m:power[1]])">
2028 <m:mfenced open="|" close="|" separators="">
2029 Now is: mrow + mo -->
2031 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2032 <xsl:attribute name="xref">
2033 <xsl:value-of select="@id"/>
2037 <!-- HELM: xref added -->
2038 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2039 <xsl:attribute name="xref">
2040 <xsl:value-of select="m:abs/@id"/>
2043 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2045 <!-- HELM: xref added -->
2046 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2047 <xsl:attribute name="xref">
2048 <xsl:value-of select="m:abs/@id"/>
2051 <!-- HELM: </m:mfenced> -->
2054 <xsl:if test="parent::m:apply[m:power[1]]">
2057 <m:mfenced open="|" close="|" separators="">
2058 Now is: mrow + mo -->
2060 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2061 <xsl:attribute name="xref">
2062 <xsl:value-of select="@id"/>
2066 <!-- HELM: xref added -->
2067 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2068 <xsl:attribute name="xref">
2069 <xsl:value-of select="m:abs/@id"/>
2072 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2074 <!-- HELM: xref added -->
2075 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
2076 <xsl:attribute name="xref">
2077 <xsl:value-of select="m:abs/@id"/>
2080 <!-- HELM: </m:mfenced> -->
2082 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2087 <xsl:template match = "m:apply[m:conjugate[1]]">
2089 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2090 <xsl:attribute name="xref">
2091 <xsl:value-of select="@id"/>
2095 <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
2098 <!-- HELM: xref added -->
2099 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:conjugate/@id">
2100 <xsl:attribute name="xref">
2101 <xsl:value-of select="m:conjugate/@id"/>
2103 </xsl:if><xsl:text disable-output-escaping='yes'>̲</xsl:text> </m:mo>
2107 <xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
2109 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2110 <xsl:attribute name="xref">
2111 <xsl:value-of select="@id"/>
2115 <xsl:if test="m:arg">
2116 <!-- HELM: xref added -->
2117 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:arg/@id">
2118 <xsl:attribute name="xref">
2119 <xsl:value-of select="m:arg/@id"/>
2122 <xsl:value-of select="'Arg'"/>
2124 <xsl:if test="m:real">
2125 <!-- HELM: xref added -->
2126 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:real/@id">
2127 <xsl:attribute name="xref">
2128 <xsl:value-of select="m:real/@id"/>
2131 <xsl:value-of select="'Re'"/>
2133 <xsl:if test="m:imaginary">
2134 <!-- HELM: xref added -->
2135 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginary/@id">
2136 <xsl:attribute name="xref">
2137 <xsl:value-of select="m:imaginary/@id"/>
2140 <xsl:value-of select="'Im'"/>
2143 <m:mfenced separators="">
2144 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2149 <!-- HELM: was (it didn't match with prefixed MathML)
2150 <xsl:template match="m:apply[child::*[position()=1 and name()='lcm']]">
2152 <xsl:template match="m:apply[child::*[position()=1 and self::m:lcm]]">
2154 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2155 <xsl:attribute name="xref">
2156 <xsl:value-of select="@id"/>
2159 <xsl:if test="not(parent::m:apply[m:power[1]])">
2161 <!-- HELM: xref added -->
2162 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
2163 <xsl:attribute name="xref">
2164 <xsl:value-of select="m:lcm/@id"/>
2168 <xsl:if test="parent::m:apply[m:power[1]]">
2171 <!-- HELM: xref added -->
2172 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
2173 <xsl:attribute name="xref">
2174 <xsl:value-of select="m:lcm/@id"/>
2177 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2180 <m:mfenced separators=",">
2181 <xsl:for-each select = "*[position()>1]">
2182 <xsl:apply-templates select = "." mode="semantics"/>
2188 <!-- HELM: was (it didn't match with prefixed MathML)
2189 <xsl:template match="m:apply[child::*[position()=1 and name()='floor']]">
2191 <xsl:template match="m:apply[child::*[position()=1 and self::m:floor]]">
2193 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2194 <xsl:attribute name="xref">
2195 <xsl:value-of select="@id"/>
2199 <!-- HELM: xref added -->
2200 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
2201 <xsl:attribute name="xref">
2202 <xsl:value-of select="m:floor/@id"/>
2205 <!-- HELM: not rendered correctly <![CDATA[⌊]]> -->
2206 <xsl:text disable-output-escaping="yes">⌊</xsl:text>
2208 <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
2210 <!-- HELM: xref added -->
2211 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
2212 <xsl:attribute name="xref">
2213 <xsl:value-of select="m:floor/@id"/>
2216 <!-- HELM: not rendered correctly <![CDATA[⌋]]> -->
2217 <xsl:text disable-output-escaping="yes">⌋</xsl:text>
2222 <!-- HELM: was (it didn't match with prefixed MathML)
2223 <xsl:template match="m:apply[child::*[position()=1 and name()='ceiling']]">
2225 <xsl:template match="m:apply[child::*[position()=1 and self::m:ceiling]]">
2227 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2228 <xsl:attribute name="xref">
2229 <xsl:value-of select="@id"/>
2233 <!-- HELM: xref added -->
2234 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
2235 <xsl:attribute name="xref">
2236 <xsl:value-of select="m:ceiling/@id"/>
2239 <!-- HELM: not rendered correctly <![CDATA[⌈]]> -->
2240 <xsl:text disable-output-escaping="yes">⌈</xsl:text>
2242 <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
2244 <!-- HELM: xref added -->
2245 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
2246 <xsl:attribute name="xref">
2247 <xsl:value-of select="m:ceiling/@id"/>
2250 <!-- HELM: not rendered correctly <![CDATA[⌉]]> -->
2251 <xsl:text disable-output-escaping="yes">⌉</xsl:text>
2257 <!-- ***************** RELATIONS ***************** -->
2259 <xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies
2260 | m:in | m:notin | m:notsubset | m:notprsubset
2261 | m:subset | m:prsubset | m:eq | m:gt | m:lt
2262 | m:geq | m:leq | m:equivalent | m:factorof]">
2264 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2265 <xsl:attribute name="xref">
2266 <xsl:value-of select="@id"/>
2269 <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:factorof or *[1]=m:tendsto or
2270 *[1]=m:implies or *[1]=m:in or *[1]=m:notin or
2271 *[1]=m:notsubset or *[1]=m:notprsubset">
2272 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2274 <xsl:if test="*[1]=m:neq">
2275 <!-- HELM: xref added -->
2276 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:neq/@id">
2277 <xsl:attribute name="xref">
2278 <xsl:value-of select="m:neq/@id"/>
2281 <xsl:text disable-output-escaping='yes'>≠</xsl:text>
2283 <xsl:if test="*[1]=m:approx">
2284 <!-- HELM: xref added -->
2285 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:approx/@id">
2286 <xsl:attribute name="xref">
2287 <xsl:value-of select="m:approx/@id"/>
2290 <xsl:text disable-output-escaping='yes'>≊</xsl:text>
2292 <xsl:if test="*[1]=m:factorof">
2293 <!-- HELM: xref added -->
2294 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorof/@id">
2295 <xsl:attribute name="xref">
2296 <xsl:value-of select="m:factorof/@id"/>
2301 <xsl:if test="*[1]=m:tendsto">
2302 <!-- HELM: xref added -->
2303 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2304 <xsl:attribute name="xref">
2305 <xsl:value-of select="m:tendsto/@id"/>
2308 <xsl:text disable-output-escaping='yes'>→</xsl:text>
2310 <xsl:if test="*[1]=m:implies">
2311 <!-- HELM: xref added -->
2312 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:implies/@id">
2313 <xsl:attribute name="xref">
2314 <xsl:value-of select="m:implies/@id"/>
2317 <xsl:text disable-output-escaping='yes'>⇒</xsl:text>
2319 <xsl:if test="*[1]=m:in">
2320 <!-- HELM: xref added -->
2321 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:in/@id">
2322 <xsl:attribute name="xref">
2323 <xsl:value-of select="m:in/@id"/>
2326 <xsl:text disable-output-escaping='yes'>∈</xsl:text>
2328 <xsl:if test="*[1]=m:notin">
2329 <!-- HELM: xref added -->
2330 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notin/@id">
2331 <xsl:attribute name="xref">
2332 <xsl:value-of select="m:notin/@id"/>
2335 <xsl:text disable-output-escaping='yes'>∉</xsl:text>
2337 <xsl:if test="*[1]=m:notsubset">
2338 <!-- HELM: xref added -->
2339 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notsubset/@id">
2340 <xsl:attribute name="xref">
2341 <xsl:value-of select="m:notsubset/@id"/>
2344 <xsl:text disable-output-escaping='yes'>⊄</xsl:text>
2346 <xsl:if test="*[1]=m:notprsubset">
2347 <!-- HELM: xref added -->
2348 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notprsubset/@id">
2349 <xsl:attribute name="xref">
2350 <xsl:value-of select="m:notprsubset/@id"/>
2353 <xsl:text disable-output-escaping='yes'>⊈</xsl:text>
2356 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
2357 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
2359 <!-- HELM: xref added -->
2360 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2361 <xsl:attribute name="xref">
2362 <xsl:value-of select="m:tendsto/@id"/>
2366 <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
2368 <!-- HELM: xref added -->
2369 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
2370 <xsl:attribute name="xref">
2371 <xsl:value-of select="m:tendsto/@id"/>
2376 <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt
2377 or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
2378 <xsl:apply-templates select = "*[2]" mode="semantics"/>
2379 <xsl:for-each select = "*[position()>2]">
2381 <xsl:if test="../*[self::m:subset][1]">
2382 <!-- HELM: xref added -->
2383 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:subset/@id">
2384 <xsl:attribute name="xref">
2385 <xsl:value-of select="../m:subset/@id"/>
2388 <xsl:text disable-output-escaping='yes'>⊆</xsl:text>
2390 <xsl:if test="../*[self::m:prsubset][1]">
2391 <!-- HELM: xref added -->
2392 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:prsubset/@id">
2393 <xsl:attribute name="xref">
2394 <xsl:value-of select="../m:prsubset/@id"/>
2397 <xsl:text disable-output-escaping='yes'>⊂</xsl:text>
2399 <xsl:if test="../*[self::m:eq][1]">
2400 <!-- HELM: xref added -->
2401 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:eq/@id">
2402 <xsl:attribute name="xref">
2403 <xsl:value-of select="../m:eq/@id"/>
2406 <xsl:value-of select="'='"/>
2408 <xsl:if test="../*[self::m:gt][1]">
2409 <!-- HELM: xref added -->
2410 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:gt/@id">
2411 <xsl:attribute name="xref">
2412 <xsl:value-of select="../m:gt/@id"/>
2415 <xsl:value-of select="'>'"/>
2417 <xsl:if test="../*[self::m:lt][1]">
2418 <!-- HELM: xref added -->
2419 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:lt/@id">
2420 <xsl:attribute name="xref">
2421 <xsl:value-of select="../m:lt/@id"/>
2424 <xsl:value-of select="'<'"/>
2426 <xsl:if test="../*[self::m:geq][1]">
2427 <!-- HELM: xref added -->
2428 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:geq/@id">
2429 <xsl:attribute name="xref">
2430 <xsl:value-of select="../m:geq/@id"/>
2433 <xsl:text disable-output-escaping='yes'>≥</xsl:text>
2435 <xsl:if test="../*[self::m:leq][1]">
2436 <!-- HELM: xref added -->
2437 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:leq/@id">
2438 <xsl:attribute name="xref">
2439 <xsl:value-of select="../m:leq/@id"/>
2442 <xsl:text disable-output-escaping='yes'>≤</xsl:text>
2444 <xsl:if test="../*[self::m:equivalent][1]">
2445 <!-- HELM: xref added -->
2446 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:equivalent/@id">
2447 <xsl:attribute name="xref">
2448 <xsl:value-of select="../m:equivalent/@id"/>
2451 <xsl:text disable-output-escaping='yes'>≡</xsl:text>
2454 <xsl:apply-templates select = "." mode="semantics"/>
2461 <!-- ***************** CALCULUS ***************** -->
2463 <xsl:template match = "m:apply[*[1][self::m:ln]]">
2465 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2466 <xsl:attribute name="xref">
2467 <xsl:value-of select="@id"/>
2471 <xsl:when test="parent::m:apply[m:power[1]]">
2474 <!-- HELM: xref added -->
2475 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
2476 <xsl:attribute name="xref">
2477 <xsl:value-of select="m:ln/@id"/>
2480 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2485 <!-- HELM: xref added -->
2486 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
2487 <xsl:attribute name="xref">
2488 <xsl:value-of select="m:ln/@id"/>
2493 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
2494 <xsl:apply-templates select = "*[2]" mode = "semantics">
2495 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2496 </xsl:apply-templates>
2500 <xsl:template match = "m:apply[m:log[1]]">
2502 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2503 <xsl:attribute name="xref">
2504 <xsl:value-of select="@id"/>
2508 <xsl:when test="parent::m:apply[m:power[1]]">
2509 <xsl:if test="not(*[2]=m:logbase)">
2512 <!-- HELM: xref added -->
2513 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2514 <xsl:attribute name="xref">
2515 <xsl:value-of select="m:log/@id"/>
2518 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2521 <xsl:if test="*[2]=m:logbase">
2524 <!-- HELM: xref added -->
2525 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2526 <xsl:attribute name="xref">
2527 <xsl:value-of select="m:log/@id"/>
2530 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
2531 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
2536 <xsl:if test="not(*[2]=m:logbase)">
2538 <!-- HELM: xref added -->
2539 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2540 <xsl:attribute name="xref">
2541 <xsl:value-of select="m:log/@id"/>
2545 <xsl:if test="*[2]=m:logbase">
2548 <!-- HELM: xref added -->
2549 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
2550 <xsl:attribute name="xref">
2551 <xsl:value-of select="m:log/@id"/>
2554 <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
2559 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
2560 <xsl:if test="*[2]=m:logbase">
2561 <xsl:apply-templates select = "*[3]" mode = "semantics">
2562 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2563 </xsl:apply-templates>
2565 <xsl:if test="not(*[2]=m:logbase)">
2566 <xsl:apply-templates select = "*[2]" mode = "semantics">
2567 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
2568 </xsl:apply-templates>
2573 <xsl:template match = "m:apply[m:diff[1]]">
2575 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2576 <xsl:attribute name="xref">
2577 <xsl:value-of select="@id"/>
2580 <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
2582 <!-- HELM: xref added -->
2583 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
2584 <xsl:attribute name="xref">
2585 <xsl:value-of select="m:diff/@id"/>
2590 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
2595 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
2596 <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
2601 <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
2603 <!-- HELM: xref added -->
2604 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
2605 <xsl:attribute name="xref">
2606 <xsl:value-of select="m:diff/@id"/>
2612 <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
2616 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
2620 <xsl:template match = "m:apply[m:partialdiff[1]]">
2622 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2623 <xsl:attribute name="xref">
2624 <xsl:value-of select="@id"/>
2627 <xsl:for-each select = "m:bvar">
2628 <xsl:if test="*[last()]=m:degree">
2630 <!-- HELM: xref added -->
2631 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
2632 <xsl:attribute name="xref">
2633 <xsl:value-of select="../m:partialdiff/@id"/>
2638 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
2643 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
2644 <xsl:apply-templates select = "m:degree" mode = "semantics"/>
2649 <xsl:if test="not(*[last()]=m:degree)">
2651 <!-- HELM: xref added -->
2652 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
2653 <xsl:attribute name="xref">
2654 <xsl:value-of select="../m:partialdiff/@id"/>
2660 <xsl:apply-templates select = "*[1]" mode = "semantics"/>
2665 <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
2669 <xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
2670 <xsl:apply-templates select="*" mode = "semantics"/>
2673 <xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
2675 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2676 <xsl:attribute name="xref">
2677 <xsl:value-of select="@id"/>
2681 <xsl:if test="*[1]=m:divergence">
2682 <!-- HELM: xref added -->
2683 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divergence/@id">
2684 <xsl:attribute name="xref">
2685 <xsl:value-of select="m:divergence/@id"/>
2688 <xsl:value-of select="'div'"/>
2690 <xsl:if test="*[1]=m:grad">
2691 <!-- HELM: xref added -->
2692 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:grad/@id">
2693 <xsl:attribute name="xref">
2694 <xsl:value-of select="m:grad/@id"/>
2697 <xsl:value-of select="'grad'"/>
2699 <xsl:if test="*[1]=m:curl">
2700 <!-- HELM: xref added -->
2701 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:curl/@id">
2702 <xsl:attribute name="xref">
2703 <xsl:value-of select="m:curl/@id"/>
2706 <xsl:value-of select="'curl'"/>
2710 <xsl:when test="*[2]=m:ci">
2711 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2714 <m:mfenced separators="">
2715 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2722 <xsl:template match = "m:apply[m:laplacian[1]]">
2724 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2725 <xsl:attribute name="xref">
2726 <xsl:value-of select="@id"/>
2731 <!-- HELM: xref added -->
2732 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:laplacian/@id">
2733 <xsl:attribute name="xref">
2734 <xsl:value-of select="m:laplacian/@id"/>
2737 <xsl:text disable-output-escaping='yes'>Δ</xsl:text></m:mo>
2740 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
2745 <!-- ***************** SET THEORY ***************** -->
2747 <xsl:template match = "m:set | m:list">
2748 <m:mfenced open="{{" close="}}" separators="">
2749 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2750 <xsl:attribute name="xref">
2751 <xsl:value-of select="@id"/>
2754 <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
2755 <xsl:apply-templates select="m:bvar" mode = "semantics"/>
2757 <xsl:apply-templates select="m:condition" mode = "semantics"/>
2759 <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
2760 <m:mfenced open="" close="" separators=",">
2761 <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
2762 <xsl:apply-templates select = "." mode="semantics"/>
2766 <xsl:apply-templates select="m:condition" mode = "semantics"/>
2768 <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
2769 <m:mfenced open="" close="" separators=",">
2770 <xsl:for-each select = "*">
2771 <xsl:apply-templates select = "." mode="semantics"/>
2778 <xsl:template match = "m:apply[m:union[1]]">
2779 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2780 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2781 <xsl:param name="PARAM" select="$NO_PARAM"/>
2782 <xsl:param name="PAREN" select="$PAR_NO"/>
2783 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2785 <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
2786 and $PARAM=$PAR_SAME and not($IN_OP=$UNION_OP)">
2787 <m:mfenced separators="">
2788 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2789 <xsl:attribute name="xref">
2790 <xsl:value-of select="@id"/>
2793 <xsl:apply-templates select="." mode="union">
2794 <xsl:with-param name="PARAM" select="$PARAM"/>
2795 <xsl:with-param name="PAREN" select="$PAREN"/>
2796 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2797 </xsl:apply-templates>
2800 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2801 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2802 and not($SEM_SW=$SEM_XREF_EXT)">
2803 <xsl:apply-templates select="." mode="union">
2804 <xsl:with-param name="PARAM" select="$PARAM"/>
2805 <xsl:with-param name="PAREN" select="$PAREN"/>
2806 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2807 </xsl:apply-templates>
2811 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2812 <xsl:attribute name="xref">
2813 <xsl:value-of select="@id"/>
2816 <xsl:apply-templates select="." mode="union">
2817 <xsl:with-param name="IN_OP" select="$UNION_OP"/>
2818 <xsl:with-param name="PARAM" select="$PARAM"/>
2819 <xsl:with-param name="PAREN" select="$PAREN"/>
2820 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2821 </xsl:apply-templates>
2827 <xsl:template match = "m:apply[m:union[1]]" mode="union">
2828 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2829 <xsl:param name="PARAM" select="$NO_PARAM"/>
2830 <xsl:param name="PAREN" select="$PAR_NO"/>
2831 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2832 <xsl:apply-templates select = "*[2]" mode="semantics">
2833 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
2834 <xsl:with-param name="PARAM" select="$PARAM"/>
2835 <xsl:with-param name="PAREN" select="$PAREN"/>
2836 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2837 </xsl:apply-templates>
2838 <xsl:for-each select = "*[position()>2]">
2840 <!-- HELM: xref added -->
2841 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:union/@id">
2842 <xsl:attribute name="xref">
2843 <xsl:value-of select="../m:union/@id"/>
2845 </xsl:if>⋃</m:mo>
2846 <!-- HELM: not rendered correctly <![CDATA[⋃]]> -->
2847 <!-- <xsl:text disable-output-escaping="yes">⋃</xsl:text></m:mo>-->
2848 <xsl:apply-templates select = "." mode="semantics">
2849 <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
2850 <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
2851 <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
2852 <xsl:with-param name="PAREN" select="$PAREN"/>
2853 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
2854 </xsl:apply-templates>
2858 <xsl:template match = "m:apply[m:intersect[1]]">
2859 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2860 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2861 <xsl:param name="PARAM" select="$NO_PARAM"/>
2862 <xsl:param name="PAREN" select="$PAR_NO"/>
2863 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2865 <xsl:when test="$IN_PREC > $INTERSECT_PREC or $IN_PREC=$INTERSECT_PREC
2866 and $PARAM=$PAR_SAME and not($IN_OP=$INTERSECT_OP)">
2867 <m:mfenced separators="">
2868 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2869 <xsl:attribute name="xref">
2870 <xsl:value-of select="@id"/>
2873 <xsl:apply-templates select="." mode="intersect">
2874 <xsl:with-param name="PARAM" select="$PARAM"/>
2875 <xsl:with-param name="PAREN" select="$PAREN"/>
2876 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2877 </xsl:apply-templates>
2880 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2881 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2882 and not($SEM_SW=$SEM_XREF_EXT)">
2883 <xsl:apply-templates select="." mode="intersect">
2884 <xsl:with-param name="PARAM" select="$PARAM"/>
2885 <xsl:with-param name="PAREN" select="$PAREN"/>
2886 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2887 </xsl:apply-templates>
2891 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2892 <xsl:attribute name="xref">
2893 <xsl:value-of select="@id"/>
2896 <xsl:apply-templates select="." mode="intersect">
2897 <xsl:with-param name="IN_OP" select="$INTERSECT_OP"/>
2898 <xsl:with-param name="PARAM" select="$PARAM"/>
2899 <xsl:with-param name="PAREN" select="$PAREN"/>
2900 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2901 </xsl:apply-templates>
2907 <xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
2908 <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
2909 <xsl:param name="PARAM" select="$NO_PARAM"/>
2910 <xsl:param name="PAREN" select="$PAR_NO"/>
2911 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2912 <xsl:apply-templates select = "*[2]" mode="semantics">
2913 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
2914 <xsl:with-param name="PARAM" select="$PARAM"/>
2915 <xsl:with-param name="PAREN" select="$PAREN"/>
2916 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2917 </xsl:apply-templates>
2918 <xsl:for-each select = "*[position()>2]">
2920 <!-- HELM: xref added -->
2921 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:intersect/@id">
2922 <xsl:attribute name="xref">
2923 <xsl:value-of select="../m:intersect/@id"/>
2926 <!-- HELM: not rendered correctly <![CDATA[⋂]]> -->
2927 <xsl:text disable-output-escaping="yes">⋂</xsl:text></m:mo>
2928 <xsl:apply-templates select = "." mode="semantics">
2929 <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
2930 <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
2931 <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
2932 <xsl:with-param name="PAREN" select="$PAREN"/>
2933 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
2934 </xsl:apply-templates>
2938 <xsl:template match = "m:apply[m:setdiff[1]]">
2939 <xsl:param name="IN_PREC" select="$NO_PREC"/>
2940 <xsl:param name="PARAM" select="$NO_PARAM"/>
2941 <xsl:param name="PAREN" select="$PAR_NO"/>
2942 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2944 <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
2945 and $PARAM=$PAR_SAME">
2946 <m:mfenced separators="">
2947 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2948 <xsl:attribute name="xref">
2949 <xsl:value-of select="@id"/>
2952 <xsl:apply-templates select="." mode="setdiff">
2953 <xsl:with-param name="PARAM" select="$PARAM"/>
2954 <xsl:with-param name="PAREN" select="$PAREN"/>
2955 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2956 </xsl:apply-templates>
2959 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
2960 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
2961 and not($SEM_SW=$SEM_XREF_EXT)">
2962 <xsl:apply-templates select="." mode="setdiff">
2963 <xsl:with-param name="PARAM" select="$PARAM"/>
2964 <xsl:with-param name="PAREN" select="$PAREN"/>
2965 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2966 </xsl:apply-templates>
2970 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2971 <xsl:attribute name="xref">
2972 <xsl:value-of select="@id"/>
2975 <xsl:apply-templates select="." mode="setdiff">
2976 <xsl:with-param name="PARAM" select="$PARAM"/>
2977 <xsl:with-param name="PAREN" select="$PAREN"/>
2978 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2979 </xsl:apply-templates>
2985 <xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
2986 <xsl:param name="PARAM" select="$NO_PARAM"/>
2987 <xsl:param name="PAREN" select="$PAR_NO"/>
2988 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
2989 <xsl:apply-templates select = "*[2]" mode = "semantics">
2990 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
2991 <xsl:with-param name="PARAM" select="$PARAM"/>
2992 <xsl:with-param name="PAREN" select="$PAREN"/>
2993 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
2994 </xsl:apply-templates>
2996 <!-- HELM: xref added -->
2997 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
2998 <xsl:attribute name="xref">
2999 <xsl:value-of select="m:setdiff/@id"/>
3002 <xsl:apply-templates select = "*[3]" mode = "semantics">
3003 <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
3004 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
3005 <xsl:with-param name="PAREN" select="$PAREN"/>
3006 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3007 </xsl:apply-templates>
3010 <xsl:template match = "m:apply[m:cartesianproduct[1]]">
3011 <xsl:param name="IN_PREC" select="$NO_PREC"/>
3012 <xsl:param name="PARAM" select="$NO_PARAM"/>
3013 <xsl:param name="PAREN" select="$PAR_NO"/>
3014 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
3016 <xsl:when test="$IN_PREC > $CARTPROD_PREC or $IN_PREC=$CARTPROD_PREC
3017 and $PARAM=$PAR_SAME">
3018 <m:mfenced separators="">
3019 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3020 <xsl:attribute name="xref">
3021 <xsl:value-of select="@id"/>
3024 <xsl:apply-templates select="." mode="cartprod">
3025 <xsl:with-param name="PARAM" select="$PARAM"/>
3026 <xsl:with-param name="PAREN" select="$PAREN"/>
3027 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3028 </xsl:apply-templates>
3031 <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
3032 and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
3033 and not($SEM_SW=$SEM_XREF_EXT)">
3034 <xsl:apply-templates select="." mode="cartprod">
3035 <xsl:with-param name="PARAM" select="$PARAM"/>
3036 <xsl:with-param name="PAREN" select="$PAREN"/>
3037 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3038 </xsl:apply-templates>
3042 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3043 <xsl:attribute name="xref">
3044 <xsl:value-of select="@id"/>
3047 <xsl:apply-templates select="." mode="cartprod">
3048 <xsl:with-param name="PARAM" select="$PARAM"/>
3049 <xsl:with-param name="PAREN" select="$PAREN"/>
3050 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3051 </xsl:apply-templates>
3057 <xsl:template match = "m:apply[m:cartesianproduct[1]]" mode="cartprod">
3058 <xsl:param name="PARAM" select="$NO_PARAM"/>
3059 <xsl:param name="PAREN" select="$PAR_NO"/>
3060 <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
3061 <xsl:apply-templates select = "*[2]" mode = "semantics">
3062 <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
3063 <xsl:with-param name="PARAM" select="$PARAM"/>
3064 <xsl:with-param name="PAREN" select="$PAREN"/>
3065 <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
3066 </xsl:apply-templates>
3067 <xsl:for-each select = "*[position()>2]">
3069 <!-- HELM: xref added -->
3070 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:cartesianproduct/@id">
3071 <xsl:attribute name="xref">
3072 <xsl:value-of select="../m:cartesianproduct/@id"/>
3075 <!-- HELM: not rendered correctly <![CDATA[×]]> -->
3076 <xsl:text disable-output-escaping="yes">×</xsl:text></m:mo>
3077 <xsl:apply-templates select = "." mode="semantics">
3078 <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
3079 <xsl:with-param name="PARAM" select="$PAR_SAME"/>
3080 <xsl:with-param name="PAREN" select="$PAREN"/>
3081 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3082 </xsl:apply-templates>
3086 <!-- HELM WARNING: card id was lost! -->
3087 <xsl:template match = "m:apply[m:card[1]]">
3089 <m:mfenced open="|" close="|" separators=",">
3090 Now is: mrow + mo -->
3092 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3093 <xsl:attribute name="xref">
3094 <xsl:value-of select="@id"/>
3098 <!-- HELM: xref added -->
3099 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:card/@id">
3100 <xsl:attribute name="xref">
3101 <xsl:value-of select="m:card/@id"/>
3104 <xsl:for-each select = "*[position()>1]">
3105 <xsl:apply-templates select = "." mode="semantics"/>
3108 <!-- HELM: xref added -->
3109 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
3110 <xsl:attribute name="xref">
3111 <xsl:value-of select="m:setdiff/@id"/>
3115 <!-- HELM: </m:mfenced> -->
3119 <!-- ***************** SEQUENCES AND SERIES ***************** -->
3121 <xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
3123 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3124 <xsl:attribute name="xref">
3125 <xsl:value-of select="@id"/>
3129 <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
3132 <xsl:if test="*[1]=m:sum">
3133 <!-- HELM: xref added -->
3134 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
3135 <xsl:attribute name="xref">
3136 <xsl:value-of select="m:sum/@id"/>
3139 <xsl:text disable-output-escaping='yes'>∑</xsl:text>
3141 <xsl:if test="*[1]=m:product">
3142 <!-- HELM: xref added -->
3143 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
3144 <xsl:attribute name="xref">
3145 <xsl:value-of select="m:product/@id"/>
3148 <xsl:text disable-output-escaping='yes'>∏</xsl:text>
3152 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3154 <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
3156 <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
3158 <xsl:apply-templates select = "*[5]" mode = "semantics"/>
3160 <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
3163 <xsl:if test="*[1]=m:sum">
3164 <xsl:text disable-output-escaping='yes'>∑</xsl:text>
3166 <xsl:if test="*[1]=m:product">
3167 <xsl:text disable-output-escaping='yes'>∏</xsl:text>
3170 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3172 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
3174 <xsl:when test="*[2]=m:domainofapplication">
3177 <xsl:if test="*[1]=m:sum">
3178 <!-- HELM: xref added -->
3179 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
3180 <xsl:attribute name="xref">
3181 <xsl:value-of select="m:sum/@id"/>
3184 <!-- HELM: not rendered correctly <![CDATA[∑]]> -->
3185 <xsl:text disable-output-escaping="yes">∑</xsl:text>
3187 <xsl:if test="*[1]=m:product">
3188 <!-- HELM: xref added -->
3189 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
3190 <xsl:attribute name="xref">
3191 <xsl:value-of select="m:product/@id"/>
3194 <!-- HELM: not rendered correctly <![CDATA[∏]]> -->
3195 <xsl:text disable-output-escaping="yes">∏</xsl:text>
3198 <xsl:apply-templates select="m:domainofapplication" mode = "semantics"/>
3201 <xsl:apply-templates select="*[position()=last()]" mode = "semantics"/>
3208 <!-- HELM: was (it didn't match with prefixed MathML)
3209 <xsl:template match="m:apply[child::*[position()=1 and name()='int']]">
3211 <xsl:template match="m:apply[child::*[position()=1 and self::m:int]]">
3213 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3214 <xsl:attribute name="xref">
3215 <xsl:value-of select="@id"/>
3219 <xsl:when test="m:condition">
3222 <!-- HELM: xref added -->
3223 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3224 <xsl:attribute name="xref">
3225 <xsl:value-of select="m:int/@id"/>
3228 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3229 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3230 <xsl:apply-templates select="m:condition" mode="semantics"/>
3233 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3237 <xsl:apply-templates select="m:bvar" mode="semantics"/>
3240 <xsl:when test="m:domainofapplication">
3243 <!-- HELM: xref added -->
3244 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3245 <xsl:attribute name="xref">
3246 <xsl:value-of select="m:int/@id"/>
3249 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3250 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3251 <xsl:apply-templates select="m:domainofapplication" mode="semantics"/>
3254 <xsl:apply-templates select="*[position()=last()]" mode="semantics" />
3259 <xsl:when test="m:interval">
3262 <!-- HELM: xref added -->
3263 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3264 <xsl:attribute name="xref">
3265 <xsl:value-of select="m:int/@id"/>
3268 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3269 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3270 <xsl:apply-templates select="m:interval/*[position()=1]" mode="semantics" />
3271 <xsl:apply-templates select="m:interval/*[position()=2]" mode="semantics"/>
3273 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3275 <xsl:apply-templates select="m:bvar" mode="semantics"/>
3277 <xsl:when test="m:lowlimit">
3280 <!-- HELM: xref added -->
3281 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3282 <xsl:attribute name="xref">
3283 <xsl:value-of select="m:int/@id"/>
3286 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3287 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3288 <m:mrow><xsl:apply-templates select="m:lowlimit" mode="semantics"/></m:mrow>
3289 <m:mrow><xsl:apply-templates select="m:uplimit" mode="semantics"/></m:mrow>
3291 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3292 <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
3296 <!-- HELM: xref added -->
3297 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
3298 <xsl:attribute name="xref">
3299 <xsl:value-of select="m:int/@id"/>
3302 <!-- HELM: not rendered correctly <![CDATA[∫]]> -->
3303 <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
3304 <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
3305 <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
3313 <xsl:template match = "m:apply[m:limit[1]]">
3315 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3316 <xsl:attribute name="xref">
3317 <xsl:value-of select="@id"/>
3322 <!-- HELM: xref added -->
3323 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lim/@id">
3324 <xsl:attribute name="xref">
3325 <xsl:value-of select="m:lim/@id"/>
3329 <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
3330 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3331 <m:mo><xsl:text disable-output-escaping='yes'>→</xsl:text></m:mo>
3332 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3334 <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
3335 <xsl:apply-templates select = "*[3]" mode = "semantics"/>
3339 <xsl:apply-templates select = "*[4]" mode = "semantics"/>
3344 <!-- ***************** TRIGONOMETRY ***************** -->
3346 <xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos |
3347 self::m:tan | self::m:sec | self::m:csc |
3348 self::m:cot | self::m:sinh | self::m:cosh |
3349 self::m:tanh | self::m:sech | self::m:csch |
3350 self::m:coth | self::m:arcsin | self::m:arccos |
3351 self::m:arctan | self::m:arcsec | self::m:arccsc |
3352 self::m:arccot | self::m:arcsinh | self::m:arccosh |
3353 self::m:arctanh | self::m:arcsech | self::m:arccsch |
3354 self::m:arccoth ] ]">
3357 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3358 <xsl:attribute name="xref">
3359 <xsl:value-of select="@id"/>
3362 <xsl:if test="not(parent::m:apply[m:power[1]])">
3363 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
3365 <xsl:if test="parent::m:apply[m:power[1]]">
3367 <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
3368 <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
3371 <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
3372 <xsl:apply-templates select = "*[2]" mode = "semantics">
3373 <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
3374 <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
3375 </xsl:apply-templates>
3379 <xsl:template match = "*" mode="trigonometry">
3381 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3382 <xsl:attribute name="xref">
3383 <xsl:value-of select="@id"/>
3387 <xsl:when test="self::m:sin">
3388 <xsl:value-of select="'sin'"/>
3390 <xsl:when test="self::m:cos">
3391 <xsl:value-of select="'cos'"/>
3393 <xsl:when test="self::m:tan">
3394 <xsl:value-of select="'tan'"/>
3396 <xsl:when test="self::m:sec">
3397 <xsl:value-of select="'sec'"/>
3399 <xsl:when test="self::m:csc">
3400 <xsl:value-of select="'csc'"/>
3402 <xsl:when test="self::m:cot">
3403 <xsl:value-of select="'cot'"/>
3405 <xsl:when test="self::m:sinh">
3406 <xsl:value-of select="'sinh'"/>
3408 <xsl:when test="self::m:cosh">
3409 <xsl:value-of select="'cosh'"/>
3411 <xsl:when test="self::m:tanh">
3412 <xsl:value-of select="'tanh'"/>
3414 <xsl:when test="self::m:sech">
3415 <xsl:value-of select="'sech'"/>
3417 <xsl:when test="self::m:csch">
3418 <xsl:value-of select="'csch'"/>
3420 <xsl:when test="self::m:coth">
3421 <xsl:value-of select="'coth'"/>
3423 <xsl:when test="self::m:arcsin">
3424 <xsl:value-of select="'arcsin'"/>
3426 <xsl:when test="self::m:arccos">
3427 <xsl:value-of select="'arccos'"/>
3429 <xsl:when test="self::m:arctan">
3430 <xsl:value-of select="'arctan'"/>
3432 <xsl:when test="self::m:arcsec">
3433 <xsl:value-of select="'arcsec'"/>
3435 <xsl:when test="self::m:arccsc">
3436 <xsl:value-of select="'arccsc'"/>
3438 <xsl:when test="self::m:arccot">
3439 <xsl:value-of select="'arccot'"/>
3441 <xsl:when test="self::m:arcsinh">
3442 <xsl:value-of select="'arcsinh'"/>
3444 <xsl:when test="self::m:arccosh">
3445 <xsl:value-of select="'arccosh'"/>
3447 <xsl:when test="self::m:arctanh">
3448 <xsl:value-of select="'arctanh'"/>
3450 <xsl:when test="self::m:arcsech">
3451 <xsl:value-of select="'arcsech'"/>
3453 <xsl:when test="self::m:arccsch">
3454 <xsl:value-of select="'arccsch'"/>
3456 <xsl:when test="self::m:arccoth">
3457 <xsl:value-of select="'arccot'"/>
3464 <!-- ***************** STATISTICS ***************** -->
3466 <!-- HELM WARNING: mean id was lost! -->
3467 <xsl:template match = "m:apply[m:mean[1]]">
3469 <m:mfenced open="<" close=">" separators=",">
3470 Now is: mrow + mo + separator (mo) -->
3472 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3473 <xsl:attribute name="xref">
3474 <xsl:value-of select="@id"/>
3478 <!-- HELM: xref added -->
3479 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3480 <xsl:attribute name="xref">
3481 <xsl:value-of select="m:mean/@id"/>
3483 </xsl:if><</m:mo>
3484 <xsl:for-each select = "*[position()>1]">
3485 <!-- HELM: if added -->
3486 <xsl:if test="position() != 1">
3487 <m:mo separator="true">,</m:mo>
3489 <xsl:apply-templates select = "." mode="semantics"/>
3492 <!-- HELM: xref added -->
3493 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3494 <xsl:attribute name="xref">
3495 <xsl:value-of select="m:mean/@id"/>
3497 </xsl:if>></m:mo>
3499 <!-- HELM: </m:mfenced> -->
3502 <xsl:template match = "m:apply[m:sdev[1]]">
3504 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3505 <xsl:attribute name="xref">
3506 <xsl:value-of select="@id"/>
3510 <!-- HELM: xref added -->
3511 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sdev/@id">
3512 <xsl:attribute name="xref">
3513 <xsl:value-of select="m:sdev/@id"/>
3516 <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
3517 <m:mfenced separators=",">
3518 <xsl:for-each select = "*[position()>1]">
3519 <xsl:apply-templates select = "." mode="semantics"/>
3525 <xsl:template match = "m:apply[m:variance[1]]">
3527 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3528 <xsl:attribute name="xref">
3529 <xsl:value-of select="@id"/>
3533 <!-- HELM: xref added -->
3534 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:variance/@id">
3535 <xsl:attribute name="xref">
3536 <xsl:value-of select="m:variance/@id"/>
3539 <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
3541 <m:mfenced separators=",">
3542 <xsl:for-each select = "*[position()>1]">
3543 <xsl:apply-templates select = "." mode="semantics"/>
3551 <xsl:template match = "m:apply[m:median[1]]">
3553 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3554 <xsl:attribute name="xref">
3555 <xsl:value-of select="@id"/>
3559 <!-- HELM: xref added -->
3560 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:median/@id">
3561 <xsl:attribute name="xref">
3562 <xsl:value-of select="m:median/@id"/>
3564 </xsl:if>median</m:mo>
3565 <m:mfenced separators=",">
3566 <xsl:for-each select = "*[position()>1]">
3567 <xsl:apply-templates select = "." mode="semantics"/>
3573 <xsl:template match = "m:apply[m:mode[1]]">
3575 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3576 <xsl:attribute name="xref">
3577 <xsl:value-of select="@id"/>
3581 <!-- HELM: xref added -->
3582 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mode/@id">
3583 <xsl:attribute name="xref">
3584 <xsl:value-of select="m:mode/@id"/>
3586 </xsl:if>mode</m:mo>
3587 <m:mfenced separators=",">
3588 <xsl:for-each select = "*[position()>1]">
3589 <xsl:apply-templates select = "." mode="semantics"/>
3595 <!-- HELM WARNING: mean id was lost! -->
3596 <xsl:template match = "m:apply[m:moment[1]]">
3598 <m:mfenced open="<" close=">" separators="">
3599 Now is: mrow + mo -->
3601 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3602 <xsl:attribute name="xref">
3603 <xsl:value-of select="@id"/>
3607 <!-- HELM: xref added -->
3608 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:moment/@id">
3609 <xsl:attribute name="xref">
3610 <xsl:value-of select="m:momemt/@id"/>
3612 </xsl:if><</m:mo>
3613 <xsl:if test="*[2]=m:degree and not(*[3]=m:momentabout)">
3615 <xsl:apply-templates select="*[3]" mode = "semantics"/>
3616 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3619 <xsl:if test="*[2]=m:degree and *[3]=m:momentabout">
3621 <xsl:apply-templates select="*[4]" mode = "semantics"/>
3622 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3625 <xsl:if test="not(*[2]=m:degree) and *[2]=m:momentabout">
3626 <xsl:for-each select = "*[position()>2]">
3627 <xsl:apply-templates select = "." mode="semantics"/>
3630 <xsl:if test="not(*[2]=m:degree) and not(*[2]=m:momentabout)">
3631 <xsl:for-each select = "*[position()>1]">
3632 <xsl:apply-templates select = "." mode="semantics"/>
3636 <!-- HELM: xref added -->
3637 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
3638 <xsl:attribute name="xref">
3639 <xsl:value-of select="m:mean/@id"/>
3641 </xsl:if>></m:mo>
3643 <!-- HELM: </m:mfenced> -->
3647 <!-- ***************** LINEAR ALGEBRA ***************** -->
3649 <xsl:template match="m:vector">
3650 <m:mfenced separators="">
3651 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3652 <xsl:attribute name="xref">
3653 <xsl:value-of select="@id"/>
3657 <xsl:for-each select="*">
3659 <xsl:apply-templates select="." mode = "semantics"/>
3666 <xsl:template match = "m:matrix">
3667 <m:mfenced separators="">
3668 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3669 <xsl:attribute name="xref">
3670 <xsl:value-of select="@id"/>
3674 <xsl:apply-templates select="*" mode = "semantics"/>
3679 <xsl:template match = "m:matrixrow">
3681 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3682 <xsl:attribute name="xref">
3683 <xsl:value-of select="@id"/>
3686 <xsl:for-each select="*">
3688 <xsl:apply-templates select="." mode = "semantics"/>
3694 <xsl:template match = "m:apply[m:determinant[1]]">
3696 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3697 <xsl:attribute name="xref">
3698 <xsl:value-of select="@id"/>
3702 <!-- HELM: xref added -->
3703 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:determinant/@id">
3704 <xsl:attribute name="xref">
3705 <xsl:value-of select="m:determinant/@id"/>
3708 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3712 <xsl:template match = "m:apply[m:transpose[1]]">
3714 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3715 <xsl:attribute name="xref">
3716 <xsl:value-of select="@id"/>
3719 <xsl:apply-templates select = "*[2]" mode = "semantics"/>
3721 <!-- HELM: xref added -->
3722 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:transpose/@id">
3723 <xsl:attribute name="xref">
3724 <xsl:value-of select="m:transpose/@id"/>
3730 <!-- HELM: ERROR, this template generates the selected content elements
3731 and doesn't generate the presentation for selector -->
3732 <!--<xsl:template match = "m:apply[m:selector[1]]">
3733 <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
3734 <xsl:variable name="m" select = "*[3]"/>
3736 <xsl:when test="*[4]=m:cn">
3737 <xsl:variable name="n" select = "*[4]"/>
3738 <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
3741 <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
3745 <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
3746 <xsl:variable name="m" select = "*[3]"/>
3747 <xsl:copy-of select = "*[2]/*[position()=$m]"/>
3751 <xsl:template match = "m:apply[m:selector[1]]">
3753 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3754 <xsl:attribute name="xref">
3755 <xsl:value-of select="@id"/>
3758 <xsl:apply-templates select = "*[2]" mode="semantics"/>
3760 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:selector/@id">
3761 <xsl:attribute name="xref">
3762 <xsl:value-of select="m:selector/@id"/>
3766 <xsl:when test="*[3]=m:cn">
3767 <xsl:apply-templates select = "*[3]" mode="semantics"/>
3773 <xsl:if test="*[2]=m:matrix and *[4]=m:cn">
3774 <xsl:apply-templates select = "*[4]" mode="semantics"/>
3780 <xsl:template match = "m:apply[m:vectorproduct[1] |
3781 m:scalarproduct[1] | m:outerproduct[1]]">
3783 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
3784 <xsl:attribute name="xref">
3785 <xsl:value-of select="@id"/>
3788 <xsl:apply-templates select="*[2]" mode = "semantics"/>
3790 <xsl:if test="m:vectorproduct[1]">
3791 <!-- HELM: xref added -->
3792 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:vectorproduct/@id">
3793 <xsl:attribute name="xref">
3794 <xsl:value-of select="m:vectorproduct/@id"/>
3797 <xsl:text disable-output-escaping='yes'>⨯</xsl:text>
3799 <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
3800 <!-- HELM: xref added -->
3801 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and *[1]/@id">
3802 <xsl:attribute name="xref">
3803 <xsl:value-of select="*[1]/@id"/>
3806 <xsl:value-of select="'.'"/>
3809 <xsl:apply-templates select="*[3]" mode = "semantics"/>
3814 <!-- ***************** CONSTANT and SYMBOL ELEMENTS ***************** -->
3816 <xsl:template match="m:integers">
3818 <!-- HELM: xref added -->
3819 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:integers/@id">
3820 <xsl:attribute name="xref">
3821 <xsl:value-of select="m:integers/@id"/>
3824 <xsl:text disable-output-escaping='yes'>ℤ</xsl:text></m:mi>
3827 <xsl:template match="m:reals">
3829 <!-- HELM: xref added -->
3830 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:reals/@id">
3831 <xsl:attribute name="xref">
3832 <xsl:value-of select="m:reals/@id"/>
3835 <xsl:text disable-output-escaping='yes'>ℝ</xsl:text></m:mi>
3838 <xsl:template match="m:rationals">
3840 <!-- HELM: xref added -->
3841 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rationals/@id">
3842 <xsl:attribute name="xref">
3843 <xsl:value-of select="m:rationals/@id"/>
3846 <xsl:text disable-output-escaping='yes'>ℚ</xsl:text></m:mi>
3849 <xsl:template match="m:naturalnumbers">
3851 <!-- HELM: xref added -->
3852 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:naturalnumbers/@id">
3853 <xsl:attribute name="xref">
3854 <xsl:value-of select="m:naturalnumbers/@id"/>
3857 <xsl:text disable-output-escaping='yes'>ℕ</xsl:text></m:mi>
3860 <xsl:template match="m:complexes">
3862 <!-- HELM: xref added -->
3863 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:complexes/@id">
3864 <xsl:attribute name="xref">
3865 <xsl:value-of select="m:complexes/@id"/>
3868 <xsl:text disable-output-escaping='yes'>ℂ</xsl:text></m:mi>
3871 <xsl:template match="m:primes">
3873 <!-- HELM: xref added -->
3874 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:primes/@id">
3875 <xsl:attribute name="xref">
3876 <xsl:value-of select="m:primes/@id"/>
3879 <xsl:text disable-output-escaping='yes'>ℙ</xsl:text></m:mi>
3882 <xsl:template match="m:exponentiale">
3884 <!-- HELM: xref added -->
3885 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exponentiale/@id">
3886 <xsl:attribute name="xref">
3887 <xsl:value-of select="m:exponentiale/@id"/>
3890 <xsl:text disable-output-escaping="yes">ⅇ</xsl:text></m:mi>
3893 <xsl:template match="m:imaginaryi">
3895 <!-- HELM: xref added -->
3896 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginaryi/@id">
3897 <xsl:attribute name="xref">
3898 <xsl:value-of select="m:imaginaryi/@id"/>
3901 <!-- HELM: not rendered correctly <![CDATA[ⅈ]]> -->
3902 <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
3905 <xsl:template match="m:notanumber">
3907 <!-- HELM: xref added -->
3908 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notanumber/@id">
3909 <xsl:attribute name="xref">
3910 <xsl:value-of select="m:notanumber/@id"/>
3915 <xsl:template match="m:true">
3917 <!-- HELM: xref added -->
3918 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:true/@id">
3919 <xsl:attribute name="xref">
3920 <xsl:value-of select="m:true/@id"/>
3922 </xsl:if>true</m:mi>
3925 <xsl:template match="m:false">
3927 <!-- HELM: xref added -->
3928 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:false/@id">
3929 <xsl:attribute name="xref">
3930 <xsl:value-of select="m:false/@id"/>
3932 </xsl:if>false</m:mi>
3935 <xsl:template match="m:emptyset">
3937 <!-- HELM: xref added -->
3938 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:emptyset/@id">
3939 <xsl:attribute name="xref">
3940 <xsl:value-of select="m:emptyset/@id"/>
3943 <!-- HELM: not rendered correctly <![CDATA[∅]]> -->
3944 <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
3947 <xsl:template match="m:pi">
3949 <!-- HELM: xref added -->
3950 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:pi/@id">
3951 <xsl:attribute name="xref">
3952 <xsl:value-of select="m:pi/@id"/>
3955 <!-- HELM: not rendered correctly <![CDATA[π]]> -->
3956 <xsl:text disable-output-escaping="yes">π</xsl:text></m:mi>
3959 <xsl:template match="m:eulergamma">
3961 <!-- HELM: xref added -->
3962 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:eulergamma/@id">
3963 <xsl:attribute name="xref">
3964 <xsl:value-of select="m:eulergamma/@id"/>
3967 <!-- HELM: not rendered correctly <![CDATA[γ]]> -->
3968 <xsl:text disable-output-escaping="yes">γ</xsl:text></m:mi>
3971 <xsl:template match="m:infinity">
3973 <!-- HELM: xref added -->
3974 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:infinity/@id">
3975 <xsl:attribute name="xref">
3976 <xsl:value-of select="m:infinity/@id"/>
3979 <!-- HELM: not rendered correctly <![CDATA[∞]]> -->
3980 <xsl:text disable-output-escaping="yes">∞</xsl:text></m:mi>