--- mathmlc2p.xsl	2005-07-05 11:33:44.000000000 -0500
+++ mathmlc2p-1.xsl	2005-07-05 13:58:45.000000000 -0500
@@ -190,7 +190,7 @@
     <xsl:choose>
     <xsl:when test="count(node()) != count(text())">
       <!--test if children are not all text nodes, meaning there is markup assumed to be presentation markup-->
-	<mrow><xsl:copy-of select="child::*"/></mrow>
+	<mrow><xsl:copy-of select="*"/></mrow>
     </xsl:when>
     <xsl:otherwise>  <!-- common case -->
       <mi><xsl:value-of select="."/></mi>
@@ -201,11 +201,11 @@
 </xsl:template>
 
 <!-- externally defined symbols-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='csymbol']]">
+<xsl:template match="m:apply[*[position()=1 and name()='csymbol']]">
   <mrow>
   <xsl:apply-templates select="m:csymbol[position()=1]"/>
   <mfenced>
-  <xsl:for-each select="child::*[position()!=1]">
+  <xsl:for-each select="*[position()!=1]">
     <xsl:apply-templates select="."/>
   </xsl:for-each>
   </mfenced>
@@ -217,7 +217,7 @@
   <!--test if children are not all text nodes, meaning there is markup assumed to be presentation markup-->
   <!--perhaps it would be sufficient to test if there is more than one node or text node-->
   <xsl:when test="count(node()) != count(text())"> 
-    <mrow><xsl:copy-of select="child::*"/></mrow>
+    <mrow><xsl:copy-of select="*"/></mrow>
   </xsl:when>
   <xsl:otherwise>
     <mo><xsl:value-of select="."/></mo>
@@ -232,22 +232,22 @@
 <!-- #################### 4.4.2 #################### -->
 
 <!-- apply/apply -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='apply']]">  <!-- when the function itself is defined by other functions: (F+G)(x) -->
+<xsl:template match="m:apply[*[position()=1 and name()='apply']]">  <!-- when the function itself is defined by other functions: (F+G)(x) -->
   <xsl:choose>
-  <xsl:when test="count(child::*)>=2">
+  <xsl:when test="count(*)>=2">
     <mrow>
-      <mfenced separators=""><xsl:apply-templates select="child::*[position()=1]"/></mfenced>
-      <mfenced><xsl:apply-templates select="child::*[position()!=1]"/></mfenced>
+      <mfenced separators=""><xsl:apply-templates select="*[position()=1]"/></mfenced>
+      <mfenced><xsl:apply-templates select="*[position()!=1]"/></mfenced>
     </mrow>
   </xsl:when>
   <xsl:otherwise> <!-- apply only contains apply, no operand-->
-    <mfenced separators=""><xsl:apply-templates select="child::*"/></mfenced>
+    <mfenced separators=""><xsl:apply-templates select="*"/></mfenced>
   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
 <!-- force function or operator MathML 1.0 deprecated-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='fn']]">
+<xsl:template match="m:apply[*[position()=1 and name()='fn']]">
 <mrow>
   <xsl:choose>
     <xsl:when test="name(m:fn/*[position()=1])='apply'"> <!-- fn definition is complex, surround with brackets, but only one child-->
@@ -267,7 +267,7 @@
 </xsl:template>
 
 <!--first ci is supposed to be a function-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='ci']]">
+<xsl:template match="m:apply[*[position()=1 and name()='ci']]">
 <mrow>
   <xsl:apply-templates select="m:ci[position()=1]"/>
   <xsl:if test="count(*)>1">  <!-- if no operands, don't put empty parentheses-->
@@ -279,19 +279,19 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='mo']]">
+<xsl:template match="m:apply[*[position()=1 and name()='mo']]">
   <!--operator assumed to be infix-->
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+      <xsl:for-each select="*[position()!=last() and  position()!=1]">
         <xsl:apply-templates select="."/><xsl:copy-of select="preceding-sibling::m:mo"/>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()!=1 and position()=last()]"/>
+      <xsl:apply-templates select="*[position()!=1 and position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
-    <mrow><xsl:copy-of select="child::m:mo[position()=1]/*"/><xsl:apply-templates select="child::*[position()=2]"/></mrow>
+  <xsl:when test="count(*)=2">
+    <mrow><xsl:copy-of select="m:mo[position()=1]/*"/><xsl:apply-templates select="*[position()=2]"/></mrow>
   </xsl:when>
   </xsl:choose>
 </xsl:template>
@@ -304,32 +304,32 @@
       <xsl:choose>
         <xsl:when test="@closure and @closure='open-closed'">
 	  <mfenced open="(" close="]">
-	    <xsl:apply-templates select="child::*[position()=1]"/>
-	    <xsl:apply-templates select="child::*[position()=2]"/>
+	    <xsl:apply-templates select="*[position()=1]"/>
+	    <xsl:apply-templates select="*[position()=2]"/>
 	  </mfenced>
 	</xsl:when>
         <xsl:when test="@closure and @closure='closed-open'">
 	  <mfenced open="[" close=")">
-	    <xsl:apply-templates select="child::*[position()=1]"/>
-	    <xsl:apply-templates select="child::*[position()=2]"/>
+	    <xsl:apply-templates select="*[position()=1]"/>
+	    <xsl:apply-templates select="*[position()=2]"/>
 	  </mfenced>
 	</xsl:when>
         <xsl:when test="@closure and @closure='closed'">
 	  <mfenced open="[" close="]">
-	    <xsl:apply-templates select="child::*[position()=1]"/>
-	    <xsl:apply-templates select="child::*[position()=2]"/>
+	    <xsl:apply-templates select="*[position()=1]"/>
+	    <xsl:apply-templates select="*[position()=2]"/>
 	  </mfenced>
 	</xsl:when>
         <xsl:when test="@closure and @closure='open'">
 	  <mfenced open="(" close=")">
-	    <xsl:apply-templates select="child::*[position()=1]"/>
-	    <xsl:apply-templates select="child::*[position()=2]"/>
+	    <xsl:apply-templates select="*[position()=1]"/>
+	    <xsl:apply-templates select="*[position()=2]"/>
 	  </mfenced>
 	</xsl:when>
 	<xsl:otherwise>  <!--default is close-->
 	  <mfenced open="[" close="]">
