-<!-- *********************************** -->
-<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
-<!-- *********************************** -->
-
-<!-- Logic -->
-
-<xsl:template match = "m:apply[m:eq[1]]">
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mo>
- <xsl:if test="m:in/@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="m:in/@id"/>
- </xsl:attribute>
- </xsl:if>=</m:mo>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<xsl:template match = "m:apply[m:and[1]|m:or[1]
- |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
- |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
- |m:prsubset|m:setdiff[1]]">
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:and[1]">
- <xsl:value-of select="'∧'"/>
- </xsl:when>
- <xsl:when test="m:or[1]">
- <xsl:value-of select="'∨'"/>
- </xsl:when>
- <xsl:when test="m:geq[1]">
- <xsl:value-of select="'≥'"/>
- </xsl:when>
- <xsl:when test="m:leq[1]">
- <xsl:value-of select="'≤'"/>
- </xsl:when>
- <xsl:when test="m:gt[1]">
- <xsl:value-of select="'>'"/>
- </xsl:when>
- <xsl:when test="m:lt[1]">
- <xsl:value-of select="'< '"/>
- </xsl:when>
- <xsl:when test="m:eq[1]">
- <xsl:value-of select="'='"/>
- </xsl:when>
- <xsl:when test="m:in[1]">
- <xsl:value-of select="'∈'"/>
- </xsl:when>
- <xsl:when test="m:subset[1]">
- <xsl:value-of select="'⊆'"/>
- </xsl:when>
- <xsl:when test="m:prsubset[1]">
- <xsl:value-of select="'⊂'"/>
- </xsl:when>
- <xsl:when test="m:intersect[1]">
- <xsl:value-of select="'⋂'"/>
- </xsl:when>
- <xsl:when test="m:union[1]">
- <xsl:value-of select="'⋃'"/>
- </xsl:when>
- <xsl:when test="m:setdiff[1]">
- <xsl:value-of select="'∖'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mo>
- <xsl:if test="*[1]/@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:value-of select="$symbol"/></m:mo>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:set">
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <m:mi>
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>∅</m:mi>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>{</m:mo>
- <xsl:apply-templates select="*[position()=1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
- <m:mo stretchy="false">|</m:mo>
- <xsl:apply-templates select="m:condition/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>{</m:mo>
- <xsl:apply-templates select="*[position()=1]"/>
- <xsl:if test="position() != last()">
- <mo>,</mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- <xsl:if test="position() != last()">
- <mo>,</mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:card[1]]">
- <m:mfenced open="|" close="|" stretchy="false">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]"/>
- </m:mfenced>
-</xsl:template>
-