--- mathmlc2p.xsl	2005-07-08 17:27:05.000000000 -0500
+++ mathmlc2p-11.xsl	2005-07-11 13:14:26.000000000 -0500
@@ -423,6 +423,11 @@
   <mrow><xsl:apply-templates select="*"/></mrow>
 </xsl:template>
 
+<!-- domain of application -->
+<xsl:template match="m:domainofapplication">
+  <mrow><xsl:apply-templates select="*"/></mrow>
+</xsl:template>
+
 <!-- declare -->
 <xsl:template match="m:declare">
 <!-- no rendering for declarations-->
@@ -623,6 +628,39 @@
   </mrow>
 </xsl:template>
 
+<!-- min with domainofapplication -->
+<xsl:template match="m:apply[*[1][self::m:min] and m:domainofapplication]">
+  <mrow>
+    <xsl:choose>
+      <xsl:when test="m:bvar"><!-- bvar and domain of application -->
+        <msub>
+          <munder>
+           <mi>min</mi>
+           <xsl:apply-templates select="m:domainofapplication"/>
+          </munder>
+          <mrow>
+            <xsl:for-each select="m:bvar[position()!=last()]"> <!--select every bvar except the last one (position() only counts bvars, not the other siblings)-->
+              <xsl:apply-templates select="."/><mo>,</mo>
+            </xsl:for-each>
+            <xsl:apply-templates select="m:bvar[position()=last()]"/>
+          </mrow>
+        </msub>
+      </xsl:when>
+      <xsl:otherwise>
+        <munder>
+          <mi>min</mi>
+          <xsl:apply-templates select="m:domainofapplication"/>
+        </munder>
+      </xsl:otherwise>
+    </xsl:choose>
+    <mo>{</mo>
+    <xsl:apply-templates select="*[not(self::m:condition or self::m:domainofapplication or self::m:bvar)]"/>
+    <xsl:if test="m:condition"><mo>|</mo><xsl:apply-templates select="m:condition"/></xsl:if>
+    <mo>}</mo>
+  </mrow>
+</xsl:template>
+
+
 <!-- max -->
 <xsl:template match="m:apply[*[1][self::m:max]]">
   <mrow>
@@ -657,6 +695,38 @@
   </mrow>
 </xsl:template>
 
+<!-- max with domainofapplication -->
+<xsl:template match="m:apply[*[1][self::m:max] and m:domainofapplication]">
+  <mrow>
+    <xsl:choose>
+      <xsl:when test="m:bvar"><!-- bvar and domain of application -->
+        <msub>
+          <munder>
+           <mi>max</mi>
+           <xsl:apply-templates select="m:domainofapplication"/>
+          </munder>
+          <mrow>
+            <xsl:for-each select="m:bvar[position()!=last()]"> <!--select every bvar except the last one (position() only counts bvars, not the other siblings)-->
+              <xsl:apply-templates select="."/><mo>,</mo>
+            </xsl:for-each>
+            <xsl:apply-templates select="m:bvar[position()=last()]"/>
+          </mrow>
+        </msub>
+      </xsl:when>
+      <xsl:otherwise>
+        <munder>
+          <mi>max</mi>
+          <xsl:apply-templates select="m:domainofapplication"/>
+        </munder>
+      </xsl:otherwise>
+    </xsl:choose>
+    <mo>{</mo>
+    <xsl:apply-templates select="*[not(self::m:condition or self::m:domainofapplication or self::m:bvar)]"/>
+    <xsl:if test="m:condition"><mo>|</mo><xsl:apply-templates select="m:condition"/></xsl:if>
+    <mo>}</mo>
+  </mrow>
+</xsl:template>
+
 <!-- substraction(minus); unary or binary operator-->
 <xsl:template match="m:apply[*[1][self::m:minus]]">
   <mrow>
@@ -1871,18 +1941,50 @@
 <xsl:template match="m:apply[*[1][self::m:sum]]">
 <mrow>
   <xsl:choose>