-	    <xsl:apply-templates select="child::*[position()=1]"/>
-	    <xsl:apply-templates select="child::*[position()=2]"/>
+	    <xsl:apply-templates select="*[position()=1]"/>
+	    <xsl:apply-templates select="*[position()=2]"/>
 	  </mfenced>
 	</xsl:otherwise>
       </xsl:choose>
@@ -341,7 +341,7 @@
 </xsl:template>
 
 <!-- inverse -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='apply']/m:inverse]">
+<xsl:template match="m:apply[*[position()=1 and name()='apply']/m:inverse]">
   <mrow>
   <msup> <!-- elementary classical functions have two templates: apply[func] for standard case, func[position()!=1] for inverse and compose case-->
     <mrow><xsl:apply-templates select="m:apply[position()=1]/*[position()=2]"/></mrow> <!-- function to be inversed-->
@@ -356,7 +356,7 @@
   </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='inverse']]">
+<xsl:template match="m:apply[*[position()=1 and name()='inverse']]">
   <msup> <!-- elementary classical functions have two templates: apply[func] for standard case, func[position()!=1] for inverse and compose case-->
     <mrow><xsl:apply-templates select="*[position()=2]"/></mrow> <!-- function to be inversed-->
     <mfenced><mn>-1</mn></mfenced>
@@ -388,7 +388,7 @@
 </xsl:template>
 
 <!-- composition -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='apply']/m:compose]">
+<xsl:template match="m:apply[*[position()=1 and name()='apply']/m:compose]">
   <mrow> <!-- elementary classical functions have two templates: apply[func] for standard case, func[position()!=1] for inverse and compose case-->
     <xsl:choose>
     <xsl:when test="count(*)>=2"> <!-- if there are operands, mfence functions-->
@@ -420,7 +420,7 @@
   </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='compose']]">
+<xsl:template match="m:apply[*[position()=1 and name()='compose']]">
    <!-- elementary classical functions have two templates: apply[func] for standard case, func[position()!=1] for inverse and compose case-->
   <xsl:for-each select="*[position()!=1 and position()!=last()]">
     <xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&SmallCircle;]]></xsl:text></mo> <!-- compose functions --><!-- does not work, perhaps compfn, UNICODE 02218-->
@@ -434,21 +434,21 @@
 </xsl:template>
 
 <!-- domain -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='domain']]">
+<xsl:template match="m:apply[*[position()=1 and name()='domain']]">
   <mrow>
     <mi>domain</mi><mfenced open="(" close=")"><xsl:apply-templates select="*[position()!=1]"/></mfenced>
   </mrow>
 </xsl:template>
 
 <!-- codomain -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='codomain']]">
+<xsl:template match="m:apply[*[position()=1 and name()='codomain']]">
   <mrow>
     <mi>codomain</mi><mfenced open="(" close=")"><xsl:apply-templates select="*[position()!=1]"/></mfenced>
   </mrow>
 </xsl:template>
 
 <!-- image -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='image']]">
+<xsl:template match="m:apply[*[position()=1 and name()='image']]">
   <mrow>
     <mi>image</mi><mfenced open="(" close=")"><xsl:apply-templates select="*[position()!=1]"/></mfenced>
   </mrow>
@@ -477,12 +477,12 @@
 <!-- #################### 4.4.3 #################### -->
 
 <!-- quotient -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='quotient']]">
+<xsl:template match="m:apply[*[position()=1 and name()='quotient']]">
   <mrow>  <!-- the third notation uses UNICODE chars x0230A and x0230B -->
     <mo>integer part of</mo>
     <mrow>
       <xsl:choose> <!-- surround with brackets if operands are composed-->
-      <xsl:when test="child::*[position()=2] and name()='apply'">
+      <xsl:when test="*[position()=2] and name()='apply'">
         <mfenced separators=""><xsl:apply-templates select="*[position()=2]"/></mfenced>
       </xsl:when>
       <xsl:otherwise>
@@ -491,7 +491,7 @@
       </xsl:choose>
       <mo>/</mo>
       <xsl:choose>
-      <xsl:when test="child::*[position()=3] and name()='apply'">
+      <xsl:when test="*[position()=3] and name()='apply'">
         <mfenced separators=""><xsl:apply-templates select="*[position()=3]"/></mfenced>
       </xsl:when>
       <xsl:otherwise>
@@ -503,7 +503,7 @@
 </xsl:template>
 
 <!-- factorial -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='factorial']]">
+<xsl:template match="m:apply[*[position()=1 and name()='factorial']]">
   <mrow>
     <xsl:choose> <!-- surround with brackets if operand is composed-->
     <xsl:when test="name(*[position()=2])='apply'">
@@ -518,19 +518,19 @@
 </xsl:template>
 
 <!-- divide -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='divide']]">
+<xsl:template match="m:apply[*[position()=1 and name()='divide']]">
   <mrow>
     <xsl:choose>
     <xsl:when test="contains(@other,'scriptstyle')">
       <mfrac bevelled="true">
-        <xsl:apply-templates select="child::*[position()=2]"/>
-        <xsl:apply-templates select="child::*[position()=3]"/>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:apply-templates select="*[position()=3]"/>
       </mfrac>
     </xsl:when>
     <xsl:otherwise>
       <mfrac>
-        <xsl:apply-templates select="child::*[position()=2]"/>
-        <xsl:apply-templates select="child::*[position()=3]"/>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:apply-templates select="*[position()=3]"/>
       </mfrac>
     </xsl:otherwise>
     </xsl:choose>
@@ -538,7 +538,7 @@
 </xsl:template>
 
 <!-- min -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='min']]">
+<xsl:template match="m:apply[*[position()=1 and name()='min']]">
   <mrow>
     <xsl:choose>
     <xsl:when test="m:bvar"> <!-- if there are bvars-->
@@ -572,7 +572,7 @@
 </xsl:template>
 
 <!-- max -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='max']]">
+<xsl:template match="m:apply[*[position()=1 and name()='max']]">
   <mrow>
     <xsl:choose>
     <xsl:when test="m:bvar"> <!-- if there are bvars-->
@@ -606,11 +606,11 @@
 </xsl:template>
 
 <!-- substraction(minus); unary or binary operator-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='minus']]">
+<xsl:template match="m:apply[*[position()=1 and name()='minus']]">
   <mrow>
   <xsl:choose> <!-- binary -->
