Debian Codegraph @

texmf-dist/tex4ht/xtpipes/oo-math.4xt

raw
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" >
3 <xtpipes preamble="yes" signature="oo-math.4xt (2009-03-11-03:09)">
4 <sax content-handler="xtpipes.util.ScriptsManager,tex4ht.OomFilter"
5 lexical-handler="xtpipes.util.ScriptsManagerLH" >
6 <script element="math:mtable" >
7 <dom name="." xml="." method="mtable" class="tex4ht.OoUtilities" />
8
9 </script>
10 <script element="math:math" >
11 <set name="math:mo" >
12 <![CDATA[
13 <xsl:stylesheet version="1.0"
14 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
15 xmlns:math="http://www.w3.org/1998/Math/MathML"
16 xmlns:xlink="http://www.w3.org/1999/xlink"
17 >
18 <xsl:output omit-xml-declaration = "yes" />
19
20 <xsl:template match=" math:mo" >
21 <xsl:choose>
22 <xsl:when test="
23 (preceding-sibling::math:mn or preceding-sibling::math:mi)
24 and not(following-sibling::*)
25 " >
26 <math:mtext>
27 <xsl:apply-templates select="*|@*|text()" />
28 </math:mtext>
29 </xsl:when>
30 <xsl:when test="
31 not((preceding-sibling::*) or following-sibling::*)
32 " >
33 <math:mtext>
34 <xsl:apply-templates select="*|@*|text()" />
35 </math:mtext>
36 </xsl:when>
37 <xsl:when test="
38 (.='{') or (.='}')
39 " >
40 <math:mtext>
41 <xsl:apply-templates select="*|@*|text()" />
42 </math:mtext>
43 </xsl:when>
44 <xsl:when test=" . = '='" >
45 <xsl:choose>
46 <xsl:when test=" not(preceding-sibling::*)
47 or not(following-sibling::*)
48 or preceding-sibling::*[1] / self::math:mo
49 ">
50 <math:mtext>
51 <xsl:apply-templates select="*|@*|text()" />
52 </math:mtext>
53 </xsl:when>
54 <xsl:otherwise>
55 <math:mo>
56 <xsl:apply-templates select="*|@*|text()" />
57 </math:mo>
58 </xsl:otherwise>
59 </xsl:choose>
60
61 </xsl:when>
62
63 <xsl:when test=" string-length() &gt; 1 " >
64 <math:mtext>
65 <xsl:value-of select="normalize-space(.)" />
66 </math:mtext>
67 </xsl:when>
68
69 <xsl:otherwise>
70 <math:mo>
71 <xsl:apply-templates select="@*" />
72 <xsl:value-of select="normalize-space(.)" />
73 </math:mo>
74 </xsl:otherwise>
75 </xsl:choose>
76 </xsl:template>
77 <xsl:template match="*|@*|text()|comment()" >
78 <xsl:copy>
79 <xsl:apply-templates select="*|@*|text()|comment()" />
80 </xsl:copy>
81 </xsl:template>
82 </xsl:stylesheet>
83 ]]>
84
85 </set>
86 <xslt name="." xml="." xsl="math:mo" />
87
88
89 <set name="math:mspace" >
90 <![CDATA[
91 <xsl:stylesheet version="1.0"
92 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
93 xmlns:math="http://www.w3.org/1998/Math/MathML"
94 xmlns:xlink="http://www.w3.org/1999/xlink"
95 >
96 <xsl:output omit-xml-declaration = "yes" />
97
98 <xsl:template match="math:mspace" >
99 <math:mtext>
100 <xsl:text> </xsl:text>
101 </math:mtext>
102 </xsl:template>
103
104 <xsl:template match="*|@*|text()|comment()" >
105 <xsl:copy>
106 <xsl:apply-templates select="*|@*|text()|comment()" />
107 </xsl:copy>
108 </xsl:template>
109 </xsl:stylesheet>
110 ]]>
111
112 </set>
113 <xslt name="." xml="." xsl="math:mspace" />
114
115 </script>
116 </sax>
117 </xtpipes>
118