Debian Codegraph @

texmf-dist/tex4ht/xtpipes/jsml.4xt

raw
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" >
3 <xtpipes signature="jsml.4xt (2007-09-01-14:10)">
4 <sax content-handler="xtpipes.util.ScriptsManager, tex4ht.GroupMn, tex4ht.JsmlFilter"
5 lexical-handler="xtpipes.util.ScriptsManagerLH" >
6 <script element="mn-group" >
7 <dom name="." xml="." method="mnGroup" class="tex4ht.HtJsml" />
8 <set name="rmXmlDecl" >
9 <![CDATA[
10 <xsl:stylesheet version="1.0"
11 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 >
13 <xsl:output omit-xml-declaration = "yes" />
14
15 <xsl:template match="*|@*|text()|comment()" >
16 <xsl:copy>
17 <xsl:apply-templates select="*|@*|text()|comment()" />
18 </xsl:copy>
19 </xsl:template>
20 </xsl:stylesheet>
21 ]]>
22
23 </set>
24 <xslt name="." xml="." xsl="rmXmlDecl" />
25
26
27 <set name="merge" >
28 <![CDATA[
29 <xsl:stylesheet version="1.0"
30 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
31 >
32 <xsl:output omit-xml-declaration = "yes" />
33
34 <xsl:template match="mn-group" >
35 <xsl:choose>
36 <xsl:when test=" not(child::mn) ">
37 <xsl:apply-templates select="*|text()" />
38 </xsl:when>
39 <xsl:otherwise>
40 <mn>
41 <xsl:value-of select="." />
42 </mn>
43 </xsl:otherwise>
44 </xsl:choose>
45 </xsl:template>
46
47 <xsl:template match="*|@*|text()|comment()" >
48 <xsl:copy>
49 <xsl:apply-templates select="*|@*|text()|comment()" />
50 </xsl:copy>
51 </xsl:template>
52 </xsl:stylesheet>
53 ]]>
54
55 </set>
56 <xslt name="." xml="." xsl="merge" />
57 </script>
58
59 <script element="msup" >
60 <set name="m-sub-sup" >
61 <![CDATA[
62 <xsl:stylesheet version="1.0"
63 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
64 >
65 <xsl:output omit-xml-declaration = "yes" />
66
67 <xsl:template match="*[
68 (self::msup or self::msub or self::msubsup)
69 and
70 not(
71 child::mrow[ @class = 'mrow-sub' ]
72 / child::*[ not(@title = 'speech-extra')
73 and
74 (normalize-space(.) != '')
75 ]
76 )
77 and
78 not(
79 child::mrow[ @class = 'mrow-super' ]
80 / child::*[ not(@title = 'speech-extra')
81 and
82 (normalize-space(.) != '')
83 ]
84 )
85 ]" >
86 <xsl:apply-templates select="child::mrow[
87 @class = 'mrow-base' ]/*" />
88 </xsl:template>
89
90 <xsl:template match="*|@*|text()|comment()" >
91 <xsl:copy>
92 <xsl:apply-templates select="*|@*|text()|comment()" />
93 </xsl:copy>
94 </xsl:template>
95 </xsl:stylesheet>
96 ]]>
97
98 </set>
99 <xslt name="." xml="." xsl="m-sub-sup" />
100 <set name="m-sup-2-3" >
101 <![CDATA[
102 <xsl:stylesheet version="1.0"
103 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
104 >
105 <xsl:output omit-xml-declaration = "yes" />
106
107 <xsl:template match="msup[
108 (normalize-space(
109 child::mrow[ (@class = 'mrow-super') ]
110 / child::*[ not (@class = 'begin-script')
111 and
112 not (@class = 'end-script')
113 ]
114 ) = '2')
115 and not(
116 child::mrow[ @class = 'mrow-base' ]
117 / child::span[ not( @title = 'speech-extra' ) ]
118 [ position() = last() ]
119 / self::* [ @class = 'mo-op' ]
120 )
121
122 and (normalize-space(mrow[@class = 'mrow-base']) != '' )
123 ]" >
124 <xsl:copy>
125 <xsl:apply-templates select="*|@*|text()|comment()"
126 mode="squared" />
127 </xsl:copy>
128 </xsl:template>
129 <xsl:template match="*|@*|text()|comment()"
130 mode="squared" >
131 <xsl:copy>
132 <xsl:choose>
133 <xsl:when test=" @class = 'mrow-super' ">
134 <xsl:apply-templates select="@*" />
135 <mo class="mo-op">
136 <xsl:text> squared </xsl:text>
137 </mo>
138 </xsl:when>
139 <xsl:otherwise>
140 <xsl:apply-templates select="*|@*|text()" />
141 </xsl:otherwise>
142 </xsl:choose>
143 </xsl:copy>
144 </xsl:template>
145 <xsl:template match="msup[
146 (normalize-space(
147 child::mrow[ (@class = 'mrow-super') ]
148 / child::*[ not (@class = 'begin-script')
149 and
150 not (@class = 'end-script')
151 ]
152 ) = '3')
153 and not(
154 child::mrow[ @class = 'mrow-base' ]
155 / child::span[ not( @title = 'speech-extra' ) ]
156 [ position() = last() ]
157 / self::* [ @class = 'mo-op' ]
158 )
159
160 and (normalize-space(mrow[@class = 'mrow-base']) != '' )
161 ]" >
162 <xsl:copy>
163 <xsl:apply-templates select="*|@*|text()|comment()"
164 mode="cube" />
165 </xsl:copy>
166 </xsl:template>
167 <xsl:template match="*|@*|text()|comment()"
168 mode="cube" >
169 <xsl:copy>
170 <xsl:choose>
171 <xsl:when test=" @class = 'mrow-super' ">
172 <xsl:apply-templates select="@*" />
173 <mo class="mo-op">
174 <xsl:text> cube </xsl:text>
175 </mo>
176 </xsl:when>
177 <xsl:otherwise>
178 <xsl:apply-templates select="*|@*|text()" />
179 </xsl:otherwise>
180 </xsl:choose>
181 </xsl:copy>
182 </xsl:template>
183
184 <xsl:template match="*|@*|text()|comment()" >
185 <xsl:copy>
186 <xsl:apply-templates select="*|@*|text()|comment()" />
187 </xsl:copy>
188 </xsl:template>
189 </xsl:stylesheet>
190 ]]>
191
192 </set>
193 <xslt name="." xml="." xsl="m-sup-2-3" />
194
195 </script>
196 <script element="msub" >
197 <set name="m-sub-sup" >
198 <![CDATA[
199 <xsl:stylesheet version="1.0"
200 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
201 >
202 <xsl:output omit-xml-declaration = "yes" />
203
204 <xsl:template match="*[
205 (self::msup or self::msub or self::msubsup)
206 and
207 not(
208 child::mrow[ @class = 'mrow-sub' ]
209 / child::*[ not(@title = 'speech-extra')
210 and
211 (normalize-space(.) != '')
212 ]
213 )
214 and
215 not(
216 child::mrow[ @class = 'mrow-super' ]
217 / child::*[ not(@title = 'speech-extra')
218 and
219 (normalize-space(.) != '')
220 ]
221 )
222 ]" >
223 <xsl:apply-templates select="child::mrow[
224 @class = 'mrow-base' ]/*" />
225 </xsl:template>
226
227 <xsl:template match="
228 msub [
229 normalize-space(child::*[1]) = 'log'
230 or
231 normalize-space(child::*[1]) = 'ln'
232 ]" >
233 <xsl:copy>
234 <xsl:apply-templates select="@*" />
235 <xsl:apply-templates select="child::*[1]" />
236 <xsl:apply-templates select="child::*[2]"
237 mode="log" />
238 </xsl:copy>
239 </xsl:template>
240 <xsl:template match="*" mode="log" >
241 <xsl:copy>
242 <xsl:apply-templates select="@*" />
243 <xsl:choose>
244 <xsl:when test="parent::mrow[ @class = 'mrow-sub' ]" >
245 <BREAK SIZE="small"/>
246 <xsl:apply-templates select="*" />
247 <BREAK SIZE="small"/>
248 <span title="speech-extra">
249 <xsl:text>of</xsl:text>
250 </span>
251 <BREAK SIZE="small"/>
252 </xsl:when>
253 <xsl:otherwise>
254 <xsl:apply-templates
255 select="*[ not(@title = 'speech-extra') ]"
256 mode="log" />
257 </xsl:otherwise>
258 </xsl:choose>
259 </xsl:copy>
260 </xsl:template>
261
262 <xsl:template match="*|@*|text()|comment()" >
263 <xsl:copy>
264 <xsl:apply-templates select="*|@*|text()|comment()" />
265 </xsl:copy>
266 </xsl:template>
267 </xsl:stylesheet>
268 ]]>
269
270 </set>
271 <xslt name="." xml="." xsl="m-sub-sup" />
272
273 </script>
274 <script element="msubsup" >
275 <set name="subsup-prime" >
276 <![CDATA[
277 <xsl:stylesheet version="1.0"
278 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
279 >
280 <xsl:output omit-xml-declaration = "yes" />
281
282 <xsl:template match="msubsup[
283 (count(
284 child::mrow [ @class='mrow-super' ]
285 / child::* [ not(@title = 'speech-extra') ]
286 ) = 1)
287 and
288 not(
289 child::mrow [ @class='mrow-super' ]
290 / child::* [ not(@title = 'speech-extra') ]
291 / descendant::*[ preceding-sibling::*
292 or following-sibling::*]
293 )
294 and
295 child::mrow [ @class='mrow-super' ]
296 / child::* [ not(@title = 'speech-extra') ]
297 / descendant-or-self::span[ @class='char' ]
298 / child::span[
299 (@class = 'ch 2032') or (@class = 'ch 2033')
300 or (@class = 'ch 2034')
301 ]
302 ]" >
303 <msub>
304 <mrow class="mrow-base">
305 <xsl:apply-templates select="
306 child::mrow[@class = 'mrow-base'] / *
307 " />
308 <BREAK SIZE="small"/>
309 <xsl:apply-templates select="
310 child::mrow[@class = 'mrow-super']
311 / child::* [ not(@title = 'speech-extra') ]
312 " />
313 </mrow>
314 <mrow class="mrow-sub">
315 <xsl:apply-templates
316 select="*[@class = 'mrow-sub'] /* " />
317 <xsl:apply-templates select="
318 child::mrow[@class = 'mrow-super']
319 / child::* [ @class = 'end-script' ]
320 " />
321 </mrow>
322 </msub>
323 </xsl:template>
324
325 <xsl:template match="*|@*|text()|comment()" >
326 <xsl:copy>
327 <xsl:apply-templates select="*|@*|text()|comment()" />
328 </xsl:copy>
329 </xsl:template>
330 </xsl:stylesheet>
331 ]]>
332
333 </set>
334 <xslt name="." xml="." xsl="subsup-prime" />
335
336 <set name="m-sub-sup" >
337 <![CDATA[
338 <xsl:stylesheet version="1.0"
339 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
340 >
341 <xsl:output omit-xml-declaration = "yes" />
342
343 <xsl:template match="*[
344 (self::msup or self::msub or self::msubsup)
345 and
346 not(
347 child::mrow[ @class = 'mrow-sub' ]
348 / child::*[ not(@title = 'speech-extra')
349 and
350 (normalize-space(.) != '')
351 ]
352 )
353 and
354 not(
355 child::mrow[ @class = 'mrow-super' ]
356 / child::*[ not(@title = 'speech-extra')
357 and
358 (normalize-space(.) != '')
359 ]
360 )
361 ]" >
362 <xsl:apply-templates select="child::mrow[
363 @class = 'mrow-base' ]/*" />
364 </xsl:template>
365
366 <xsl:template match="*|@*|text()|comment()" >
367 <xsl:copy>
368 <xsl:apply-templates select="*|@*|text()|comment()" />
369 </xsl:copy>
370 </xsl:template>
371 </xsl:stylesheet>
372 ]]>
373
374 </set>
375 <xslt name="." xml="." xsl="m-sub-sup" />
376
377 <set name="m-subsup-2-3" >
378 <![CDATA[
379 <xsl:stylesheet version="1.0"
380 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
381 >
382 <xsl:output omit-xml-declaration = "yes" />
383
384 <xsl:template match="msubsup[
385 (normalize-space(
386 child::mrow[ (@class = 'mrow-super') ]
387 / child::span[ (@class != 'mid-script')
388 and
389 (@class != 'end-script')
390 ]
391 ) = '2')
392 and not(
393 child::mrow[ @class = 'mrow-base' ]
394 / child::span[ not( @title = 'speech-extra' ) ]
395 [ position() = last() ]
396 / self::* [ @class = 'mo-op' ]
397 )
398
399 ]" >
400 <xsl:copy>
401 <xsl:attribute name="class" >
402 <xsl:text>msub</xsl:text>
403 </xsl:attribute>
404 <xsl:apply-templates select="*|text()|comment()"
405 mode="sub-squared" />
406 </xsl:copy>
407 </xsl:template>
408 <xsl:template match="*|@*|text()|comment()"
409 mode="sub-squared" >
410 <xsl:copy>
411 <xsl:choose>
412 <xsl:when test=" @class = 'mrow-sub' ">
413 <xsl:apply-templates select="*[
414 not( @class = 'end-script' )
415 ]
416 |@*|text()|comment()" />
417 <xsl:apply-templates select="
418 following-sibling::*[1] / *[
419 @class = 'end-script'
420 ] " />
421 </xsl:when>
422 <xsl:when test=" @class = 'mrow-super' ">
423 <xsl:attribute name="class" >
424 <xsl:text>squared-super</xsl:text>
425 </xsl:attribute>
426 <mo class="mo-op">
427 <xsl:text> squared </xsl:text>
428 </mo>
429 </xsl:when>
430 <xsl:otherwise>
431 <xsl:apply-templates select="*|@*|text()|comment()" />
432 </xsl:otherwise>
433 </xsl:choose>
434 </xsl:copy>
435 </xsl:template>
436 <xsl:template match="msubsup[
437 (normalize-space(
438 child::mrow[ (@class = 'mrow-super') ]
439 / child::span[ (@class != 'mid-script')
440 and
441 (@class != 'end-script')
442 ]
443 ) = '3')
444 and not(
445 child::mrow[ @class = 'mrow-base' ]
446 / child::span[ not( @title = 'speech-extra' ) ]
447 [ position() = last() ]
448 / self::* [ @class = 'mo-op' ]
449 )
450
451 ]" >
452 <xsl:copy>
453 <xsl:attribute name="class" >
454 <xsl:text>msub</xsl:text>
455 </xsl:attribute>
456 <xsl:apply-templates select="*|text()|comment()"
457 mode="sub-cube" />
458 </xsl:copy>
459 </xsl:template>
460 <xsl:template match="*|@*|text()|comment()"
461 mode="sub-cube" >
462 <xsl:copy>
463 <xsl:choose>
464 <xsl:when test=" @class = 'mrow-sub' ">
465 <xsl:apply-templates select="*[
466 not( @class = 'end-script' )
467 ]
468 |@*|text()|comment()" />
469 <xsl:apply-templates select="
470 following-sibling::*[1] / *[
471 @class = 'end-script'
472 ] " />
473 </xsl:when>
474 <xsl:when test=" @class = 'mrow-super' ">
475 <xsl:attribute name="class" >
476 <xsl:text>cube-super</xsl:text>
477 </xsl:attribute>
478 <mo class="mo-op">
479 <xsl:text> cube </xsl:text>
480 </mo>
481 </xsl:when>
482 <xsl:otherwise>
483 <xsl:apply-templates select="*|@*|text()|comment()" />
484 </xsl:otherwise>
485 </xsl:choose>
486 </xsl:copy>
487 </xsl:template>
488
489 <xsl:template match="*|@*|text()|comment()" >
490 <xsl:copy>
491 <xsl:apply-templates select="*|@*|text()|comment()" />
492 </xsl:copy>
493 </xsl:template>
494 </xsl:stylesheet>
495 ]]>
496
497 </set>
498 <xslt name="." xml="." xsl="m-subsup-2-3" />
499
500 </script>
501
502 <script element="mfrac" >
503 <set name="mfrac" >
504 <![CDATA[
505 <xsl:stylesheet version="1.0"
506 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
507 >
508 <xsl:output omit-xml-declaration = "yes" />
509
510 <xsl:template match="mfrac" >
511 <xsl:copy>
512 <xsl:choose>
513 <xsl:when test="
514 (string-length(
515 normalize-space(child::mrow[ @class = 'mrow-numerator' ][1])
516 ) = 1)
517 and
518 (string-length(
519 normalize-space(child::mrow[ @class = 'mrow-enumerator' ][1])
520 ) = 1)
521 ">
522 <xsl:variable name="a">
523 <xsl:value-of select="
524 normalize-space(child::mrow[ @class = 'mrow-numerator' ][1])
525 " />
526 </xsl:variable>
527 <xsl:variable name="b">
528 <xsl:value-of select="
529 normalize-space(child::mrow[ @class = 'mrow-enumerator' ][1])
530 " />
531 </xsl:variable>
532
533 <xsl:choose>
534 <xsl:when test="
535 (translate($a,'123456789','') != '')
536 or
537 (translate($b,'123456789','') != '')
538 " >
539 <xsl:apply-templates select="*|@*|text()|comment()" />
540 </xsl:when>
541 <xsl:when test=" $a &lt; $b ">
542 <xsl:attribute name="class">
543 <xsl:text>word-frac</xsl:text>
544 </xsl:attribute>
545 <xsl:choose>
546 <xsl:when test=" $a = 1 "><xsl:text> one </xsl:text></xsl:when>
547 <xsl:when test=" $a = 2 "><xsl:text> two </xsl:text></xsl:when>
548 <xsl:when test=" $a = 3 "><xsl:text> three </xsl:text></xsl:when>
549 <xsl:when test=" $a = 4 "><xsl:text> four </xsl:text></xsl:when>
550 <xsl:when test=" $a = 5 "><xsl:text> five </xsl:text></xsl:when>
551 <xsl:when test=" $a = 6 "><xsl:text> six </xsl:text></xsl:when>
552 <xsl:when test=" $a = 7 "><xsl:text> seven </xsl:text></xsl:when>
553 <xsl:when test=" $a = 8 "><xsl:text> eight </xsl:text></xsl:when>
554 <xsl:when test=" $a = 9 "><xsl:text> nine </xsl:text></xsl:when>
555 </xsl:choose>
556
557 <xsl:choose>
558 <xsl:when test=" $b = 2 "><xsl:text> half</xsl:text></xsl:when>
559 <xsl:when test=" $b = 3 "><xsl:text> third</xsl:text></xsl:when>
560 <xsl:when test=" $b = 4 "><xsl:text> fourth</xsl:text></xsl:when>
561 <xsl:when test=" $b = 5 "><xsl:text> fifth</xsl:text></xsl:when>
562 <xsl:when test=" $b = 6 "><xsl:text> sixth</xsl:text></xsl:when>
563 <xsl:when test=" $b = 7 "><xsl:text> seventh</xsl:text></xsl:when>
564 <xsl:when test=" $b = 8 "><xsl:text> eighth</xsl:text></xsl:when>
565 <xsl:when test=" $b = 9 "><xsl:text> nineth</xsl:text></xsl:when>
566 </xsl:choose>
567 <xsl:if test=" $a &gt; 1 "><xsl:text>s</xsl:text></xsl:if>
568 <xsl:text> </xsl:text>
569
570 </xsl:when>
571 <xsl:otherwise>
572 <xsl:apply-templates select="*|@*|text()|comment()" />
573 </xsl:otherwise>
574 </xsl:choose>
575 </xsl:when>
576
577 <xsl:when test="
578 self::mfrac
579 and
580 child::mrow[ @class = 'mrow-enumerator' ]
581 / child::mfrac[ @class = 'continued-mfrac' ]
582 and
583 ( normalize-space(
584 child::mrow[ @class = 'mrow-numerator' ]
585 )
586 =
587 normalize-space(
588 child::mrow[ @class = 'mrow-enumerator' ]
589 / child::mfrac[ @class = 'continued-mfrac' ]
590 / child::mrow[ @class = 'mrow-numerator' ]
591 )
592 )
593 and (
594 normalize-space(
595 child::span[ @class = 'mrow-enumerator' ] /
596 child::mfrac /
597 preceding-sibling::*[1] )
598 =
599 normalize-space(
600 child::span[ @class = 'mrow-enumerator' ] /
601 child::mfrac /
602 child::span[ @class = 'mrow-enumerator' ] /
603 child::span[ @class = 'continued-mfrac' ] /
604 preceding-sibling::*[1] )
605 )
606
607 " >
608 <xsl:variable name="a">
609 <xsl:apply-templates select="
610 child::span[ @class = 'mrow-enumerator' ] /
611 child::span[ @class = 'mcontinued-mfrac' ] /
612 preceding-sibling::*[2]
613 " mode="enum-op" />
614 </xsl:variable>
615 <xsl:variable name="b">
616 <xsl:apply-templates select="
617 child::span[ @class = 'mrow-enumerator' ] /
618 child::span[ @class = 'mcontinued-mfrac' ] /
619 child::span[ @class = 'mrow-enumerator' ] /
620 child::span[
621 self::mfrac or (@class = 'mcontinued-mfrac')
622 ] /
623 preceding-sibling::*[2]
624 " mode="enum-op" />
625 </xsl:variable>
626
627 <xsl:choose>
628 <xsl:when test="
629 normalize-space($a)=normalize-space($b)
630 " >
631 <xsl:attribute name="class">
632 <xsl:value-of select=" 'continued-mfrac' " />
633 </xsl:attribute>
634 <xsl:apply-templates select="*|text()|comment()" />
635 </xsl:when>
636 <xsl:otherwise>
637 <xsl:apply-templates select="*|@*|text()|comment()" />
638 </xsl:otherwise>
639 </xsl:choose>
640 </xsl:when>
641
642 <xsl:when test="
643 (translate(
644 normalize-space(
645 child::mrow[ @class = 'mrow-numerator' ]),
646 '0123456789','')= '')
647 and ( normalize-space(
648 child::mrow[ @class = 'mrow-numerator' ])
649 and
650 normalize-space(
651 child::mrow[ @class = 'mrow-enumerator' ] /
652 child::mfrac /
653 child::mrow[ @class = 'mrow-numerator' ])
654 )
655 and
656 ( normalize-space(
657 child::mrow[ @class = 'mrow-enumerator' ] /
658 child::mfrac /
659 child::mrow[ @class = 'mrow-numerator' ])
660 and
661 normalize-space(
662 child::mrow[ @class = 'mrow-enumerator' ] /
663 child::mfrac /
664 child::mrow[ @class = 'mrow-enumerator' ] /
665 child::mfrac /
666 child::mrow[ @class = 'mrow-numerator' ])
667 )
668
669 and ( child::mrow[ @class = 'mrow-enumerator' ] /
670 child::mfrac /
671 preceding-sibling::*[1][@class = 'MathClass-bin']
672 )
673 and
674 ( normalize-space(
675 child::mrow[ @class = 'mrow-enumerator' ] /
676 child::mfrac /
677 preceding-sibling::*[1] )
678 =
679 normalize-space(
680 child::mrow[ @class = 'mrow-enumerator' ] /
681 child::mfrac /
682 child::mrow[ @class = 'mrow-enumerator' ] /
683 child::mfrac /
684 preceding-sibling::*[1] )
685 )
686
687 ">
688 <xsl:variable name="a">
689 <xsl:apply-templates select="
690 child::mrow[ @class = 'mrow-enumerator' ] /
691 child::mfrac /
692 preceding-sibling::*[2]
693 " mode="enum-op" />
694 </xsl:variable>
695 <xsl:variable name="b">
696 <xsl:apply-templates select="
697 child::mrow[ @class = 'mrow-enumerator' ] /
698 child::mfrac /
699 child::mrow[ @class = 'mrow-enumerator' ] /
700 child::mfrac /
701 preceding-sibling::*[2]
702 " mode="enum-op" />
703 </xsl:variable>
704 <xsl:variable name="c">
705 <xsl:value-of select="
706 normalize-space(
707 child::mrow[ @class = 'mrow-enumerator' ] /
708 child::mfrac /
709 child::mrow[ @class = 'mrow-enumerator' ] /
710 child::mfrac /
711 child::mrow[ @class = 'mrow-enumerator' ] )
712 " />
713 </xsl:variable>
714
715 <xsl:choose>
716 <xsl:when test="
717 ( translate($a,'0123456789 ','') = '')
718 and (normalize-space($a)=normalize-space($b))
719 and starts-with( $c, normalize-space( $a ))
720 and starts-with(
721 normalize-space(
722 substring-after( $c, normalize-space( $a )) )
723 ,
724 normalize-space(
725 child::mrow[ @class = 'mrow-enumerator' ] /
726 child::mfrac /
727 preceding-sibling::*[1] )
728 )
729 " >
730 <xsl:attribute name="class">
731 <xsl:value-of select=" 'continued-mfrac' " />
732 </xsl:attribute>
733 <xsl:apply-templates select="*|text()|comment()" />
734 </xsl:when>
735 <xsl:otherwise>
736 <xsl:apply-templates select="*|@*|text()|comment()" />
737 </xsl:otherwise>
738 </xsl:choose>
739 </xsl:when>
740
741 <xsl:otherwise>
742 <xsl:apply-templates select="*|@*|text()|comment()" />
743 </xsl:otherwise>
744 </xsl:choose>
745 </xsl:copy>
746 </xsl:template>
747 <xsl:template match="*" mode="enum-op">
748 <xsl:if test="preceding-sibling::*" >
749 <xsl:apply-templates select=" preceding-sibling::*[1] " />
750 </xsl:if>
751 <xsl:value-of select="." />
752 </xsl:template>
753
754 <xsl:template match="*|@*|text()|comment()" >
755 <xsl:copy>
756 <xsl:apply-templates select="*|@*|text()|comment()" />
757 </xsl:copy>
758 </xsl:template>
759 </xsl:stylesheet>
760 ]]>
761
762 </set>
763 <xslt name="." xml="." xsl="mfrac" />
764 </script>
765
766 <script element="munder::munder-underline" >
767 <set name="munder" >
768 <![CDATA[
769 <xsl:stylesheet version="1.0"
770 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
771 >
772 <xsl:output omit-xml-declaration = "yes" />
773
774 <xsl:template match="*" mode="content" >
775 <xsl:choose>
776 <xsl:when test=" @class = 'char' " >
777 <xsl:if test="not( child::*[
778 (@class = 'ch 2032') or (@class = 'ch 2033')
779 or (@class = 'ch 2034')
780 ] )">
781 <xsl:text>x</xsl:text>
782 </xsl:if>
783 </xsl:when>
784 <xsl:when test=" not(
785 (@title = 'speech-extra') or (@class = 'accent-char')
786 ) " >
787 <xsl:apply-templates select="*|text()" mode="content" />
788 </xsl:when>
789 </xsl:choose>
790 </xsl:template>
791
792 <xsl:template match="munder[
793 (@class = 'munder-underline')
794 and
795 child::mrow[
796 (@class = 'mo-0332')
797 and
798 descendant::mi
799 ]
800 ]" >
801 <xsl:variable name="content">
802 <xsl:apply-templates select="*" mode="content" />
803 </xsl:variable>
804 <xsl:choose>
805 <xsl:when test="
806 string-length( normalize-space( $content )) = 1
807 " >
808 <xsl:copy>
809 <xsl:apply-templates select="@*" />
810 <xsl:apply-templates
811 select=" *[ @class != 'begin-end' ] " />
812 <span class="begin-end" title="speech-extra" >
813 <BREAK SIZE="small"/>
814 <xsl:text> under bar </xsl:text>
815 <BREAK SIZE="small"/>
816 </span>
817 </xsl:copy>
818 </xsl:when>
819 <xsl:otherwise>
820 <xsl:choose>
821 <xsl:when test="child::mrow / child::mover">
822 <xsl:apply-templates select="child::mrow / child::mover"
823 mode="under-mover" />
824 </xsl:when>
825 <xsl:otherwise>
826 <xsl:copy>
827 <xsl:apply-templates select=" *|@*|text() " />
828 </xsl:copy>
829 </xsl:otherwise>
830 </xsl:choose>
831
832 </xsl:otherwise>
833 </xsl:choose>
834 </xsl:template>
835 <xsl:template match="*" mode="under-mover" >
836 <xsl:choose>
837 <xsl:when test="self::mover">
838 <xsl:copy>
839 <xsl:apply-templates select="@*" />
840 <xsl:apply-templates select="*" mode="under-mover" />
841 </xsl:copy>
842 </xsl:when>
843 <xsl:when test="self::mrow[ parent::mover ]">
844 <xsl:copy>
845 <xsl:apply-templates select="@*" />
846 <xsl:choose>
847 <xsl:when test="child::mover">
848 <xsl:apply-templates select="*" mode="under-mover" />
849 </xsl:when>
850 <xsl:otherwise>
851 <munder class="munder-underline">
852 <xsl:apply-templates select="
853 ancestor::munder[1] / child::*[following-sibling::mrow]
854 "/>
855
856 <mrow class="mo-0032">
857 <xsl:apply-templates select="*" />
858 </mrow>
859 <xsl:apply-templates select="
860 ancestor::munder[1] / child::*[preceding-sibling::mrow]
861 "/>
862
863 </munder>
864 </xsl:otherwise>
865 </xsl:choose>
866
867 </xsl:copy>
868 </xsl:when>
869 <xsl:otherwise>
870 <xsl:apply-templates select="." />
871 </xsl:otherwise>
872 </xsl:choose>
873 </xsl:template>
874
875 <xsl:template match="*|@*|text()|comment()" >
876 <xsl:copy>
877 <xsl:apply-templates select="*|@*|text()|comment()" />
878 </xsl:copy>
879 </xsl:template>
880 </xsl:stylesheet>
881 ]]>
882
883 </set>
884 <xslt name="." xml="." xsl="munder" />
885 </script>
886 <script element="mover::mover-overline" >
887 <set name="mover" >
888 <![CDATA[
889 <xsl:stylesheet version="1.0"
890 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
891 >
892 <xsl:output omit-xml-declaration = "yes" />
893
894 <xsl:template match="*" mode="content" >
895 <xsl:choose>
896 <xsl:when test=" @class = 'char' " >
897 <xsl:if test="not( child::*[
898 (@class = 'ch 2032') or (@class = 'ch 2033')
899 or (@class = 'ch 2034')
900 ] )">
901 <xsl:text>x</xsl:text>
902 </xsl:if>
903 </xsl:when>
904 <xsl:when test=" not(
905 (@title = 'speech-extra') or (@class = 'accent-char')
906 ) " >
907 <xsl:apply-templates select="*|text()" mode="content" />
908 </xsl:when>
909 </xsl:choose>
910 </xsl:template>
911
912 <xsl:template match="mover[
913 (@class = 'mover-overline')
914 and
915 child::mrow[
916 (@class = 'mo-00AF')
917 and
918 descendant::mi
919 ]
920 ]" >
921 <xsl:variable name="content">
922 <xsl:apply-templates select="*" mode="content" />
923 </xsl:variable>
924 <xsl:choose>
925 <xsl:when test="
926 string-length( normalize-space( $content )) = 1
927 " >
928 <BREAK SIZE="small"/>
929 <xsl:choose>
930 <xsl:when test="child::mrow / child::munder">
931 <xsl:apply-templates select="child::mrow / child::munder"
932 mode="under-munder" />
933 </xsl:when>
934 <xsl:otherwise>
935 <xsl:copy>
936 <xsl:apply-templates select="@*" />
937 <xsl:apply-templates
938 select=" *[ @class != 'begin-end' ] " />
939 <span class="begin-end" title="speech-extra" >
940 <BREAK SIZE="small"/>
941 <xsl:text> over bar </xsl:text>
942 <BREAK SIZE="small"/>
943 </span>
944
945 </xsl:copy>
946 </xsl:otherwise>
947 </xsl:choose>
948
949 </xsl:when>
950 <xsl:otherwise>
951 <xsl:copy>
952 <xsl:apply-templates select="@*" />
953 <xsl:apply-templates
954 select="*|text()|comment()" />
955 </xsl:copy>
956 </xsl:otherwise>
957 </xsl:choose>
958 </xsl:template>
959 <xsl:template match="*" mode="under-munder" >
960 <xsl:choose>
961 <xsl:when test="self::munder">
962 <xsl:copy>
963 <xsl:apply-templates select="@*" />
964 <xsl:apply-templates select="*" mode="under-munder" />
965 </xsl:copy>
966 </xsl:when>
967 <xsl:when test="self::mrow[ parent::munder ]">
968 <xsl:copy>
969 <xsl:apply-templates select="@*" />
970 <xsl:choose>
971 <xsl:when test="child::munder">
972 <xsl:apply-templates select="*" mode="under-munder" />
973 </xsl:when>
974 <xsl:otherwise>
975 <mover class="mover-overline">
976 <mrow class="mo-00AF">
977 <xsl:apply-templates select="*" />
978 </mrow>
979 <span class="begin-end" title="speech-extra" >
980 <BREAK SIZE="small"/>
981 <xsl:text> over bar </xsl:text>
982 <BREAK SIZE="small"/>
983 </span>
984
985 </mover>
986 </xsl:otherwise>
987 </xsl:choose>
988
989 </xsl:copy>
990 </xsl:when>
991 <xsl:otherwise>
992 <xsl:apply-templates select="." />
993 </xsl:otherwise>
994 </xsl:choose>
995 </xsl:template>
996
997 <xsl:template match="*|@*|text()|comment()" >
998 <xsl:copy>
999 <xsl:apply-templates select="*|@*|text()|comment()" />
1000 </xsl:copy>
1001 </xsl:template>
1002 </xsl:stylesheet>
1003 ]]>
1004
1005 </set>
1006 <xslt name="." xml="." xsl="mover" />
1007 </script>
1008
1009 <script element="msub::limits-msub-msup" >
1010 <set name="smash" >
1011 <![CDATA[
1012 <xsl:stylesheet version="1.0"
1013 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1014 >
1015 <xsl:output omit-xml-declaration = "yes" />
1016
1017 <xsl:template match="*[
1018 (@class = 'limits-msub-msup')
1019 and
1020 child::*[ (position() = 1)
1021 and (@class = 'limits-mrow-base')
1022 and child::*[ (position() = 1)
1023 and (@class = 'limits-msub-msup')
1024 ] ]
1025 ]" >
1026 <xsl:copy>
1027 <xsl:apply-templates select="@*" />
1028 <xsl:apply-templates select="
1029 *[1]
1030 / *[1]
1031 / *[ not(@class='limits-mrow-super') ] " />
1032 <xsl:apply-templates select=" *[
1033 preceding-sibling::*
1034 and
1035 not(@class='limits-mrow-super') ]" />
1036 <xsl:apply-templates select="
1037 *[1]
1038 / *[1]
1039 / *[@class='limits-mrow-super' ] " />
1040 <xsl:apply-templates select=" *[
1041 preceding-sibling::*
1042 and
1043 (@class='limits-mrow-super') ]" />
1044 </xsl:copy>
1045 </xsl:template>
1046
1047 <xsl:template match="*|@*|text()|comment()" >
1048 <xsl:copy>
1049 <xsl:apply-templates select="*|@*|text()|comment()" />
1050 </xsl:copy>
1051 </xsl:template>
1052 </xsl:stylesheet>
1053 ]]>
1054
1055 </set>
1056 <xslt name="." xml="." xsl="smash" />
1057 </script>
1058 <script element="msup::limits-msub-msup" >
1059 <set name="smash" >
1060 <![CDATA[
1061 <xsl:stylesheet version="1.0"
1062 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1063 >
1064 <xsl:output omit-xml-declaration = "yes" />
1065
1066 <xsl:template match="*[
1067 (@class = 'limits-msub-msup')
1068 and
1069 child::*[ (position() = 1)
1070 and (@class = 'limits-mrow-base')
1071 and child::*[ (position() = 1)
1072 and (@class = 'limits-msub-msup')
1073 ] ]
1074 ]" >
1075 <xsl:copy>
1076 <xsl:apply-templates select="@*" />
1077 <xsl:apply-templates select="
1078 *[1]
1079 / *[1]
1080 / *[ not(@class='limits-mrow-super') ] " />
1081 <xsl:apply-templates select=" *[
1082 preceding-sibling::*
1083 and
1084 not(@class='limits-mrow-super') ]" />
1085 <xsl:apply-templates select="
1086 *[1]
1087 / *[1]
1088 / *[@class='limits-mrow-super' ] " />
1089 <xsl:apply-templates select=" *[
1090 preceding-sibling::*
1091 and
1092 (@class='limits-mrow-super') ]" />
1093 </xsl:copy>
1094 </xsl:template>
1095
1096 <xsl:template match="*|@*|text()|comment()" >
1097 <xsl:copy>
1098 <xsl:apply-templates select="*|@*|text()|comment()" />
1099 </xsl:copy>
1100 </xsl:template>
1101 </xsl:stylesheet>
1102 ]]>
1103
1104 </set>
1105 <xslt name="." xml="." xsl="smash" />
1106 </script>
1107 <script element="msubsup::limits-msub-msup" >
1108 <set name="smash" >
1109 <![CDATA[
1110 <xsl:stylesheet version="1.0"
1111 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1112 >
1113 <xsl:output omit-xml-declaration = "yes" />
1114
1115 <xsl:template match="*[
1116 (@class = 'limits-msub-msup')
1117 and
1118 child::*[ (position() = 1)
1119 and (@class = 'limits-mrow-base')
1120 and child::*[ (position() = 1)
1121 and (@class = 'limits-msub-msup')
1122 ] ]
1123 ]" >
1124 <xsl:copy>
1125 <xsl:apply-templates select="@*" />
1126 <xsl:apply-templates select="
1127 *[1]
1128 / *[1]
1129 / *[ not(@class='limits-mrow-super') ] " />
1130 <xsl:apply-templates select=" *[
1131 preceding-sibling::*
1132 and
1133 not(@class='limits-mrow-super') ]" />
1134 <xsl:apply-templates select="
1135 *[1]
1136 / *[1]
1137 / *[@class='limits-mrow-super' ] " />
1138 <xsl:apply-templates select=" *[
1139 preceding-sibling::*
1140 and
1141 (@class='limits-mrow-super') ]" />
1142 </xsl:copy>
1143 </xsl:template>
1144
1145 <xsl:template match="*|@*|text()|comment()" >
1146 <xsl:copy>
1147 <xsl:apply-templates select="*|@*|text()|comment()" />
1148 </xsl:copy>
1149 </xsl:template>
1150 </xsl:stylesheet>
1151 ]]>
1152
1153 </set>
1154 <xslt name="." xml="." xsl="smash" />
1155 </script>
1156
1157
1158 <script element="mi" >
1159 <set name="math-cap" >
1160 <![CDATA[
1161 <xsl:stylesheet version="1.0"
1162 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1163 >
1164 <xsl:output omit-xml-declaration = "yes" />
1165
1166 <xsl:template match="mi" >
1167 <xsl:copy>
1168 <xsl:apply-templates select="@*" />
1169 <xsl:if test=" string-length(.) = 1 " >
1170 <xsl:if test="
1171 (translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
1172 '') = '' )
1173 " >
1174 <span class="capital-description"
1175 title="speech-extra" >
1176 <xsl:text> capital </xsl:text>
1177 </span>
1178 </xsl:if>
1179 </xsl:if>
1180 <xsl:apply-templates select="*|text()|comment()" />
1181 </xsl:copy>
1182 </xsl:template>
1183
1184 <xsl:template match="*|@*|text()|comment()" >
1185 <xsl:copy>
1186 <xsl:apply-templates select="*|@*|text()|comment()" />
1187 </xsl:copy>
1188 </xsl:template>
1189 </xsl:stylesheet>
1190 ]]>
1191
1192 </set>
1193 <xslt name="." xml="." xsl="math-cap" />
1194 </script>
1195
1196 <script element="tr" >
1197 <set name="eqnum" >
1198 <![CDATA[
1199 <xsl:stylesheet version="1.0"
1200 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1201 >
1202 <xsl:output omit-xml-declaration = "yes" />
1203
1204 <xsl:template match="div[
1205 (parent::tr or parent::mtr)
1206 and ( normalize-space(.) = '' )
1207 and not( normalize-space(following-sibling::*) != '' )
1208 ]" >
1209 </xsl:template>
1210
1211 <xsl:template match="*|@*|text()|comment()" >
1212 <xsl:copy>
1213 <xsl:apply-templates select="*|@*|text()|comment()" />
1214 </xsl:copy>
1215 </xsl:template>
1216 </xsl:stylesheet>
1217 ]]>
1218
1219 </set>
1220 <xslt name="." xml="." xsl="eqnum" />
1221 </script>
1222 <script element="mtr" >
1223 <set name="eqnum" >
1224 <![CDATA[
1225 <xsl:stylesheet version="1.0"
1226 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1227 >
1228 <xsl:output omit-xml-declaration = "yes" />
1229
1230 <xsl:template match="div[
1231 (parent::tr or parent::mtr)
1232 and ( normalize-space(.) = '' )
1233 and not( normalize-space(following-sibling::*) != '' )
1234 ]" >
1235 </xsl:template>
1236
1237 <xsl:template match="*|@*|text()|comment()" >
1238 <xsl:copy>
1239 <xsl:apply-templates select="*|@*|text()|comment()" />
1240 </xsl:copy>
1241 </xsl:template>
1242 </xsl:stylesheet>
1243 ]]>
1244
1245 </set>
1246 <xslt name="." xml="." xsl="eqnum" />
1247 </script>
1248
1249 <script element="span::inline-math" >
1250 <set name="num-sub" >
1251 <![CDATA[
1252 <xsl:stylesheet version="1.0"
1253 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1254 >
1255 <xsl:output omit-xml-declaration = "yes" />
1256
1257 <xsl:template match="msub[
1258 (
1259 (count( child::mrow[ @class = 'mrow-base' ]
1260 / child::* ) = 1 )
1261 and child::mrow[ @class = 'mrow-base' ] / descendant::mi
1262 and not( ancestor::*[
1263 self::msub or self::msup or self::msubsup
1264 ] )
1265
1266 or
1267 (
1268 count( child::mrow[ @class = 'mrow-base' ]
1269 / child::* [
1270 not(self::BREAK)
1271 ]
1272 ) = 2 )
1273 and child::mrow[ @class = 'mrow-base' ] [
1274 child::*[1][ self::mi ]
1275 and
1276 child::*[
1277 (position() &gt; 1)
1278 and
1279 (normalize-space(.) =
1280 normalize-space(
1281 descendant-or-self::span[
1282 (@class = 'ch 2032') or (@class = 'ch 2033')
1283 or (@class = 'ch 2034')
1284 ]
1285 ))
1286 ]
1287 ]
1288 and not( ancestor::*[
1289 self::msub or self::msup or self::msubsup
1290 ] )
1291
1292 )
1293 and
1294 child::mrow[ @class = 'mrow-sub' ]
1295 / child::*[ not(@title = 'speech-extra') ][1]
1296 / self::*[
1297 normalize-space(.)
1298 = normalize-space( descendant::mn ) ]
1299 ]" >
1300 <xsl:copy>
1301 <xsl:apply-templates select="@*" />
1302 <BREAK SIZE="small"/>
1303 <xsl:apply-templates select="*[1]" />
1304 <mrow class="mrow-sub">
1305 <xsl:apply-templates
1306 select="*[2] / *[
1307 not(@title = 'speech-extra')
1308 ]" />
1309 <BREAK SIZE="small"/>
1310 </mrow>
1311 </xsl:copy>
1312 </xsl:template>
1313 <xsl:template match="msubsup[
1314 (
1315 (count( child::mrow[ @class = 'mrow-base' ]
1316 / child::* ) = 1 )
1317 and child::mrow[ @class = 'mrow-base' ] / descendant::mi
1318 and not( ancestor::*[
1319 self::msub or self::msup or self::msubsup
1320 ] )
1321
1322 )
1323 and
1324 child::mrow[ @class = 'mrow-sub' ]
1325 / child::*[ not(@title = 'speech-extra') ][1]
1326 / self::*[
1327 normalize-space(.)
1328 = normalize-space( descendant::mn ) ]
1329 ]" >
1330 <msup>
1331 <BREAK SIZE="small"/>
1332 <xsl:apply-templates select="*[1]" />
1333 <mrow class="mrow-sub">
1334 <xsl:apply-templates
1335 select="*[2] / *[
1336 not(@title = 'speech-extra')
1337 ]" />
1338 <BREAK SIZE="small"/>
1339 </mrow>
1340 <xsl:apply-templates select="*[3]" />
1341 </msup>
1342 </xsl:template>
1343
1344 <xsl:template match="*|@*|text()|comment()" >
1345 <xsl:copy>
1346 <xsl:apply-templates select="*|@*|text()|comment()" />
1347 </xsl:copy>
1348 </xsl:template>
1349 </xsl:stylesheet>
1350 ]]>
1351
1352 </set>
1353 <xslt name="." xml="." xsl="num-sub" />
1354
1355 <dom name="." xml="." method="fracLevel" class="tex4ht.HtJsml" />
1356 <set name="rmXmlDecl" >
1357 <![CDATA[
1358 <xsl:stylesheet version="1.0"
1359 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1360 >
1361 <xsl:output omit-xml-declaration = "yes" />
1362
1363 <xsl:template match="*|@*|text()|comment()" >
1364 <xsl:copy>
1365 <xsl:apply-templates select="*|@*|text()|comment()" />
1366 </xsl:copy>
1367 </xsl:template>
1368 </xsl:stylesheet>
1369 ]]>
1370
1371 </set>
1372 <xslt name="." xml="." xsl="rmXmlDecl" />
1373
1374
1375 <dom name="." xml="." method="scriptLevel" class="tex4ht.HtJsml" />
1376 <set name="rmXmlDecl" >
1377 <![CDATA[
1378 <xsl:stylesheet version="1.0"
1379 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1380 >
1381 <xsl:output omit-xml-declaration = "yes" />
1382
1383 <xsl:template match="*|@*|text()|comment()" >
1384 <xsl:copy>
1385 <xsl:apply-templates select="*|@*|text()|comment()" />
1386 </xsl:copy>
1387 </xsl:template>
1388 </xsl:stylesheet>
1389 ]]>
1390
1391 </set>
1392 <xslt name="." xml="." xsl="rmXmlDecl" />
1393
1394
1395 <dom name="." xml="." method="rootLevel" class="tex4ht.HtJsml" />
1396 <set name="rmXmlDecl" >
1397 <![CDATA[
1398 <xsl:stylesheet version="1.0"
1399 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1400 >
1401 <xsl:output omit-xml-declaration = "yes" />
1402
1403 <xsl:template match="*|@*|text()|comment()" >
1404 <xsl:copy>
1405 <xsl:apply-templates select="*|@*|text()|comment()" />
1406 </xsl:copy>
1407 </xsl:template>
1408 </xsl:stylesheet>
1409 ]]>
1410
1411 </set>
1412 <xslt name="." xml="." xsl="rmXmlDecl" />
1413
1414
1415 <set name="inline-math" >
1416 <![CDATA[
1417 <xsl:stylesheet version="1.0"
1418 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1419 >
1420 <xsl:output omit-xml-declaration = "yes" />
1421
1422 <xsl:template match="mn-group-s" >
1423 <xsl:apply-templates select="*|@*|text()|comment()" />
1424 </xsl:template>
1425
1426 <xsl:template match="mo[
1427 (@class='MathClass-punc')
1428 and ( (.='.') or (.=',') or (.='!')
1429 or (.=';') or (.=':') or (.='?') )
1430 ]" >
1431 <xsl:copy>
1432 <xsl:apply-templates select="@*" />
1433 <BREAK SIZE="small"/>
1434 <xsl:choose>
1435 <xsl:when test=" .='.' " >
1436 <SAYAS SUB="dot">.</SAYAS>
1437 </xsl:when>
1438 <xsl:when test=" .=',' " >
1439 <SAYAS SUB="comma">,</SAYAS>
1440 </xsl:when>
1441 <xsl:when test=" .=';' " >
1442 <SAYAS SUB="semicolon">;</SAYAS>
1443 </xsl:when>
1444 <xsl:when test=" .=':' " >
1445 <SAYAS SUB="colon">:</SAYAS>
1446 </xsl:when>
1447 <xsl:when test=" .='!' " >
1448 <SAYAS SUB="exclamation mark">!</SAYAS>
1449 </xsl:when>
1450 <xsl:when test=" .='?' " >
1451 <SAYAS SUB="question mark">?</SAYAS>
1452 </xsl:when>
1453 </xsl:choose>
1454 <BREAK SIZE="small"/>
1455 </xsl:copy>
1456 </xsl:template>
1457
1458 <xsl:template match="mn[
1459 ancestor::mover[
1460 not( descendant::*[
1461 (count( child::*[ not(@title = 'speech-extra')
1462 and not( self::BREAK )
1463 ]
1464 ) &gt; 1)
1465 ])
1466 and
1467 (
1468 preceding-sibling::*[1][self::dot or self::mn-group-s]
1469 or
1470 following-sibling::*[1][self::dot or self::mn-group-s]
1471 )
1472 ]
1473
1474 or
1475 ancestor::munder[
1476 not( descendant::*[
1477 (count( child::*[ not(@title = 'speech-extra')
1478 and not( self::BREAK )
1479 ]
1480 ) &gt; 1)
1481 ])
1482 and
1483 (
1484 preceding-sibling::*[1][self::dot or self::mn-group-s]
1485 or
1486 following-sibling::*[1][self::dot or self::mn-group-s]
1487 )
1488 ]
1489
1490 ]" >
1491 <xsl:copy>
1492 <SAYAS CLASS="digits">
1493 <xsl:value-of select="." />
1494 </SAYAS>
1495 </xsl:copy>
1496 </xsl:template>
1497
1498
1499 <xsl:template match="*" mode="content" >
1500 <xsl:choose>
1501 <xsl:when test=" @class = 'char' " >
1502 <xsl:if test="not( child::*[
1503 (@class = 'ch 2032') or (@class = 'ch 2033')
1504 or (@class = 'ch 2034')
1505 ] )">
1506 <xsl:text>x</xsl:text>
1507 </xsl:if>
1508 </xsl:when>
1509 <xsl:when test=" not(
1510 (@title = 'speech-extra') or (@class = 'accent-char')
1511 ) " >
1512 <xsl:apply-templates select="*|text()" mode="content" />
1513 </xsl:when>
1514 </xsl:choose>
1515 </xsl:template>
1516
1517 <xsl:template match="span[
1518 (@class = 'end-script')
1519 and
1520 ancestor::* [ following-sibling::* [
1521 not( @class = 'content-less' )
1522 ]
1523 ][1]
1524 / following-sibling::* [
1525 not( @class = 'content-less' )
1526 ][1]
1527 / self::*
1528 [
1529 (@class = 'end-math')
1530 or
1531 (@class = 'end-script')
1532 or
1533 (@class = 'end-root')
1534 or
1535 (@class = 'end-stack')
1536 or
1537 (@class = 'mid-stack')
1538 or
1539 (@class = 'end-array')
1540 or
1541 self::td or self::mtd or self::tr or self::mtr
1542 or
1543 (@title = 'implicit-baseline')
1544 ]
1545 ]" >
1546 <BREAK SIZE="small"/>
1547 </xsl:template>
1548 <xsl:template match="span[
1549 (@class = 'end-script')
1550 and
1551 parent::mrow / parent::msub
1552 and
1553 ancestor::* [ following-sibling::* ][1]
1554 / following-sibling::* [ normalize-space(.) != '' ][1]
1555 [
1556 (self::msub or self::msubsup)
1557 and
1558 (normalize-space(child::mrow[
1559 @class = 'mrow-base' ]) = '')
1560 ]
1561 ]" >
1562 <BREAK SIZE="small"/>
1563 </xsl:template>
1564 <xsl:template match="span[
1565 (@class = 'end-script')
1566 and
1567 parent::mrow /parent::*[ self::msup or self::msubsup]
1568 and
1569 ancestor::* [ following-sibling::* ][1]
1570 / following-sibling::* [ normalize-space(.) != '' ][1]
1571 [
1572 self::msup
1573 and
1574 (normalize-space(child::mrow[
1575 @class = 'mrow-base' ]) = '')
1576 ]
1577 ]" >
1578 <BREAK SIZE="small"/>
1579 </xsl:template>
1580
1581 <xsl:template match="span[
1582 (@class = 'begin-script')
1583 or (@class = 'mid-script')
1584 ]" >
1585 <xsl:copy>
1586 <xsl:apply-templates select="@*" />
1587 <xsl:apply-templates select="*|text()|comment()"
1588 mode="clean-script" />
1589 </xsl:copy>
1590 </xsl:template>
1591 <xsl:template match="*" mode="clean-script" >
1592 <xsl:copy>
1593 <xsl:apply-templates select="@*" />
1594 <xsl:apply-templates select="*|text()|comment()"
1595 mode="clean-script" />
1596 </xsl:copy>
1597 </xsl:template>
1598 <xsl:template match="text()" mode="clean-script" >
1599 </xsl:template>
1600 <xsl:template match="span[@class = 'scripts-extra']"
1601 mode="clean-script" >
1602 <xsl:copy>
1603 <xsl:apply-templates select="@*" />
1604 <xsl:value-of select="
1605 ancestor::span[
1606 (@class = 'begin-script')
1607 or (@class = 'mid-script') ] [1]
1608 " />
1609 </xsl:copy>
1610 </xsl:template>
1611
1612 <xsl:template match="mfrac[
1613 (
1614 (translate(
1615 concat(
1616 mrow[ (@class = 'mrow-numerator')],
1617 mrow[ (@class = 'mrow-enumerator')]
1618 ) ,'0123456789','') = '')
1619 and
1620 not(descendant::*/descendant::*
1621 /descendant::mn-group-s)
1622 or
1623 (@class = 'word-frac')
1624 )
1625 and
1626 preceding-sibling::*[1]
1627 / self::mn-group-s[ child::*[
1628 (position() = last())
1629 and
1630 self::mn
1631 ] ]
1632 ]" >
1633 <xsl:text> and </xsl:text>
1634 <xsl:copy>
1635 <xsl:apply-templates select="*|@*|text()|comment()" />
1636 </xsl:copy>
1637 </xsl:template>
1638
1639 <xsl:template match="mo[
1640 (@class = 'MathClass-bin')
1641 and
1642 ( normalize-space(.) =
1643 normalize-space(descendant::span[@class = 'ch 2212'])
1644 )
1645 and
1646 ( preceding-sibling::*[1][
1647 (@title='speech-extra')
1648 or (@class='MathClass-bin')
1649 or (@class='MathClass-rel')
1650 or (@class='MathClass-punc')
1651 or (@class='MathClass-op')
1652 or self::mn-group-s [ child::* [
1653 (position() = last())
1654 and
1655 (@class='MathClass-punc')
1656 ] ] ]
1657 and
1658 (
1659 following-sibling::*[1][ self::mn-group-s
1660 or self::mi ]
1661 or
1662 (count(following-sibling::*[
1663 not(@title = 'speech-extra')
1664 ]) = 1)
1665 )
1666 or
1667 not(preceding-sibling::*) and following-sibling::*
1668 )
1669 ]" >
1670 <xsl:copy>
1671 <xsl:attribute name="class">
1672 <xsl:text>mo-unary</xsl:text>
1673 </xsl:attribute>
1674 <xsl:apply-templates select="*|text()|comment()"
1675 mode="minus-neg" />
1676 </xsl:copy>
1677 </xsl:template>
1678 <xsl:template match="*|@*|text()|comment()" mode="minus-neg" >
1679 <xsl:copy>
1680 <xsl:apply-templates select="*|@*|text()|comment()"
1681 mode="minus-neg" />
1682 </xsl:copy>
1683 </xsl:template>
1684 <xsl:template match="text()" mode="minus-neg" >
1685 <xsl:choose>
1686 <xsl:when test=" . = 'minus' " >
1687 <xsl:text>negative</xsl:text>
1688 </xsl:when>
1689 <xsl:otherwise>
1690 <xsl:value-of select="." />
1691 </xsl:otherwise>
1692 </xsl:choose>
1693 </xsl:template>
1694
1695 <xsl:template match="span[ @class = 'end-limits-script' ]" >
1696 <xsl:if test=" parent::*[ not(following-sibling::*) ] ">
1697 <xsl:copy>
1698 <xsl:apply-templates select=" @* " />
1699 <xsl:choose>
1700 <xsl:when test="
1701 parent::*[ preceding-sibling::mrow[
1702 @class != 'limits-mrow-base'
1703 ] ]
1704 " >
1705 <BREAK SIZE="small"/>
1706 <xsl:text> end scripts </xsl:text>
1707 <BREAK SIZE="small"/>
1708 </xsl:when>
1709 <xsl:otherwise>
1710 <BREAK SIZE="small"/>
1711 <xsl:text> end script </xsl:text>
1712 <BREAK SIZE="small"/>
1713 </xsl:otherwise>
1714 </xsl:choose>
1715 </xsl:copy>
1716 </xsl:if>
1717 </xsl:template>
1718 <xsl:template match="span[ @class = 'begin-limits-script' ]" >
1719 <xsl:copy>
1720 <xsl:apply-templates select=" @* " />
1721 <xsl:choose>
1722 <xsl:when test="
1723 parent::*[ @class = 'limits-mrow-super' ]
1724 " >
1725 <xsl:apply-templates
1726 select=" parent::*
1727 / preceding-sibling::*[1] "
1728 mode = "extra-over" />
1729 </xsl:when>
1730 <xsl:when test="
1731 parent::*[ @class = 'limits-mrow-sub' ]
1732 " >
1733 <xsl:apply-templates
1734 select=" parent::*
1735 / preceding-sibling::*[1] "
1736 mode = "extra-under" />
1737 </xsl:when>
1738 </xsl:choose>
1739 <xsl:apply-templates select="*|text()|comment()" />
1740 </xsl:copy>
1741 </xsl:template>
1742 <xsl:template match="*" mode="extra-over" >
1743 <xsl:if test = " self::mrow[ @class = 'limits-mrow-super' ] " >
1744 <xsl:text> over </xsl:text>
1745 <xsl:apply-templates select=" preceding-sibling::*[1] "
1746 mode = "extra-over" />
1747 </xsl:if>
1748 </xsl:template>
1749 <xsl:template match="*" mode="extra-under" >
1750 <xsl:if test = " self::mrow[ @class = 'limits-mrow-sub' ] " >
1751 <xsl:text> under </xsl:text>
1752 <xsl:apply-templates select=" preceding-sibling::*[1] "
1753 mode = "extra-under" />
1754 </xsl:if>
1755 </xsl:template>
1756
1757 <xsl:template match="span[
1758 (@class = 'begin-script')
1759 and
1760 following-sibling::*[ not(@title = 'speech-extra') ] [1]
1761 / descendant-or-self::*[ not( self::PROS ) ][1]
1762 /
1763 child::span / child::span[
1764 (@class = 'ch 2032') or (@class = 'ch 2033')
1765 or (@class = 'ch 2034')
1766 ]
1767 ]" >
1768 <BREAK SIZE="small"/>
1769 </xsl:template>
1770 <xsl:template match="span[
1771 (@class = 'end-script')
1772 and
1773 preceding-sibling::*[ not(@title = 'speech-extra') ] [1]
1774 / descendant-or-self::*[ not( self::PROS ) ][1]
1775 /
1776 child::span / child::span[
1777 (@class = 'ch 2032') or (@class = 'ch 2033')
1778 or (@class = 'ch 2034')
1779 ]
1780 ]" >
1781 <BREAK SIZE="small"/>
1782 </xsl:template>
1783
1784 <xsl:template match="mrow[
1785 (@class = 'mrow-super')
1786 and
1787 parent::msup
1788 and
1789 (count( child::*[ not(@title = 'speech-extra')
1790 and not( self::BREAK )
1791 ]
1792 ) = 1)
1793 and
1794 child::*[ not(@title = 'speech-extra')
1795 and not( self::BREAK )
1796 ]
1797 [1][
1798 normalize-space(.)
1799 =
1800 normalize-space(
1801 descendant::span[@class = 'ch 2218']
1802 )
1803 ]
1804 ]" >
1805 <xsl:copy>
1806 <xsl:apply-templates select="@*" />
1807 <xsl:apply-templates
1808 select="*[not(@title = 'speech-extra')
1809 and
1810 not(self::BREAK)
1811 ]"
1812 mode="degree" />
1813 <BREAK SIZE="small"/>
1814 </xsl:copy>
1815 </xsl:template>
1816 <xsl:template match="*" mode="degree" >
1817 <xsl:copy>
1818 <xsl:apply-templates select="@*" />
1819 <xsl:choose>
1820 <xsl:when test="self::span[ @class='ch 2218' ]" >
1821 <xsl:text>degree</xsl:text>
1822 </xsl:when>
1823 <xsl:otherwise>
1824 <xsl:apply-templates
1825 select="*[not(self::BREAK)]|text()"
1826 mode="degree"/>
1827 </xsl:otherwise>
1828 </xsl:choose>
1829 </xsl:copy>
1830 </xsl:template>
1831
1832
1833
1834 <xsl:template match="*|@*|text()|comment()" >
1835 <xsl:copy>
1836 <xsl:apply-templates select="*|@*|text()|comment()" />
1837 </xsl:copy>
1838 </xsl:template>
1839 </xsl:stylesheet>
1840 ]]>
1841
1842 </set>
1843 <xslt name="." xml="." xsl="inline-math" />
1844 <sax name="." xml="." content-handler="tex4ht.JsmlMathBreak" />
1845
1846 <set name="inline-math-2" >
1847 <![CDATA[
1848 <xsl:stylesheet version="1.0"
1849 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1850 >
1851 <xsl:output omit-xml-declaration = "yes" />
1852
1853 <xsl:template match="*" mode="content" >
1854 <xsl:choose>
1855 <xsl:when test=" @class = 'char' " >
1856 <xsl:if test="not( child::*[
1857 (@class = 'ch 2032') or (@class = 'ch 2033')
1858 or (@class = 'ch 2034')
1859 ] )">
1860 <xsl:text>x</xsl:text>
1861 </xsl:if>
1862 </xsl:when>
1863 <xsl:when test=" not(
1864 (@title = 'speech-extra') or (@class = 'accent-char')
1865 ) " >
1866 <xsl:apply-templates select="*|text()" mode="content" />
1867 </xsl:when>
1868 </xsl:choose>
1869 </xsl:template>
1870
1871 <xsl:template match="span[
1872 (@class = 'end-script')
1873 and
1874 ancestor::*[ preceding-sibling::* [
1875 ((@class = 'begin-script') or (@class = 'mid-script')) ]]
1876 ]" >
1877 <xsl:copy>
1878 <xsl:apply-templates select="@*" />
1879 <xsl:apply-templates select="
1880 ancestor::*[ preceding-sibling::* [
1881 ((@class = 'begin-script') or
1882 (@class = 'mid-script')) ]][1]
1883 / preceding-sibling::* [
1884 ((@class = 'begin-script') or
1885 (@class = 'mid-script')) ][1]
1886 " mode="script-copy" />
1887 </xsl:copy>
1888 </xsl:template>
1889 <xsl:template match="*|@*|text()|comment()"
1890 mode="script-copy" >
1891 <xsl:copy>
1892 <xsl:apply-templates select="*|@*|text()|comment()" />
1893 </xsl:copy>
1894 </xsl:template>
1895 <xsl:template match="span[
1896 (@class = 'begin-script') or
1897 (@class = 'mid-script') ]" mode="script-copy" >
1898 <xsl:apply-templates select="*|text()|comment()" />
1899 </xsl:template>
1900
1901 <xsl:template match="span[
1902 ((@class = 'begin-script') or (@class = 'mid-script'))
1903 and
1904 following-sibling::*
1905 / following-sibling::span[ @class = 'end-script' ]
1906 and
1907 following-sibling::*[1]
1908 / descendant-or-self::*[ not(self::PROS) ][1]
1909 / child::*[1][
1910 (@class = 'mrow-base')
1911 and
1912 (normalize-space(.)='')
1913 ]
1914 ]" >
1915 </xsl:template>
1916
1917 <xsl:template match="span[
1918 (@class = 'begin-script')
1919 and
1920 following-sibling::* [1] / child::*[
1921 (position() = 1)
1922 and
1923 (@class = 'mrow-base')
1924 and
1925 ( normalize-space(.) = '' )
1926 ]
1927 ]" >
1928 </xsl:template>
1929
1930
1931
1932 <xsl:template match="*|@*|text()|comment()" >
1933 <xsl:copy>
1934 <xsl:apply-templates select="*|@*|text()|comment()" />
1935 </xsl:copy>
1936 </xsl:template>
1937 </xsl:stylesheet>
1938 ]]>
1939
1940 </set>
1941 <xslt name="." xml="." xsl="inline-math-2" />
1942 </script>
1943
1944 <script element="div::display-math" >
1945 <set name="num-sub" >
1946 <![CDATA[
1947 <xsl:stylesheet version="1.0"
1948 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1949 >
1950 <xsl:output omit-xml-declaration = "yes" />
1951
1952 <xsl:template match="msub[
1953 (
1954 (count( child::mrow[ @class = 'mrow-base' ]
1955 / child::* ) = 1 )
1956 and child::mrow[ @class = 'mrow-base' ] / descendant::mi
1957 and not( ancestor::*[
1958 self::msub or self::msup or self::msubsup
1959 ] )
1960
1961 or
1962 (
1963 count( child::mrow[ @class = 'mrow-base' ]
1964 / child::* [
1965 not(self::BREAK)
1966 ]
1967 ) = 2 )
1968 and child::mrow[ @class = 'mrow-base' ] [
1969 child::*[1][ self::mi ]
1970 and
1971 child::*[
1972 (position() &gt; 1)
1973 and
1974 (normalize-space(.) =
1975 normalize-space(
1976 descendant-or-self::span[
1977 (@class = 'ch 2032') or (@class = 'ch 2033')
1978 or (@class = 'ch 2034')
1979 ]
1980 ))
1981 ]
1982 ]
1983 and not( ancestor::*[
1984 self::msub or self::msup or self::msubsup
1985 ] )
1986
1987 )
1988 and
1989 child::mrow[ @class = 'mrow-sub' ]
1990 / child::*[ not(@title = 'speech-extra') ][1]
1991 / self::*[
1992 normalize-space(.)
1993 = normalize-space( descendant::mn ) ]
1994 ]" >
1995 <xsl:copy>
1996 <xsl:apply-templates select="@*" />
1997 <BREAK SIZE="small"/>
1998 <xsl:apply-templates select="*[1]" />
1999 <mrow class="mrow-sub">
2000 <xsl:apply-templates
2001 select="*[2] / *[
2002 not(@title = 'speech-extra')
2003 ]" />
2004 <BREAK SIZE="small"/>
2005 </mrow>
2006 </xsl:copy>
2007 </xsl:template>
2008 <xsl:template match="msubsup[
2009 (
2010 (count( child::mrow[ @class = 'mrow-base' ]
2011 / child::* ) = 1 )
2012 and child::mrow[ @class = 'mrow-base' ] / descendant::mi
2013 and not( ancestor::*[
2014 self::msub or self::msup or self::msubsup
2015 ] )
2016
2017 )
2018 and
2019 child::mrow[ @class = 'mrow-sub' ]
2020 / child::*[ not(@title = 'speech-extra') ][1]
2021 / self::*[
2022 normalize-space(.)
2023 = normalize-space( descendant::mn ) ]
2024 ]" >
2025 <msup>
2026 <BREAK SIZE="small"/>
2027 <xsl:apply-templates select="*[1]" />
2028 <mrow class="mrow-sub">
2029 <xsl:apply-templates
2030 select="*[2] / *[
2031 not(@title = 'speech-extra')
2032 ]" />
2033 <BREAK SIZE="small"/>
2034 </mrow>
2035 <xsl:apply-templates select="*[3]" />
2036 </msup>
2037 </xsl:template>
2038
2039 <xsl:template match="*|@*|text()|comment()" >
2040 <xsl:copy>
2041 <xsl:apply-templates select="*|@*|text()|comment()" />
2042 </xsl:copy>
2043 </xsl:template>
2044 </xsl:stylesheet>
2045 ]]>
2046
2047 </set>
2048 <xslt name="." xml="." xsl="num-sub" />
2049
2050 <dom name="." xml="." method="fracLevel" class="tex4ht.HtJsml" />
2051 <set name="rmXmlDecl" >
2052 <![CDATA[
2053 <xsl:stylesheet version="1.0"
2054 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2055 >
2056 <xsl:output omit-xml-declaration = "yes" />
2057
2058 <xsl:template match="*|@*|text()|comment()" >
2059 <xsl:copy>
2060 <xsl:apply-templates select="*|@*|text()|comment()" />
2061 </xsl:copy>
2062 </xsl:template>
2063 </xsl:stylesheet>
2064 ]]>
2065
2066 </set>
2067 <xslt name="." xml="." xsl="rmXmlDecl" />
2068
2069
2070 <dom name="." xml="." method="scriptLevel" class="tex4ht.HtJsml" />
2071 <set name="rmXmlDecl" >
2072 <![CDATA[
2073 <xsl:stylesheet version="1.0"
2074 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2075 >
2076 <xsl:output omit-xml-declaration = "yes" />
2077
2078 <xsl:template match="*|@*|text()|comment()" >
2079 <xsl:copy>
2080 <xsl:apply-templates select="*|@*|text()|comment()" />
2081 </xsl:copy>
2082 </xsl:template>
2083 </xsl:stylesheet>
2084 ]]>
2085
2086 </set>
2087 <xslt name="." xml="." xsl="rmXmlDecl" />
2088
2089
2090 <dom name="." xml="." method="rootLevel" class="tex4ht.HtJsml" />
2091 <set name="rmXmlDecl" >
2092 <![CDATA[
2093 <xsl:stylesheet version="1.0"
2094 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2095 >
2096 <xsl:output omit-xml-declaration = "yes" />
2097
2098 <xsl:template match="*|@*|text()|comment()" >
2099 <xsl:copy>
2100 <xsl:apply-templates select="*|@*|text()|comment()" />
2101 </xsl:copy>
2102 </xsl:template>
2103 </xsl:stylesheet>
2104 ]]>
2105
2106 </set>
2107 <xslt name="." xml="." xsl="rmXmlDecl" />
2108
2109
2110 <set name="display-math" >
2111 <![CDATA[
2112 <xsl:stylesheet version="1.0"
2113 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2114 >
2115 <xsl:output omit-xml-declaration = "yes" />
2116
2117 <xsl:template match="mn-group-s" >
2118 <xsl:apply-templates select="*|@*|text()|comment()" />
2119 </xsl:template>
2120
2121 <xsl:template match="mo[
2122 (@class='MathClass-punc')
2123 and ( (.='.') or (.=',') or (.='!')
2124 or (.=';') or (.=':') or (.='?') )
2125 ]" >
2126 <xsl:copy>
2127 <xsl:apply-templates select="@*" />
2128 <BREAK SIZE="small"/>
2129 <xsl:choose>
2130 <xsl:when test=" .='.' " >
2131 <SAYAS SUB="dot">.</SAYAS>
2132 </xsl:when>
2133 <xsl:when test=" .=',' " >
2134 <SAYAS SUB="comma">,</SAYAS>
2135 </xsl:when>
2136 <xsl:when test=" .=';' " >
2137 <SAYAS SUB="semicolon">;</SAYAS>
2138 </xsl:when>
2139 <xsl:when test=" .=':' " >
2140 <SAYAS SUB="colon">:</SAYAS>
2141 </xsl:when>
2142 <xsl:when test=" .='!' " >
2143 <SAYAS SUB="exclamation mark">!</SAYAS>
2144 </xsl:when>
2145 <xsl:when test=" .='?' " >
2146 <SAYAS SUB="question mark">?</SAYAS>
2147 </xsl:when>
2148 </xsl:choose>
2149 <BREAK SIZE="small"/>
2150 </xsl:copy>
2151 </xsl:template>
2152
2153 <xsl:template match="mn[
2154 ancestor::mover[
2155 not( descendant::*[
2156 (count( child::*[ not(@title = 'speech-extra')
2157 and not( self::BREAK )
2158 ]
2159 ) &gt; 1)
2160 ])
2161 and
2162 (
2163 preceding-sibling::*[1][self::dot or self::mn-group-s]
2164 or
2165 following-sibling::*[1][self::dot or self::mn-group-s]
2166 )
2167 ]
2168
2169 or
2170 ancestor::munder[
2171 not( descendant::*[
2172 (count( child::*[ not(@title = 'speech-extra')
2173 and not( self::BREAK )
2174 ]
2175 ) &gt; 1)
2176 ])
2177 and
2178 (
2179 preceding-sibling::*[1][self::dot or self::mn-group-s]
2180 or
2181 following-sibling::*[1][self::dot or self::mn-group-s]
2182 )
2183 ]
2184
2185 ]" >
2186 <xsl:copy>
2187 <SAYAS CLASS="digits">
2188 <xsl:value-of select="." />
2189 </SAYAS>
2190 </xsl:copy>
2191 </xsl:template>
2192
2193
2194 <xsl:template match="*" mode="content" >
2195 <xsl:choose>
2196 <xsl:when test=" @class = 'char' " >
2197 <xsl:if test="not( child::*[
2198 (@class = 'ch 2032') or (@class = 'ch 2033')
2199 or (@class = 'ch 2034')
2200 ] )">
2201 <xsl:text>x</xsl:text>
2202 </xsl:if>
2203 </xsl:when>
2204 <xsl:when test=" not(
2205 (@title = 'speech-extra') or (@class = 'accent-char')
2206 ) " >
2207 <xsl:apply-templates select="*|text()" mode="content" />
2208 </xsl:when>
2209 </xsl:choose>
2210 </xsl:template>
2211
2212 <xsl:template match="span[
2213 (@class = 'end-script')
2214 and
2215 ancestor::* [ following-sibling::* [
2216 not( @class = 'content-less' )
2217 ]
2218 ][1]
2219 / following-sibling::* [
2220 not( @class = 'content-less' )
2221 ][1]
2222 / self::*
2223 [
2224 (@class = 'end-math')
2225 or
2226 (@class = 'end-script')
2227 or
2228 (@class = 'end-root')
2229 or
2230 (@class = 'end-stack')
2231 or
2232 (@class = 'mid-stack')
2233 or
2234 (@class = 'end-array')
2235 or
2236 self::td or self::mtd or self::tr or self::mtr
2237 or
2238 (@title = 'implicit-baseline')
2239 ]
2240 ]" >
2241 <BREAK SIZE="small"/>
2242 </xsl:template>
2243 <xsl:template match="span[
2244 (@class = 'end-script')
2245 and
2246 parent::mrow / parent::msub
2247 and
2248 ancestor::* [ following-sibling::* ][1]
2249 / following-sibling::* [ normalize-space(.) != '' ][1]
2250 [
2251 (self::msub or self::msubsup)
2252 and
2253 (normalize-space(child::mrow[
2254 @class = 'mrow-base' ]) = '')
2255 ]
2256 ]" >
2257 <BREAK SIZE="small"/>
2258 </xsl:template>
2259 <xsl:template match="span[
2260 (@class = 'end-script')
2261 and
2262 parent::mrow /parent::*[ self::msup or self::msubsup]
2263 and
2264 ancestor::* [ following-sibling::* ][1]
2265 / following-sibling::* [ normalize-space(.) != '' ][1]
2266 [
2267 self::msup
2268 and
2269 (normalize-space(child::mrow[
2270 @class = 'mrow-base' ]) = '')
2271 ]
2272 ]" >
2273 <BREAK SIZE="small"/>
2274 </xsl:template>
2275
2276 <xsl:template match="span[
2277 (@class = 'begin-script')
2278 or (@class = 'mid-script')
2279 ]" >
2280 <xsl:copy>
2281 <xsl:apply-templates select="@*" />
2282 <xsl:apply-templates select="*|text()|comment()"
2283 mode="clean-script" />
2284 </xsl:copy>
2285 </xsl:template>
2286 <xsl:template match="*" mode="clean-script" >
2287 <xsl:copy>
2288 <xsl:apply-templates select="@*" />
2289 <xsl:apply-templates select="*|text()|comment()"
2290 mode="clean-script" />
2291 </xsl:copy>
2292 </xsl:template>
2293 <xsl:template match="text()" mode="clean-script" >
2294 </xsl:template>
2295 <xsl:template match="span[@class = 'scripts-extra']"
2296 mode="clean-script" >
2297 <xsl:copy>
2298 <xsl:apply-templates select="@*" />
2299 <xsl:value-of select="
2300 ancestor::span[
2301 (@class = 'begin-script')
2302 or (@class = 'mid-script') ] [1]
2303 " />
2304 </xsl:copy>
2305 </xsl:template>
2306
2307 <xsl:template match="mfrac[
2308 (
2309 (translate(
2310 concat(
2311 mrow[ (@class = 'mrow-numerator')],
2312 mrow[ (@class = 'mrow-enumerator')]
2313 ) ,'0123456789','') = '')
2314 and
2315 not(descendant::*/descendant::*
2316 /descendant::mn-group-s)
2317 or
2318 (@class = 'word-frac')
2319 )
2320 and
2321 preceding-sibling::*[1]
2322 / self::mn-group-s[ child::*[
2323 (position() = last())
2324 and
2325 self::mn
2326 ] ]
2327 ]" >
2328 <xsl:text> and </xsl:text>
2329 <xsl:copy>
2330 <xsl:apply-templates select="*|@*|text()|comment()" />
2331 </xsl:copy>
2332 </xsl:template>
2333
2334 <xsl:template match="mo[
2335 (@class = 'MathClass-bin')
2336 and
2337 ( normalize-space(.) =
2338 normalize-space(descendant::span[@class = 'ch 2212'])
2339 )
2340 and
2341 ( preceding-sibling::*[1][
2342 (@title='speech-extra')
2343 or (@class='MathClass-bin')
2344 or (@class='MathClass-rel')
2345 or (@class='MathClass-punc')
2346 or (@class='MathClass-op')
2347 or self::mn-group-s [ child::* [
2348 (position() = last())
2349 and
2350 (@class='MathClass-punc')
2351 ] ] ]
2352 and
2353 (
2354 following-sibling::*[1][ self::mn-group-s
2355 or self::mi ]
2356 or
2357 (count(following-sibling::*[
2358 not(@title = 'speech-extra')
2359 ]) = 1)
2360 )
2361 or
2362 not(preceding-sibling::*) and following-sibling::*
2363 )
2364 ]" >
2365 <xsl:copy>
2366 <xsl:attribute name="class">
2367 <xsl:text>mo-unary</xsl:text>
2368 </xsl:attribute>
2369 <xsl:apply-templates select="*|text()|comment()"
2370 mode="minus-neg" />
2371 </xsl:copy>
2372 </xsl:template>
2373 <xsl:template match="*|@*|text()|comment()" mode="minus-neg" >
2374 <xsl:copy>
2375 <xsl:apply-templates select="*|@*|text()|comment()"
2376 mode="minus-neg" />
2377 </xsl:copy>
2378 </xsl:template>
2379 <xsl:template match="text()" mode="minus-neg" >
2380 <xsl:choose>
2381 <xsl:when test=" . = 'minus' " >
2382 <xsl:text>negative</xsl:text>
2383 </xsl:when>
2384 <xsl:otherwise>
2385 <xsl:value-of select="." />
2386 </xsl:otherwise>
2387 </xsl:choose>
2388 </xsl:template>
2389
2390 <xsl:template match="span[ @class = 'end-limits-script' ]" >
2391 <xsl:if test=" parent::*[ not(following-sibling::*) ] ">
2392 <xsl:copy>
2393 <xsl:apply-templates select=" @* " />
2394 <xsl:choose>
2395 <xsl:when test="
2396 parent::*[ preceding-sibling::mrow[
2397 @class != 'limits-mrow-base'
2398 ] ]
2399 " >
2400 <BREAK SIZE="small"/>
2401 <xsl:text> end scripts </xsl:text>
2402 <BREAK SIZE="small"/>
2403 </xsl:when>
2404 <xsl:otherwise>
2405 <BREAK SIZE="small"/>
2406 <xsl:text> end script </xsl:text>
2407 <BREAK SIZE="small"/>
2408 </xsl:otherwise>
2409 </xsl:choose>
2410 </xsl:copy>
2411 </xsl:if>
2412 </xsl:template>
2413 <xsl:template match="span[ @class = 'begin-limits-script' ]" >
2414 <xsl:copy>
2415 <xsl:apply-templates select=" @* " />
2416 <xsl:choose>
2417 <xsl:when test="
2418 parent::*[ @class = 'limits-mrow-super' ]
2419 " >
2420 <xsl:apply-templates
2421 select=" parent::*
2422 / preceding-sibling::*[1] "
2423 mode = "extra-over" />
2424 </xsl:when>
2425 <xsl:when test="
2426 parent::*[ @class = 'limits-mrow-sub' ]
2427 " >
2428 <xsl:apply-templates
2429 select=" parent::*
2430 / preceding-sibling::*[1] "
2431 mode = "extra-under" />
2432 </xsl:when>
2433 </xsl:choose>
2434 <xsl:apply-templates select="*|text()|comment()" />
2435 </xsl:copy>
2436 </xsl:template>
2437 <xsl:template match="*" mode="extra-over" >
2438 <xsl:if test = " self::mrow[ @class = 'limits-mrow-super' ] " >
2439 <xsl:text> over </xsl:text>
2440 <xsl:apply-templates select=" preceding-sibling::*[1] "
2441 mode = "extra-over" />
2442 </xsl:if>
2443 </xsl:template>
2444 <xsl:template match="*" mode="extra-under" >
2445 <xsl:if test = " self::mrow[ @class = 'limits-mrow-sub' ] " >
2446 <xsl:text> under </xsl:text>
2447 <xsl:apply-templates select=" preceding-sibling::*[1] "
2448 mode = "extra-under" />
2449 </xsl:if>
2450 </xsl:template>
2451
2452 <xsl:template match="span[
2453 (@class = 'begin-script')
2454 and
2455 following-sibling::*[ not(@title = 'speech-extra') ] [1]
2456 / descendant-or-self::*[ not( self::PROS ) ][1]
2457 /
2458 child::span / child::span[
2459 (@class = 'ch 2032') or (@class = 'ch 2033')
2460 or (@class = 'ch 2034')
2461 ]
2462 ]" >
2463 <BREAK SIZE="small"/>
2464 </xsl:template>
2465 <xsl:template match="span[
2466 (@class = 'end-script')
2467 and
2468 preceding-sibling::*[ not(@title = 'speech-extra') ] [1]
2469 / descendant-or-self::*[ not( self::PROS ) ][1]
2470 /
2471 child::span / child::span[
2472 (@class = 'ch 2032') or (@class = 'ch 2033')
2473 or (@class = 'ch 2034')
2474 ]
2475 ]" >
2476 <BREAK SIZE="small"/>
2477 </xsl:template>
2478
2479 <xsl:template match="mrow[
2480 (@class = 'mrow-super')
2481 and
2482 parent::msup
2483 and
2484 (count( child::*[ not(@title = 'speech-extra')
2485 and not( self::BREAK )
2486 ]
2487 ) = 1)
2488 and
2489 child::*[ not(@title = 'speech-extra')
2490 and not( self::BREAK )
2491 ]
2492 [1][
2493 normalize-space(.)
2494 =
2495 normalize-space(
2496 descendant::span[@class = 'ch 2218']
2497 )
2498 ]
2499 ]" >
2500 <xsl:copy>
2501 <xsl:apply-templates select="@*" />
2502 <xsl:apply-templates
2503 select="*[not(@title = 'speech-extra')
2504 and
2505 not(self::BREAK)
2506 ]"
2507 mode="degree" />
2508 <BREAK SIZE="small"/>
2509 </xsl:copy>
2510 </xsl:template>
2511 <xsl:template match="*" mode="degree" >
2512 <xsl:copy>
2513 <xsl:apply-templates select="@*" />
2514 <xsl:choose>
2515 <xsl:when test="self::span[ @class='ch 2218' ]" >
2516 <xsl:text>degree</xsl:text>
2517 </xsl:when>
2518 <xsl:otherwise>
2519 <xsl:apply-templates
2520 select="*[not(self::BREAK)]|text()"
2521 mode="degree"/>
2522 </xsl:otherwise>
2523 </xsl:choose>
2524 </xsl:copy>
2525 </xsl:template>
2526
2527
2528 <xsl:template match="*|@*|text()|comment()" >
2529 <xsl:copy>
2530 <xsl:apply-templates select="*|@*|text()|comment()" />
2531 </xsl:copy>
2532 </xsl:template>
2533 </xsl:stylesheet>
2534 ]]>
2535
2536 </set>
2537 <xslt name="." xml="." xsl="display-math" />
2538 <sax name="." xml="." content-handler="tex4ht.JsmlMathBreak" />
2539
2540 <set name="display-math-2" >
2541 <![CDATA[
2542 <xsl:stylesheet version="1.0"
2543 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2544 >
2545 <xsl:output omit-xml-declaration = "yes" />
2546
2547 <xsl:template match="*" mode="content" >
2548 <xsl:choose>
2549 <xsl:when test=" @class = 'char' " >
2550 <xsl:if test="not( child::*[
2551 (@class = 'ch 2032') or (@class = 'ch 2033')
2552 or (@class = 'ch 2034')
2553 ] )">
2554 <xsl:text>x</xsl:text>
2555 </xsl:if>
2556 </xsl:when>
2557 <xsl:when test=" not(
2558 (@title = 'speech-extra') or (@class = 'accent-char')
2559 ) " >
2560 <xsl:apply-templates select="*|text()" mode="content" />
2561 </xsl:when>
2562 </xsl:choose>
2563 </xsl:template>
2564
2565 <xsl:template match="span[
2566 (@class = 'end-script')
2567 and
2568 ancestor::*[ preceding-sibling::* [
2569 ((@class = 'begin-script') or (@class = 'mid-script')) ]]
2570 ]" >
2571 <xsl:copy>
2572 <xsl:apply-templates select="@*" />
2573 <xsl:apply-templates select="
2574 ancestor::*[ preceding-sibling::* [
2575 ((@class = 'begin-script') or
2576 (@class = 'mid-script')) ]][1]
2577 / preceding-sibling::* [
2578 ((@class = 'begin-script') or
2579 (@class = 'mid-script')) ][1]
2580 " mode="script-copy" />
2581 </xsl:copy>
2582 </xsl:template>
2583 <xsl:template match="*|@*|text()|comment()"
2584 mode="script-copy" >
2585 <xsl:copy>
2586 <xsl:apply-templates select="*|@*|text()|comment()" />
2587 </xsl:copy>
2588 </xsl:template>
2589 <xsl:template match="span[
2590 (@class = 'begin-script') or
2591 (@class = 'mid-script') ]" mode="script-copy" >
2592 <xsl:apply-templates select="*|text()|comment()" />
2593 </xsl:template>
2594
2595 <xsl:template match="span[
2596 ((@class = 'begin-script') or (@class = 'mid-script'))
2597 and
2598 following-sibling::*
2599 / following-sibling::span[ @class = 'end-script' ]
2600 and
2601 following-sibling::*[1]
2602 / descendant-or-self::*[ not(self::PROS) ][1]
2603 / child::*[1][
2604 (@class = 'mrow-base')
2605 and
2606 (normalize-space(.)='')
2607 ]
2608 ]" >
2609 </xsl:template>
2610
2611 <xsl:template match="span[
2612 (@class = 'begin-script')
2613 and
2614 following-sibling::* [1] / child::*[
2615 (position() = 1)
2616 and
2617 (@class = 'mrow-base')
2618 and
2619 ( normalize-space(.) = '' )
2620 ]
2621 ]" >
2622 </xsl:template>
2623
2624
2625 <xsl:template match="*|@*|text()|comment()" >
2626 <xsl:copy>
2627 <xsl:apply-templates select="*|@*|text()|comment()" />
2628 </xsl:copy>
2629 </xsl:template>
2630 </xsl:stylesheet>
2631 ]]>
2632
2633 </set>
2634 <xslt name="." xml="." xsl="display-math-2" />
2635
2636 </script>
2637
2638 <script element="PARA" >
2639 <set name="apostro" >
2640 <![CDATA[
2641 <xsl:stylesheet version="1.0"
2642 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2643 >
2644 <xsl:output omit-xml-declaration = "yes" />
2645
2646 <xsl:template match="span[
2647 (@class = 'char-del')
2648 and child::span [ @class = 'ch 2019' ]
2649 ]" >
2650 <xsl:text>'</xsl:text>
2651 </xsl:template>
2652
2653 <xsl:template match="PROS[ parent::SENT[@class='ol-mark'] ]" >
2654 <xsl:copy>
2655 <xsl:apply-templates
2656 select="*[not(@class='char-del')]|@*|text()|comment()" />
2657 </xsl:copy>
2658 </xsl:template>
2659
2660 <xsl:template match=" PARA[ normalize-space(.) = '' ] " >
2661 </xsl:template>
2662
2663 <xsl:template match="*|@*|text()|comment()" >
2664 <xsl:copy>
2665 <xsl:apply-templates select="*|@*|text()|comment()" />
2666 </xsl:copy>
2667 </xsl:template>
2668 </xsl:stylesheet>
2669 ]]>
2670
2671 </set>
2672 <xslt name="." xml="." xsl="apostro" />
2673 </script>
2674
2675 <script element="div::split-side" >
2676 <set name="clean-split" >
2677 <![CDATA[
2678 <xsl:stylesheet version="1.0"
2679 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2680 >
2681 <xsl:output omit-xml-declaration = "yes" />
2682
2683 <xsl:template match="*" mode="content" >
2684 <xsl:choose>
2685 <xsl:when test=" @class = 'char' " >
2686 <xsl:if test="not( child::*[
2687 (@class = 'ch 2032') or (@class = 'ch 2033')
2688 or (@class = 'ch 2034')
2689 ] )">
2690 <xsl:text>x</xsl:text>
2691 </xsl:if>
2692 </xsl:when>
2693 <xsl:when test=" not(
2694 (@title = 'speech-extra') or (@class = 'accent-char')
2695 ) " >
2696 <xsl:apply-templates select="*|text()" mode="content" />
2697 </xsl:when>
2698 </xsl:choose>
2699 </xsl:template>
2700
2701 <xsl:template match=" div[ @class='split-side' ]
2702 " >
2703 <xsl:variable name="content">
2704 <xsl:apply-templates select="*" mode="content" />
2705 </xsl:variable>
2706 <xsl:if test="
2707 string-length( normalize-space( $content )) != 0
2708 " >
2709 <xsl:copy>
2710 <xsl:apply-templates select=" *|@*|text()|comment() " />
2711 </xsl:copy>
2712 </xsl:if>
2713 </xsl:template>
2714
2715 <xsl:template match="*|@*|text()|comment()" >
2716 <xsl:copy>
2717 <xsl:apply-templates select="*|@*|text()|comment()" />
2718 </xsl:copy>
2719 </xsl:template>
2720 </xsl:stylesheet>
2721 ]]>
2722
2723 </set>
2724 <xslt name="." xml="." xsl="clean-split" />
2725 </script>
2726
2727 <script element="div::newtheorem" >
2728 <set name="newtheorem" >
2729 <![CDATA[
2730 <xsl:stylesheet version="1.0"
2731 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2732 >
2733 <xsl:output omit-xml-declaration = "yes" />
2734
2735 <xsl:template match="
2736 div[ (@class='newtheorem')
2737 and
2738 descendant::*[ self::p ][1]
2739 / descendant::*[ self::span ][1]
2740 [ @class = 'theorem-head' ]
2741 ]
2742 " >
2743 <xsl:copy>
2744 <xsl:apply-templates select="*|@*|text()|comment()" />
2745 <div class="begin-end" title="speech-extra">
2746 <BREAK SIZE="small"/>
2747 <xsl:value-of select="
2748 concat( ' end ',
2749 substring-before(concat(
2750 normalize-space(
2751 string(
2752 descendant::*[ self::p ][1]
2753 / descendant::*[ self::span ][1]
2754 [ @class = 'theorem-head' ]
2755 ) )
2756 , ' '
2757 )
2758 , ' ')
2759 ) " />
2760 </div>
2761 </xsl:copy>
2762 </xsl:template>
2763
2764
2765 <xsl:template match="*|@*|text()|comment()" >
2766 <xsl:copy>
2767 <xsl:apply-templates select="*|@*|text()|comment()" />
2768 </xsl:copy>
2769 </xsl:template>
2770 </xsl:stylesheet>
2771 ]]>
2772
2773 </set>
2774 <xslt name="." xml="." xsl="newtheorem" />
2775 </script>
2776
2777 <script element="br" >
2778 <set name="br" >
2779 <![CDATA[
2780 <xsl:stylesheet version="1.0"
2781 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2782 >
2783 <xsl:output omit-xml-declaration = "yes" />
2784
2785 <xsl:template match="br" >
2786 <xsl:copy>
2787 <xsl:apply-templates select="@*" />
2788 </xsl:copy>
2789 <BREAK SIZE="small"/>
2790 </xsl:template>
2791
2792 <xsl:template match="*|@*|text()|comment()" >
2793 <xsl:copy>
2794 <xsl:apply-templates select="*|@*|text()|comment()" />
2795 </xsl:copy>
2796 </xsl:template>
2797 </xsl:stylesheet>
2798 ]]>
2799
2800 </set>
2801 <xslt name="." xml="." xsl="br" />
2802 </script>
2803
2804 <script element="BREAK" >
2805 <set name="BREAK" >
2806 <![CDATA[
2807 <xsl:stylesheet version="1.0"
2808 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2809 >
2810 <xsl:output omit-xml-declaration = "yes" />
2811
2812 <xsl:template match="BREAK" >
2813 <xsl:copy>
2814 <xsl:apply-templates select="@*" />
2815 </xsl:copy>
2816 </xsl:template>
2817
2818 <xsl:template match="*|@*|text()|comment()" >
2819 <xsl:copy>
2820 <xsl:apply-templates select="*|@*|text()|comment()" />
2821 </xsl:copy>
2822 </xsl:template>
2823 </xsl:stylesheet>
2824 ]]>
2825
2826 </set>
2827 <xslt name="." xml="." xsl="BREAK" />
2828 </script>
2829
2830 </sax>
2831 </xtpipes>
2832