-  <xsl:when test="count(child::*)=3">
-    <xsl:apply-templates select="child::*[position()=2]"/>
+  <xsl:when test="count(*)=3">
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo>-</mo>
     <xsl:choose>
       <xsl:when test="((name(*[position()=3])='ci' or name(*[position()=3])='cn') and contains(*[position()=3]/text(),'-')) or (name(*[position()=3])='apply')">
@@ -626,11 +626,11 @@
     <xsl:choose>
     <xsl:when test="((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-')) or (name(*[position()=2])='apply')">
       <mfenced separators=""><!-- surround negative or complex things with brackets -->
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
       </mfenced>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </xsl:otherwise>
     </xsl:choose>
   </xsl:otherwise>
@@ -639,9 +639,9 @@
 </xsl:template>
 
 <!-- addition -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='plus']]">
+<xsl:template match="m:apply[*[position()=1 and name()='plus']]">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
       <xsl:choose>
         <xsl:when test="((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-')) or (*[position()=2 and self::m:apply and child::m:minus])">
@@ -651,7 +651,7 @@
           <xsl:apply-templates select="*[position()=2]"/>
         </xsl:otherwise>
       </xsl:choose>
-      <xsl:for-each select="child::*[position()!=1 and position()!=2]">
+      <xsl:for-each select="*[position()!=1 and position()!=2]">
         <xsl:choose>
         <xsl:when test="((name(.)='ci' or name(.)='cn') and contains(./text(),'-')) or (self::m:apply and child::m:minus)"> <!-- surround negative things with brackets -->
           <mo>+</mo><mfenced separators=""><xsl:apply-templates select="."/></mfenced>
@@ -663,9 +663,9 @@
       </xsl:for-each>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo>+</mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo>+</mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -675,22 +675,22 @@
 </xsl:template>
 
 <!-- power -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='power']]">
+<xsl:template match="m:apply[*[position()=1 and name()='power']]">
   <msup>
     <xsl:choose>
     <xsl:when test="name(*[position()=2])='apply'">
-      <mfenced separators=""><xsl:apply-templates select="child::*[position()=2]"/></mfenced>
+      <mfenced separators=""><xsl:apply-templates select="*[position()=2]"/></mfenced>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </xsl:otherwise>
     </xsl:choose>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </msup>
 </xsl:template>
 
 <!-- remainder -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='rem']]">
+<xsl:template match="m:apply[*[position()=1 and name()='rem']]">
   <mrow>
     <xsl:choose> <!-- surround with brackets if operands are composed-->
     <xsl:when test="name(*[position()=2])='apply'">
@@ -713,11 +713,11 @@
 </xsl:template>
 
 <!-- multiplication -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='times']]">
+<xsl:template match="m:apply[*[position()=1 and name()='times']]">
 <xsl:choose>
-<xsl:when test="count(child::*)>=3">
+<xsl:when test="count(*)>=3">
   <mrow>
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:choose>
       <xsl:when test="m:plus"> <!--add brackets around + children for priority purpose-->
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced><mo><xsl:text disable-output-escaping="yes"><![CDATA[&InvisibleTimes;]]></xsl:text></mo>
@@ -733,7 +733,7 @@
       </xsl:otherwise>
       </xsl:choose>
     </xsl:for-each>
-    <xsl:for-each select="child::*[position()=last()]">
+    <xsl:for-each select="*[position()=last()]">
       <xsl:choose>
       <xsl:when test="m:plus">
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced>
@@ -751,7 +751,7 @@
     </xsl:for-each>
   </mrow>
 </xsl:when>
-<xsl:when test="count(child::*)=2">  <!-- unary -->
+<xsl:when test="count(*)=2">  <!-- unary -->
   <mrow>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&InvisibleTimes;]]></xsl:text></mo>
     <xsl:choose>
@@ -777,18 +777,18 @@
 </xsl:template>
 
 <!-- root -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='root']]">
+<xsl:template match="m:apply[*[position()=1 and name()='root']]">
   <xsl:choose>
   <xsl:when test="m:degree">
     <xsl:choose>
     <xsl:when test="m:degree/m:cn/text()='2'"> <!--if degree=2 display a standard square root-->
       <msqrt>
-        <xsl:apply-templates select="child::*[position()=3]"/>
+        <xsl:apply-templates select="*[position()=3]"/>
       </msqrt>
     </xsl:when>
     <xsl:otherwise>
       <mroot>
-        <xsl:apply-templates select="child::*[position()=3]"/>
+        <xsl:apply-templates select="*[position()=3]"/>
         <mrow><xsl:apply-templates select="m:degree/*"/></mrow>
       </mroot>
     </xsl:otherwise>
@@ -796,28 +796,28 @@
   </xsl:when>
   <xsl:otherwise> <!-- no degree specified-->
     <msqrt>
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </msqrt>
   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
 <!-- greatest common divisor -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='gcd']]">
+<xsl:template match="m:apply[*[position()=1 and name()='gcd']]">
   <mrow>
     <mi>gcd</mi><mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo>
     <mfenced>
-      <xsl:apply-templates select="child::*[position()!=1]"/>
+      <xsl:apply-templates select="*[position()!=1]"/>
     </mfenced>
   </mrow>
 </xsl:template>
 
 <!-- AND -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='and']]">
+<xsl:template match="m:apply[*[position()=1 and name()='and']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3"> <!-- at least two operands (common case)-->
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:choose>
       <xsl:when test="m:or"> <!--add brackets around OR children for priority purpose-->
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced><mo><xsl:text disable-output-escaping="yes"><![CDATA[&And;]]></xsl:text></mo>
@@ -830,7 +830,7 @@
       </xsl:otherwise>
       </xsl:choose>
     </xsl:for-each>
-    <xsl:for-each select="child::*[position()=last()]">
+    <xsl:for-each select="*[position()=last()]">
       <xsl:choose>
       <xsl:when test="m:or">
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced>
@@ -855,14 +855,14 @@
 </xsl:template>
 
 <!-- OR -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='or']]">
+<xsl:template match="m:apply[*[position()=1 and name()='or']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&Or;]]></xsl:text></mo>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
     </xsl:when>
     <xsl:when test="count(*)=2">
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Or;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -875,14 +875,14 @@
 </xsl:template>
 
 <!-- XOR -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='xor']]">
