3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!--***********************************************************************-->
28 <!-- Notational extensions to the XSLT version 0.07 of MathML content -->
29 <!-- to presentation: -->
30 <!-- First draft: February 19 2000, Andrea Asperti, Irene Schena -->
31 <!-- Revised: March 3 2000, Irene Schena -->
32 <!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena -->
33 <!-- Revised: March 21 2000, Irene Schena -->
34 <!--***********************************************************************-->
36 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
37 xmlns:m="http://www.w3.org/1998/Math/MathML">
39 <xsl:import href="mmlctop.xsl-0.14"/>
42 <!-- *********************************** -->
43 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
44 <!-- *********************************** -->
48 <xsl:template match = "m:apply[m:eq[1]]">
49 <xsl:variable name="charlength">
50 <xsl:apply-templates select="*[1]" mode="charcount"/>
53 <xsl:when test="$charlength >= $framewidth">
54 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
56 <xsl:attribute name="xref">
57 <xsl:value-of select="@id"/>
63 <m:mo stretchy="false">(</m:mo>
64 <xsl:apply-templates select="*[position()=2]"/>
68 <xsl:for-each select = "*[position()>2]">
72 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
74 <xsl:if test="m:in/@id">
75 <xsl:attribute name="xref">
76 <xsl:value-of select="m:in/@id"/>
79 <xsl:apply-templates select="."/>
87 <m:mo stretchy="false">)</m:mo>
100 <xsl:template match = "m:apply[m:and[1]|m:or[1]
101 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
102 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
103 |m:prsubset|m:setdiff[1]]">
104 <xsl:variable name="symbol">
106 <xsl:when test="m:and[1]">
107 <xsl:value-of select="'∧'"/>
109 <xsl:when test="m:or[1]">
110 <xsl:value-of select="'∨'"/>
112 <xsl:when test="m:geq[1]">
113 <xsl:value-of select="'≥'"/>
115 <xsl:when test="m:leq[1]">
116 <xsl:value-of select="'≤'"/>
118 <xsl:when test="m:gt[1]">
119 <xsl:value-of select="'>'"/>
121 <xsl:when test="m:lt[1]">
122 <xsl:value-of select="'< '"/>
124 <xsl:when test="m:eq[1]">
125 <xsl:value-of select="'='"/>
127 <xsl:when test="m:in[1]">
128 <xsl:value-of select="'∈'"/>
130 <xsl:when test="m:subset[1]">
131 <xsl:value-of select="'⊆'"/>
133 <xsl:when test="m:prsubset[1]">
134 <xsl:value-of select="'⊂'"/>
136 <xsl:when test="m:intersect[1]">
137 <xsl:value-of select="'⋂'"/>
139 <xsl:when test="m:union[1]">
140 <xsl:value-of select="'⋃'"/>
142 <xsl:when test="m:setdiff[1]">
143 <xsl:value-of select="'∖'"/>
147 <xsl:variable name="charlength">
148 <xsl:apply-templates select="*[1]" mode="charcount"/>
151 <xsl:when test="$charlength >= $framewidth">
152 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
154 <xsl:attribute name="xref">
155 <xsl:value-of select="@id"/>
161 <m:mo stretchy="false">(</m:mo>
162 <xsl:apply-templates select="*[position()=2]"/>
166 <xsl:for-each select = "*[position()>2]">
170 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
172 <xsl:if test="*[1]/@id">
173 <xsl:attribute name="xref">
174 <xsl:value-of select="*[1]/@id"/>
176 </xsl:if><xsl:value-of select="$symbol"/></m:mo>
177 <xsl:apply-templates select="."/>
185 <m:mo stretchy="false">)</m:mo>
197 <xsl:template match = "m:set">
199 <xsl:when test="count(child::*) = 0">
202 <xsl:attribute name="xref">
203 <xsl:value-of select="@id"/>
205 </xsl:if>∅</m:mi>
208 <xsl:variable name="charlength">
209 <xsl:apply-templates select="*[1]" mode="charcount"/>
212 <xsl:when test="$charlength >= $framewidth">
214 <xsl:when test="name(*[1]) = 'm:bvar'">
215 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
219 <m:mo stretchy="false">
221 <xsl:attribute name="xref">
222 <xsl:value-of select="@id"/>
225 <xsl:apply-templates select="*[position()=1]"/>
232 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
233 <m:mo stretchy="false">|</m:mo>
234 <xsl:apply-templates select="m:condition/*[1]"/>
241 <m:mo stretchy="false">
243 <xsl:attribute name="xref">
244 <xsl:value-of select="@id"/>
253 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
257 <m:mo stretchy="false">
259 <xsl:attribute name="xref">
260 <xsl:value-of select="@id"/>
263 <xsl:apply-templates select="*[position()=1]"/>
264 <xsl:if test="position() != last()">
270 <xsl:for-each select = "*[position()>2]">
274 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
275 <xsl:apply-templates select="."/>
276 <xsl:if test="position() != last()">
286 <m:mo stretchy="false">
288 <xsl:attribute name="xref">
289 <xsl:value-of select="@id"/>
307 <xsl:template match = "m:apply[m:card[1]]">
308 <m:mfenced open="|" close="|" stretchy="false">
309 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
310 <xsl:attribute name="xref">
311 <xsl:value-of select="@id"/>
314 <xsl:apply-templates select="*[2]"/>
319 <xsl:template match = "m:eq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:neq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:lt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:gt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:leq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:geq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))]">
321 <xsl:when test="local-name(.) = 'neq'">
322 <xsl:value-of select="'≠'"/>
324 <xsl:when test="local-name(.) = 'lt'">
325 <xsl:value-of select="'< '"/>
327 <xsl:when test="local-name(.) = 'gt'">
328 <xsl:value-of select="'>'"/>
330 <xsl:when test="local-name(.) = 'leq'">
331 <xsl:value-of select="'≤'"/>
333 <xsl:when test="local-name(.) = 'geq'">
334 <xsl:value-of select="'≥'"/>
337 <xsl:value-of select="'='"/>