+  <xsl:when test="m:condition and m:domainofapplication"><!-- domainofapplication as well as condition -->
+    <munder>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
+      <mrow>
+        <munder>
+          <mrow><xsl:apply-templates select="m:domainofapplication"/></mrow>
+          <mrow><xsl:apply-templates select='m:condition'/></mrow>
+        </munder>
+      </mrow>
+    </munder>
+  </xsl:when>	
+  <xsl:when test="m:condition and m:lowlimit and m:uplimit"><!-- uplimit and lowlimit as well as condition -->
+    <munderover>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
+      <mrow>
+        <munder>
+          <mrow><xsl:apply-templates select="m:bvar"/><mo>=</mo><xsl:apply-templates select="m:lowlimit"/></mrow>
+	  <mrow><xsl:apply-templates select='m:condition'/></mrow>
+        </munder>
+      </mrow>
+      <mrow><xsl:apply-templates select="m:uplimit"/></mrow>
+    </munderover>
+  </xsl:when>    
   <xsl:when test="m:condition">  <!-- domain specified by a condition -->
     <munder>
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
       <xsl:apply-templates select="m:condition"/>
     </munder>
   </xsl:when>
-  <xsl:otherwise>  <!-- domain specified by low and up limits -->
+  <xsl:when test="m:domainofapplication">  <!-- domain specified by domain of application -->
+    <munder>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
+      <xsl:apply-templates select="m:domainofapplication"/>
+    </munder>
+  </xsl:when>
+  <xsl:when test="m:lowlimit and m:uplimit">  <!-- domain specified by low and up limits -->
     <munderover>
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
       <mrow><xsl:apply-templates select="m:bvar"/><mo>=</mo><xsl:apply-templates select="m:lowlimit"/></mrow>
       <mrow><xsl:apply-templates select="m:uplimit"/></mrow>
     </munderover>
+  </xsl:when>
+  <xsl:otherwise>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Sum;]]></xsl:text></mo>
   </xsl:otherwise>
   </xsl:choose>
   <xsl:choose>
@@ -1900,12 +2002,41 @@
 <xsl:template match="m:apply[*[1][self::m:product]]">
 <mrow>
   <xsl:choose>
+  <xsl:when test="m:condition and m:domainofapplication"><!-- domainofapplication as well as condition -->
+    <munder>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Product;]]></xsl:text></mo>
+      <mrow>
+        <munder>
+          <mrow><xsl:apply-templates select="m:domainofapplication"/></mrow>
+          <mrow><xsl:apply-templates select='m:condition'/></mrow>
+        </munder>
+      </mrow>
+    </munder>
+  </xsl:when>	
+  <xsl:when test="m:condition and m:lowlimit and m:uplimit"><!-- uplimit and lowlimit as well as condition -->
+    <munderover>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Product;]]></xsl:text></mo>
+      <mrow>
+        <munder>
+          <mrow><xsl:apply-templates select="m:bvar"/><mo>=</mo><xsl:apply-templates select="m:lowlimit"/></mrow>
+          <mrow><xsl:apply-templates select='m:condition'/></mrow>
+        </munder>
+      </mrow>
+      <mrow><xsl:apply-templates select="m:uplimit"/></mrow>
+    </munderover>
+  </xsl:when>  
   <xsl:when test="m:condition">   <!-- domain specified by a condition -->
     <munder>
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Product;]]></xsl:text></mo>
       <xsl:apply-templates select="m:condition"/>
     </munder>
   </xsl:when>
+  <xsl:when test="m:domainofapplication"> <!--domain specified by a domain -->
+    <munder>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Product;]]></xsl:text></mo>
+      <xsl:apply-templates select="m:domainofapplication"/>
+    </munder>
+  </xsl:when>
   <xsl:otherwise>  <!-- domain specified by low and up limits -->
     <munderover>
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Product;]]></xsl:text></mo>