+<xsl:template match="m:apply[*[position()=1 and name()='xor']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:apply-templates select="."/><mo>xor</mo>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
     </xsl:when>
     <xsl:when test="count(*)=2">
       <mo>xor</mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -895,41 +895,41 @@
 </xsl:template>
 
 <!-- NOT -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='not']]">
+<xsl:template match="m:apply[*[position()=1 and name()='not']]">
   <mrow>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Not;]]></xsl:text></mo>
     <xsl:choose>
-    <xsl:when test="child::m:apply"><!--add brackets around OR,AND,XOR children for priority purpose-->
+    <xsl:when test="m:apply"><!--add brackets around OR,AND,XOR children for priority purpose-->
       <mfenced separators="">
-        <xsl:apply-templates select="child::*[position()=2]"/>
+        <xsl:apply-templates select="*[position()=2]"/>
       </mfenced>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </xsl:otherwise>
     </xsl:choose>
   </mrow>
 </xsl:template>
 
 <!-- implies -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='implies']]">
+<xsl:template match="m:apply[*[position()=1 and name()='implies']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&DoubleRightArrow;]]></xsl:text></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='implies']]">
+<xsl:template match="m:reln[*[position()=1 and name()='implies']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&DoubleRightArrow;]]></xsl:text></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
 <!-- for all-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='forall']]">
+<xsl:template match="m:apply[*[position()=1 and name()='forall']]">
   <mrow>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&ForAll;]]></xsl:text></mo>
     <mrow>
@@ -953,7 +953,7 @@
 </xsl:template>
 
 <!-- exist-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='exists']]">
+<xsl:template match="m:apply[*[position()=1 and name()='exists']]">
   <mrow>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Exists;]]></xsl:text></mo>
     <mrow>
@@ -977,61 +977,61 @@
 </xsl:template>
 
 <!-- absolute value -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='abs']]">
-  <mrow><mo>|</mo><xsl:apply-templates select="child::*[position()=last()]"/><mo>|</mo></mrow>
+<xsl:template match="m:apply[*[position()=1 and name()='abs']]">
+  <mrow><mo>|</mo><xsl:apply-templates select="*[position()=last()]"/><mo>|</mo></mrow>
 </xsl:template>
 
 <!-- conjugate -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='conjugate']]">
+<xsl:template match="m:apply[*[position()=1 and name()='conjugate']]">
   <mover>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&ovbar;]]></xsl:text></mo>  <!-- does not work, UNICODE x0233D  or perhaps OverBar-->
   </mover>
 </xsl:template>
 
 <!-- argument of complex number -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arg']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arg']]">
   <mrow>
-    <mi>arg</mi><mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo><mfenced separators=""><xsl:apply-templates select="child::*[position()=2]"/></mfenced>
+    <mi>arg</mi><mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo><mfenced separators=""><xsl:apply-templates select="*[position()=2]"/></mfenced>
   </mrow>
 </xsl:template>
 
 <!-- real part of complex number -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='real']]">
+<xsl:template match="m:apply[*[position()=1 and name()='real']]">
   <mrow>
     <mi><xsl:text disable-output-escaping="yes">&amp;#x0211C;</xsl:text><!-- &Re; or &realpart; should work--></mi>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo>
-    <mfenced separators=""><xsl:apply-templates select="child::*[position()=2]"/></mfenced>
+    <mfenced separators=""><xsl:apply-templates select="*[position()=2]"/></mfenced>
   </mrow>
 </xsl:template>
 
 <!-- imaginary part of complex number -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='imaginary']]">
+<xsl:template match="m:apply[*[position()=1 and name()='imaginary']]">
   <mrow>
     <mi><xsl:text disable-output-escaping="yes">&amp;#x02111;</xsl:text><!-- &Im; or &impartl should work--></mi>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo>
-    <mfenced separators=""><xsl:apply-templates select="child::*[position()=2]"/></mfenced>
+    <mfenced separators=""><xsl:apply-templates select="*[position()=2]"/></mfenced>
   </mrow>
 </xsl:template>
 
 <!-- lowest common multiple -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='lcm']]">
+<xsl:template match="m:apply[*[position()=1 and name()='lcm']]">
   <mrow>
     <mi>lcm</mi><mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo>
     <mfenced>
-      <xsl:apply-templates select="child::*[position()!=1]"/>
+      <xsl:apply-templates select="*[position()!=1]"/>
     </mfenced>
   </mrow>
 </xsl:template>
 
 <!-- floor -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='floor']]">
-  <mrow><mo><xsl:text disable-output-escaping="yes"><![CDATA[&LeftFloor;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=last()]"/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&RightFloor;]]></xsl:text></mo></mrow>
+<xsl:template match="m:apply[*[position()=1 and name()='floor']]">
+  <mrow><mo><xsl:text disable-output-escaping="yes"><![CDATA[&LeftFloor;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&RightFloor;]]></xsl:text></mo></mrow>
 </xsl:template>
 
 <!-- ceiling -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='ceiling']]">
-  <mrow><mo><xsl:text disable-output-escaping="yes"><![CDATA[&LeftCeiling;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=last()]"/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&RightCeiling;]]></xsl:text></mo></mrow>
+<xsl:template match="m:apply[*[position()=1 and name()='ceiling']]">
+  <mrow><mo><xsl:text disable-output-escaping="yes"><![CDATA[&LeftCeiling;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&RightCeiling;]]></xsl:text></mo></mrow>
 </xsl:template>
 
 <!-- #################### 4.4.4 #################### -->
@@ -1039,17 +1039,17 @@
 <!-- equal to -->
 <xsl:template name="eqRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo>=</mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo>=</mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo>=</mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1058,45 +1058,45 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='eq']]">
+<xsl:template match="m:apply[*[position()=1 and name()='eq']]">
   <xsl:call-template name="eqRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='eq']]">
+<xsl:template match="m:reln[*[position()=1 and name()='eq']]">
   <xsl:call-template name="eqRel"/>
 </xsl:template>
 
 <!-- not equal to -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='neq']]">
+<xsl:template match="m:apply[*[position()=1 and name()='neq']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotEqual;]]></xsl:text></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='neq']]">
+<xsl:template match="m:reln[*[position()=1 and name()='neq']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotEqual;]]></xsl:text></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
 <!-- greater than -->
 <xsl:template name="gtRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&gt;]]></xsl:text></mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&gt;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&gt;]]></xsl:text></mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1105,28 +1105,28 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='gt']]">
+<xsl:template match="m:apply[*[position()=1 and name()='gt']]">
   <xsl:call-template name="gtRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='gt']]">
+<xsl:template match="m:reln[*[position()=1 and name()='gt']]">
   <xsl:call-template name="gtRel"/>
 </xsl:template>
 
 <!-- less than -->
 <xsl:template name="ltRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&lt;]]></xsl:text></mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&lt;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&lt;]]></xsl:text></mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1135,28 +1135,28 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='lt']]">
+<xsl:template match="m:apply[*[position()=1 and name()='lt']]">
   <xsl:call-template name="ltRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='lt']]">
+<xsl:template match="m:reln[*[position()=1 and name()='lt']]">
   <xsl:call-template name="ltRel"/>
 </xsl:template>
 
 <!-- greater than or equal to -->
 <xsl:template name="geqRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&GreaterEqual;]]></xsl:text></mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&GreaterEqual;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&GreaterEqual;]]></xsl:text></mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1165,28 +1165,28 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='geq']]">
+<xsl:template match="m:apply[*[position()=1 and name()='geq']]">
   <xsl:call-template name="geqRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='geq']]">
+<xsl:template match="m:reln[*[position()=1 and name()='geq']]">
   <xsl:call-template name="geqRel"/>
 </xsl:template>
 
 <!-- less than or equal to -->
 <xsl:template name="leqRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&LessEqual;]]></xsl:text></mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&LessEqual;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&LessEqual;]]></xsl:text></mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1195,28 +1195,28 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='leq']]">
+<xsl:template match="m:apply[*[position()=1 and name()='leq']]">
   <xsl:call-template name="leqRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='leq']]">
+<xsl:template match="m:reln[*[position()=1 and name()='leq']]">
   <xsl:call-template name="leqRel"/>
 </xsl:template>
 
 <!-- equivalent -->
 <xsl:template name="equivRel">
   <xsl:choose>
-  <xsl:when test="count(child::*)>=3">
+  <xsl:when test="count(*)>=3">
     <mrow>
-      <xsl:for-each select="child::*[position()!=1 and position()!=last()]">
+      <xsl:for-each select="*[position()!=1 and position()!=last()]">
 	<xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&equiv;]]></xsl:text></mo>
       </xsl:for-each>
-      <xsl:apply-templates select="child::*[position()=last()]"/>
+      <xsl:apply-templates select="*[position()=last()]"/>
     </mrow>
   </xsl:when>
-  <xsl:when test="count(child::*)=2">
+  <xsl:when test="count(*)=2">
     <mrow>
-      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&equiv;]]></xsl:text></mo><xsl:apply-templates select="child::*[position()=2]"/>
+      <mo><xsl:text disable-output-escaping="yes"><![CDATA[&equiv;]]></xsl:text></mo><xsl:apply-templates select="*[position()=2]"/>
     </mrow>
   </xsl:when>
   <xsl:otherwise>
@@ -1225,44 +1225,44 @@
   </xsl:choose>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='equivalent']]">
+<xsl:template match="m:apply[*[position()=1 and name()='equivalent']]">
   <xsl:call-template name="equivRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='equivalent']]">
+<xsl:template match="m:reln[*[position()=1 and name()='equivalent']]">
   <xsl:call-template name="equivRel"/>
 </xsl:template>
 
 <!-- approximately equal -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='approx']]">
+<xsl:template match="m:apply[*[position()=1 and name()='approx']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping='yes'>&amp;#x02248;</xsl:text><!-- &TildeTilde; or &approx; should work--></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='approx']]">
+<xsl:template match="m:reln[*[position()=1 and name()='approx']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo><xsl:text disable-output-escaping='yes'>&amp;#x02248;</xsl:text><!-- &TildeTilde; or &approx; should work--></mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
 <!-- factor of -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='factorof']]">
+<xsl:template match="m:apply[*[position()=1 and name()='factorof']]">
   <mrow>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     <mo>|</mo>
-    <xsl:apply-templates select="child::*[position()=3]"/>
+    <xsl:apply-templates select="*[position()=3]"/>
   </mrow>
 </xsl:template>
 
 <!-- #################### 4.4.5 #################### -->
 
 <!-- integral -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='int']]">
+<xsl:template match="m:apply[*[position()=1 and name()='int']]">
   <mrow>
     <xsl:choose>
     <xsl:when test="m:condition"> <!-- integration domain expressed by a condition-->
@@ -1312,7 +1312,7 @@
 </xsl:template>
 
 <!-- differentiation -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='diff']]">
+<xsl:template match="m:apply[*[position()=1 and name()='diff']]">
   <mrow>
   <xsl:choose>
   <xsl:when test="m:bvar/m:degree"> <!-- if the order of the derivative is specified-->
@@ -1382,7 +1382,7 @@
 <!-- the latest working draft sets the default rendering of the numerator
 to only one mfrac with one PartialD for the numerator, exponent being the sum
 of every partial diff's orders; not supported yet (I am not sure it is even possible with XSLT)-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='partialdiff']]">
+<xsl:template match="m:apply[*[position()=1 and name()='partialdiff']]">
 <mrow>
   <xsl:choose>
     <xsl:when test="m:list">
@@ -1435,58 +1435,58 @@
 </xsl:template>
 
 <!-- divergence -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='divergence']]">
+<xsl:template match="m:apply[*[position()=1 and name()='divergence']]">
 <mrow>
   <mi>div</mi>
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
 </xsl:template>
 
 <!-- gradient -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='grad']]">
+<xsl:template match="m:apply[*[position()=1 and name()='grad']]">
 <mrow>
   <mi>grad</mi>
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
 </xsl:template>
 
 <!-- vector calculus curl -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='curl']]">
+<xsl:template match="m:apply[*[position()=1 and name()='curl']]">
 <mrow>
   <mi>curl</mi>
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
 </xsl:template>
 
 <!-- laplacian -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='laplacian']]">
+<xsl:template match="m:apply[*[position()=1 and name()='laplacian']]">
 <mrow>
   <msup>
     <mo><xsl:text disable-output-escaping='yes'>&amp;#x02207;</xsl:text></mo>  <!-- Del or nabla should work-->
@@ -1495,11 +1495,11 @@
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
@@ -1543,14 +1543,14 @@
 </xsl:template>
 
 <!-- union -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='union']]">
+<xsl:template match="m:apply[*[position()=1 and name()='union']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&Union;]]></xsl:text></mo>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
   </xsl:when>
   <xsl:when test="count(*)=2">
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Union;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -1563,11 +1563,11 @@
 </xsl:template>
 
 <!-- intersection -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='intersect']]">
+<xsl:template match="m:apply[*[position()=1 and name()='intersect']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:choose>
       <xsl:when test="m:union">  <!-- add brackets around UNION children for priority purpose: intersection has higher precedence than union -->
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced><mo><xsl:text disable-output-escaping="yes"><![CDATA[&Intersection;]]></xsl:text></mo>
@@ -1577,7 +1577,7 @@
       </xsl:otherwise>
       </xsl:choose>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
   </xsl:when>
   <xsl:when test="count(*)=2">
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Intersection;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -1590,7 +1590,7 @@
 </xsl:template>
 
 <!-- inclusion -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='in']]">
+<xsl:template match="m:apply[*[position()=1 and name()='in']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&isin;]]></xsl:text></mo>
@@ -1598,7 +1598,7 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='in']]">
+<xsl:template match="m:reln[*[position()=1 and name()='in']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&isin;]]></xsl:text></mo>
@@ -1607,7 +1607,7 @@
 </xsl:template>
 
 <!-- exclusion -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='notin']]">
+<xsl:template match="m:apply[*[position()=1 and name()='notin']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&notin;]]></xsl:text></mo>
@@ -1615,7 +1615,7 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='notin']]">
+<xsl:template match="m:reln[*[position()=1 and name()='notin']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&notin;]]></xsl:text></mo>
@@ -1628,10 +1628,10 @@
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&SubsetEqual;]]></xsl:text></mo>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
     </xsl:when>
     <xsl:when test="count(*)=2">
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&SubsetEqual;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -1643,11 +1643,11 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='subset']]">
+<xsl:template match="m:apply[*[position()=1 and name()='subset']]">
   <xsl:call-template name="subsetRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='subset']]">
+<xsl:template match="m:reln[*[position()=1 and name()='subset']]">
   <xsl:call-template name="subsetRel"/>
 </xsl:template>
 
@@ -1656,10 +1656,10 @@
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>=3">
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:apply-templates select="."/><mo><xsl:text disable-output-escaping="yes"><![CDATA[&Subset;]]></xsl:text></mo>
     </xsl:for-each>
-    <xsl:apply-templates select="child::*[position()=last()]"/>
+    <xsl:apply-templates select="*[position()=last()]"/>
     </xsl:when>
     <xsl:when test="count(*)=2">
       <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Subset;]]></xsl:text></mo><xsl:apply-templates select="*[position()=last()]"/>
@@ -1671,18 +1671,18 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='prsubset']]">
+<xsl:template match="m:apply[*[position()=1 and name()='prsubset']]">
   <xsl:call-template name="prsubsetRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='prsubset']]">
+<xsl:template match="m:reln[*[position()=1 and name()='prsubset']]">
   <xsl:call-template name="prsubsetRel"/>
 </xsl:template>
 
 <!-- perhaps Subset and SubsetEqual signs are used in place of one another ; not according to the spec -->
 
 <!-- containment (not subset of)-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='notsubset']]">
+<xsl:template match="m:apply[*[position()=1 and name()='notsubset']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotSubset;]]></xsl:text></mo>
@@ -1690,7 +1690,7 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='notsubset']]">
+<xsl:template match="m:reln[*[position()=1 and name()='notsubset']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotSubset;]]></xsl:text></mo>
@@ -1699,7 +1699,7 @@
 </xsl:template>
 
 <!-- containment (not proper subset of) -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='notprsubset']]">
+<xsl:template match="m:apply[*[position()=1 and name()='notprsubset']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotSubsetEqual;]]></xsl:text></mo>  <!-- does not work, perhaps nsube, or nsubE, or nsubseteqq or nsubseteq, UNICODE x02288-->
@@ -1707,7 +1707,7 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='notprsubset']]">
+<xsl:template match="m:reln[*[position()=1 and name()='notprsubset']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&NotSubsetEqual;]]></xsl:text></mo>  <!-- does not work, perhaps nsube, or nsubE, or nsubseteqq or nsubseteq, UNICODE x02288-->
@@ -1716,7 +1716,7 @@
 </xsl:template>
 
 <!-- difference of two sets -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='setdiff']]">
+<xsl:template match="m:apply[*[position()=1 and name()='setdiff']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&Backslash;]]></xsl:text></mo>
@@ -1725,16 +1725,16 @@
 </xsl:template>
 
 <!-- cardinality -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='card']]">
+<xsl:template match="m:apply[*[position()=1 and name()='card']]">
   <mrow><mo>|</mo><xsl:apply-templates select="*[position()=last()]"/><mo>|</mo></mrow>
 </xsl:template>
 
 <!-- cartesian product -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='cartesianproduct']]">
+<xsl:template match="m:apply[*[position()=1 and name()='cartesianproduct']]">
 <xsl:choose>
-<xsl:when test="count(child::*)>=3">
+<xsl:when test="count(*)>=3">
   <mrow>
-    <xsl:for-each select="child::*[position()!=last() and  position()!=1]">
+    <xsl:for-each select="*[position()!=last() and  position()!=1]">
       <xsl:choose>
       <xsl:when test="m:plus"> <!--add brackets around + children for priority purpose-->
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced><mo><xsl:text disable-output-escaping="yes"><![CDATA[&times;]]></xsl:text></mo>
@@ -1750,7 +1750,7 @@
       </xsl:otherwise>
       </xsl:choose>
     </xsl:for-each>
-    <xsl:for-each select="child::*[position()=last()]">
+    <xsl:for-each select="*[position()=last()]">
       <xsl:choose>
       <xsl:when test="m:plus">
         <mfenced separators=""><xsl:apply-templates select="."/></mfenced>
@@ -1768,7 +1768,7 @@
     </xsl:for-each>
   </mrow>
 </xsl:when>
-<xsl:when test="count(child::*)=2">  <!-- unary -->
+<xsl:when test="count(*)=2">  <!-- unary -->
   <mrow>
     <mo><xsl:text disable-output-escaping="yes"><![CDATA[&times;]]></xsl:text></mo>
     <xsl:choose>
@@ -1796,7 +1796,7 @@
 <!-- #################### 4.4.7 #################### -->
 
 <!-- sum -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sum']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sum']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="m:condition">  <!-- domain specified by a condition -->
@@ -1825,7 +1825,7 @@
 </xsl:template>
 
 <!-- product -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='product']]">
+<xsl:template match="m:apply[*[position()=1 and name()='product']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="m:condition">   <!-- domain specified by a condition -->
@@ -1854,7 +1854,7 @@
 </xsl:template>
 
 <!-- limit -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='limit']]">
+<xsl:template match="m:apply[*[position()=1 and name()='limit']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="m:condition">
@@ -1898,11 +1898,11 @@
 </mrow>
 </xsl:template>
 
-<xsl:template match="m:apply[child::*[position()=1 and name()='tendsto']]">
+<xsl:template match="m:apply[*[position()=1 and name()='tendsto']]">
   <xsl:call-template name="tendstoRel"/>
 </xsl:template>
 
-<xsl:template match="m:reln[child::*[position()=1 and name()='tendsto']]">
+<xsl:template match="m:reln[*[position()=1 and name()='tendsto']]">
   <xsl:call-template name="tendstoRel"/>
 </xsl:template>
 
@@ -1916,18 +1916,18 @@
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <mrow><xsl:apply-templates select="child::*[position()=2]"/></mrow>
+    <mrow><xsl:apply-templates select="*[position()=2]"/></mrow>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
 </xsl:template>
 
 <!-- trigonometric function: sine -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sin']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sin']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">sin</xsl:with-param>
   </xsl:call-template>
@@ -1938,7 +1938,7 @@
 </xsl:template>
 
 <!-- trigonometric function: cosine -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='cos']]">
+<xsl:template match="m:apply[*[position()=1 and name()='cos']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">cos</xsl:with-param>
   </xsl:call-template>
@@ -1949,7 +1949,7 @@
 </xsl:template>
 
 <!-- trigonometric function: tan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='tan']]">
+<xsl:template match="m:apply[*[position()=1 and name()='tan']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">tan</xsl:with-param>   
   </xsl:call-template>
@@ -1960,7 +1960,7 @@
 </xsl:template>
 
 <!-- trigonometric function: sec -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sec']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sec']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">sec</xsl:with-param>  
   </xsl:call-template>
@@ -1971,7 +1971,7 @@
 </xsl:template>
 
 <!-- trigonometric function: csc -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='csc']]">
+<xsl:template match="m:apply[*[position()=1 and name()='csc']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">csc</xsl:with-param>    
   </xsl:call-template>
@@ -1982,7 +1982,7 @@
 </xsl:template>
 
 <!-- trigonometric function: cotan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='cot']]">
+<xsl:template match="m:apply[*[position()=1 and name()='cot']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">cot</xsl:with-param>    
   </xsl:call-template>
@@ -1993,7 +1993,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic sin -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sinh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sinh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">sinh</xsl:with-param>    
   </xsl:call-template>
@@ -2004,7 +2004,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic cos -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='cosh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='cosh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">cosh</xsl:with-param>    
   </xsl:call-template>
@@ -2015,7 +2015,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic tan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='tanh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='tanh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">tanh</xsl:with-param>    
   </xsl:call-template>
@@ -2026,7 +2026,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic sec -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sech']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sech']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">sech</xsl:with-param>    
   </xsl:call-template>
@@ -2037,7 +2037,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic csc -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='csch']]">
+<xsl:template match="m:apply[*[position()=1 and name()='csch']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">csch</xsl:with-param>   
   </xsl:call-template>
@@ -2048,7 +2048,7 @@
 </xsl:template>
 
 <!-- trigonometric function: hyperbolic cotan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='coth']]">
+<xsl:template match="m:apply[*[position()=1 and name()='coth']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">coth</xsl:with-param>   
   </xsl:call-template>
@@ -2059,7 +2059,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc sine -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arcsin']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arcsin']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arcsin</xsl:with-param>    
   </xsl:call-template>
@@ -2070,7 +2070,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc cosine -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccos']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccos']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccos</xsl:with-param>    
   </xsl:call-template>
@@ -2081,7 +2081,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc tan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arctan']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arctan']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arctan</xsl:with-param>    
   </xsl:call-template>
@@ -2092,7 +2092,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc sec -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arcsec']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arcsec']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arcsec</xsl:with-param>    
   </xsl:call-template>
@@ -2103,7 +2103,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc csc -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccsc']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccsc']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccsc</xsl:with-param>    
   </xsl:call-template>
@@ -2114,7 +2114,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc cotan -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccot']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccot']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccot</xsl:with-param>    
   </xsl:call-template>
@@ -2125,7 +2125,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc sinh -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arcsinh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arcsinh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arcsinh</xsl:with-param>
   </xsl:call-template>
@@ -2136,7 +2136,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc cosh -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccosh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccosh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccosh</xsl:with-param>    
   </xsl:call-template>
@@ -2147,7 +2147,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc tanh -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arctanh']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arctanh']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arctanh</xsl:with-param>    
   </xsl:call-template>
@@ -2158,7 +2158,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc sech -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arcsech']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arcsech']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arcsech</xsl:with-param>    
   </xsl:call-template>
@@ -2169,7 +2169,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc csch -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccsch']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccsch']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccsch</xsl:with-param>    
   </xsl:call-template>
@@ -2180,7 +2180,7 @@
 </xsl:template>
 
 <!-- trigonometric function: arc coth -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='arccoth']]">
+<xsl:template match="m:apply[*[position()=1 and name()='arccoth']]">
   <xsl:call-template name="trigo">
     <xsl:with-param name="func">arccoth</xsl:with-param>   
   </xsl:call-template>
@@ -2191,10 +2191,10 @@
 </xsl:template>
 
 <!-- exponential -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='exp']]">
+<xsl:template match="m:apply[*[position()=1 and name()='exp']]">
   <msup>
     <mi><xsl:text disable-output-escaping="yes"><![CDATA[&ee;]]></xsl:text></mi>   <!-- ExponentialE does not work yet -->
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </msup>
 </xsl:template>
 
@@ -2203,17 +2203,17 @@
 </xsl:template>
 
 <!-- natural logarithm -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='ln']]">
+<xsl:template match="m:apply[*[position()=1 and name()='ln']]">
 <mrow>
   <mi>ln</mi><mo><xsl:text disable-output-escaping="yes"><![CDATA[&ApplyFunction;]]></xsl:text></mo>
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
     <mfenced separators="">
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </mfenced>
   </xsl:when>
   <xsl:otherwise>
-    <xsl:apply-templates select="child::*[position()=2]"/>
+    <xsl:apply-templates select="*[position()=2]"/>
   </xsl:otherwise>
   </xsl:choose>
 </mrow>
@@ -2224,7 +2224,7 @@
 </xsl:template>
 
 <!-- logarithm to a given base (default 10)-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='log']]">
+<xsl:template match="m:apply[*[position()=1 and name()='log']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="m:logbase">
@@ -2236,11 +2236,11 @@
     <xsl:choose>
     <xsl:when test="name(*[position()=3])='apply' or ((name(*[position()=3])='ci' or name(*[position()=3])='cn') and contains(*[position()=3]/text(),'-'))">
       <mfenced separators="">
-        <xsl:apply-templates select="child::*[position()=3]"/>
+        <xsl:apply-templates select="*[position()=3]"/>
       </mfenced>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:apply-templates select="child::*[position()=3]"/>
+      <xsl:apply-templates select="*[position()=3]"/>
     </xsl:otherwise>
     </xsl:choose>
   </xsl:when>
@@ -2253,11 +2253,11 @@
     <xsl:choose>
     <xsl:when test="name(*[position()=2])='apply' or ((name(*[position()=2])='ci' or name(*[position()=2])='cn') and contains(*[position()=2]/text(),'-'))">
       <mfenced separators="">
-        <xsl:apply-templates select="child::*[position()=2]"/>
+        <xsl:apply-templates select="*[position()=2]"/>
       </mfenced>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:apply-templates select="child::*[position()=2]"/>
+      <xsl:apply-templates select="*[position()=2]"/>
     </xsl:otherwise>
     </xsl:choose>
   </xsl:otherwise>
@@ -2288,7 +2288,7 @@
 
 <!-- mean -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='mean']]">
+<xsl:template match="m:apply[*[position()=1 and name()='mean']]">
 <mrow>
   <xsl:choose>
   <xsl:when test="count(*)>2">  <!-- if more than one element use angle bracket notation-->
@@ -2311,7 +2311,7 @@
 
 <!-- standard deviation -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='sdev']]">
+<xsl:template match="m:apply[*[position()=1 and name()='sdev']]">
 <mrow>
   <mi><xsl:text disable-output-escaping="yes"><![CDATA[&sigma;]]></xsl:text></mi>
   <mfenced>
@@ -2322,7 +2322,7 @@
 
 <!-- statistical variance -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='variance']]">
+<xsl:template match="m:apply[*[position()=1 and name()='variance']]">
 <mrow>
   <mi><xsl:text disable-output-escaping="yes"><![CDATA[&sigma;]]></xsl:text></mi>
   <msup> 
@@ -2336,7 +2336,7 @@
 
 <!-- median -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='median']]">
+<xsl:template match="m:apply[*[position()=1 and name()='median']]">
 <mrow>
   <mi>median</mi>
   <mfenced>
@@ -2347,7 +2347,7 @@
 
 <!-- statistical mode -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='mode']]">
+<xsl:template match="m:apply[*[position()=1 and name()='mode']]">
 <mrow>
   <mi>mode</mi>
   <mfenced>
@@ -2358,7 +2358,7 @@
 
 <!-- statistical moment -->
 <!-- not sure we handle the n-ary thing correctly as far as display is concerned-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='moment']]">
+<xsl:template match="m:apply[*[position()=1 and name()='moment']]">
 <mrow>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&lang;]]></xsl:text></mo>
   <xsl:for-each select="*[position()!=1 and position()!=2 and position()!=last() and name()!='momentabout']">
@@ -2407,21 +2407,21 @@
 <xsl:template match="m:matrix">
   <mfenced>
     <mtable>
-      <xsl:apply-templates select="child::*"/>
+      <xsl:apply-templates select="*"/>
     </mtable>
   </mfenced>
 </xsl:template>
 
 <xsl:template match="m:matrixrow">
   <mtr>
-    <xsl:for-each select="child::*">
+    <xsl:for-each select="*">
       <mtd><xsl:apply-templates select="."/></mtd>
     </xsl:for-each>
   </mtr>
 </xsl:template>
 
 <!-- determinant -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='determinant']]">
+<xsl:template match="m:apply[*[position()=1 and name()='determinant']]">
   <mrow>
     <mo>det</mo>
     <xsl:choose>
@@ -2436,7 +2436,7 @@
 </xsl:template>
 
 <!-- transpose -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='transpose']]">
+<xsl:template match="m:apply[*[position()=1 and name()='transpose']]">
   <msup>
     <xsl:choose>
     <xsl:when test="m:apply">
@@ -2451,7 +2451,7 @@
 </xsl:template>
 
 <!-- selector-->
-<xsl:template match="m:apply[child::*[position()=1 and name()='selector']]">
+<xsl:template match="m:apply[*[position()=1 and name()='selector']]">
   <mrow>
   <xsl:choose>
   <xsl:when test="name(*[position()=2])='m:matrix'"> <!-- select in a matrix defined inside the selector -->
@@ -2509,7 +2509,7 @@
 </xsl:template>
 
 <!-- vector product = A x B x sin(teta) -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='vectorproduct']]">
+<xsl:template match="m:apply[*[position()=1 and name()='vectorproduct']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo><xsl:text disable-output-escaping="yes"><![CDATA[&times;]]></xsl:text></mo>
@@ -2518,7 +2518,7 @@
 </xsl:template>
 
 <!-- scalar product = A x B x cos(teta) -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='scalarproduct']]">
+<xsl:template match="m:apply[*[position()=1 and name()='scalarproduct']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo>.</mo>
@@ -2527,7 +2527,7 @@
 </xsl:template>
 
 <!-- outer product = A x B x cos(teta) -->
-<xsl:template match="m:apply[child::*[position()=1 and name()='outerproduct']]">
+<xsl:template match="m:apply[*[position()=1 and name()='outerproduct']]">
 <mrow>
   <xsl:apply-templates select="*[position()=2]"/>
   <mo>.</mo>

