]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlctop.xsl-0.14
...
[helm.git] / helm / style / mmlctop.xsl-0.14
index ade27944aa038424e6755b845ff74dd010aa0bfb..1568e1da2deefc9818f6aab66c4adbf80a2c176d 100755 (executable)
@@ -19,7 +19,7 @@
 <!--  Added the namespace prefix to all the output elements -->
 <!--  Added the namespace prefix to all the xref attributes -->
 <!--  Changed the mml prefix into m                         -->
-<!--  Added m:xref to every mo element                      -->
+<!--  Added xref to every mo element                        -->
 <!--  Changed mchar into the corresponding entity           -->
 <!--  First draft: April 27 2001, Irene Schena              -->
 <!-- ====================================================== -->
 <!-- HELM: we don't have a default namespace.
      Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
 
+<!-- HELM: was
 <xsl:output method="xml" indent="yes"/>
+-->
+<xsl:output method="xml"/>
+<!-- HELM -->
 
 <xsl:strip-space elements="apply semantics annotation-xml
         csymbol fn cn ci interval matrix matrixrow vector
@@ -251,7 +255,7 @@ LINEAR ALGEBRA
         <xsl:when test="self::m:semantics">
           <xsl:copy>
             <xsl:copy-of select="@*"/>
-            <xsl:attribute name="m:xref">
+            <xsl:attribute name="xref">
               <xsl:value-of select="@id"/>
             </xsl:attribute>
             <xsl:copy-of select="*[1]"/>
@@ -299,15 +303,17 @@ LINEAR ALGEBRA
   <xsl:param name="PAREN" select="$PAR_NO"/>
   <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
 <!-- HELM: added -->
+<!-- CSC
 <xsl:choose>
   <xsl:when test="child::text()">
+-->
 <!-- HELM -->
   <xsl:choose>
     <xsl:when test=". &lt; 0 and $IN_PREC &gt; $NO_PREC and $PAREN=$PAR_NO
                                                    and $PAR_NO_IGNORE=$NO">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -326,16 +332,18 @@ LINEAR ALGEBRA
     </xsl:otherwise>
   </xsl:choose>
 <!-- HELM: added -->
+<!--CSC
   </xsl:when>
   <xsl:otherwise>
    <m:mrow>
-    <xsl:attribute name="m:xref">
+    <xsl:attribute name="xref">
      <xsl:value-of select="@id"/>
     </xsl:attribute>
     <xsl:copy-of select="*"/>
    </m:mrow> 
   </xsl:otherwise>
  </xsl:choose>
+-->
 <!-- HELM -->
 </xsl:template>
 
@@ -420,22 +428,42 @@ LINEAR ALGEBRA
         <m:mn> <xsl:value-of select="@base"/> </m:mn>
       </m:msub>
    </xsl:when>
-    <xsl:otherwise>
+   <xsl:otherwise>
+<!--HELM: Was:
+ <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+HELM: Now is: -->
+    <xsl:choose>
+     <xsl:when test="child::text() and not(*[1])">
       <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
-    </xsl:otherwise>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+       <xsl:when test="not(*[2])">
+        <xsl:copy-of select="*[1]"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mrow>
+         <xsl:copy-of select="*|text()"/>
+        </m:mrow>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+    </xsl:choose>
+<!-- HELM -->
+   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
 <xsl:template match = "m:cn" mode="cnid">
   <xsl:choose>
     <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
-      <m:msub m:xref="{@id}">
+      <m:msub xref="{@id}">
         <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
         <m:mn> <xsl:value-of select="@base"/> </m:mn>
       </m:msub>
     </xsl:when>
     <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
-      <m:mfenced separators="" m:xref="{@id}">
+      <m:mfenced separators="" xref="{@id}">
         <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
         <xsl:if test="text()[2] &lt; 0">
           <m:mo>-</m:mo>
@@ -450,7 +478,7 @@ LINEAR ALGEBRA
       </m:mfenced>
     </xsl:when>
     <xsl:when test="@type='complex' and @base and child::m:sep[1]">
-      <m:msub m:xref="{@id}">
+      <m:msub xref="{@id}">
         <m:mfenced separators="">
           <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
           <xsl:if test="text()[2] &lt; 0">
@@ -468,13 +496,13 @@ LINEAR ALGEBRA
       </m:msub>
     </xsl:when>
     <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
-      <m:mfrac m:xref="{@id}">
+      <m:mfrac xref="{@id}">
         <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
         <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
       </m:mfrac>
     </xsl:when>
     <xsl:when test="@type='rational' and @base and child::m:sep[1]">
-      <m:msub m:xref="{@id}">
+      <m:msub xref="{@id}">
         <m:mfenced>
           <m:mfrac>
             <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
@@ -485,7 +513,7 @@ LINEAR ALGEBRA
       </m:msub>
     </xsl:when>
     <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
-      <m:mrow m:xref="{@id}">
+      <m:mrow xref="{@id}">
         <m:mo>Polar</m:mo>
         <m:mo>&#x02062;</m:mo>
         <m:mfenced separators=",">
@@ -495,7 +523,7 @@ LINEAR ALGEBRA
       </m:mrow>
     </xsl:when>
     <xsl:when test="@type='polar' and @base and child::m:sep[1]">
-      <m:msub m:xref="{@id}">
+      <m:msub xref="{@id}">
         <m:mrow>
           <m:mo>Polar</m:mo>
           <m:mo>&#x02062;</m:mo>
@@ -507,9 +535,33 @@ LINEAR ALGEBRA
         <m:mn> <xsl:value-of select="@base"/> </m:mn>
       </m:msub>
    </xsl:when>
-    <xsl:otherwise>
-      <m:mn m:xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
-    </xsl:otherwise>
+   <xsl:otherwise>
+    <xsl:choose>
+     <xsl:when test="child::text() and not(*[1])">
+      <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:variable name="id" select="@id"/>
+      <xsl:choose>
+       <xsl:when test="not(*[2])">
+        <xsl:for-each select="*[1]">
+         <xsl:copy>
+          <xsl:attribute name="xref">
+           <xsl:value-of select="$id"/>
+          </xsl:attribute>
+          <xsl:copy-of select="@*|*"/>
+         </xsl:copy>
+        </xsl:for-each>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mrow xref="{$id}">
+         <xsl:copy-of select="*|text()"/>
+        </m:mrow>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
@@ -520,7 +572,7 @@ LINEAR ALGEBRA
     <xsl:when test="@type='vector' or @type=matrix or @type=set">
       <m:mi fontweight="bold">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -530,7 +582,7 @@ LINEAR ALGEBRA
     <xsl:when test="child::text() and not(child::*[1])">
       <m:mi>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -541,7 +593,7 @@ LINEAR ALGEBRA
     <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -553,7 +605,7 @@ LINEAR ALGEBRA
       <xsl:if test="*[2]">
         <m:mrow>
           <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-            <xsl:attribute name="m:xref">
+            <xsl:attribute name="xref">
               <xsl:value-of select="@id"/>
             </xsl:attribute>
           </xsl:if>
@@ -567,7 +619,7 @@ HELM: Now is: -->
         <xsl:variable name="id" select="@id"/>
         <xsl:for-each select="*[1]">
          <xsl:copy>
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
            <xsl:value-of select="$id"/>
           </xsl:attribute>
          <xsl:copy-of select="@*|*"/>
@@ -588,7 +640,7 @@ HELM: Now is: -->
 <xsl:template match = "m:csymbol">
 <!-- HELM: added -->
    <m:mrow>
-    <xsl:attribute name="m:xref">
+    <xsl:attribute name="xref">
      <xsl:value-of select="@id"/>
     </xsl:attribute>
 <!-- HELM -->
@@ -637,7 +689,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:*[1][self::m:fn]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -645,7 +697,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo> 
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:fn/@id"/>
           </xsl:attribute>
         </xsl:if>&#x02061;</m:mo>
@@ -664,7 +716,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:interval">
   <m:mfenced separators=",">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -681,7 +733,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -702,7 +754,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                     *[2]=m:arccos or *[2]=m:arctan">
       <m:mo>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -712,7 +764,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:msup>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -789,7 +841,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <xsl:choose>
         <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <m:mrow m:xref="{@id}">
+          <m:mrow xref="{@id}">
             <xsl:apply-templates select="*" mode = "semantics"/>
           </m:mrow>
         </xsl:when>
@@ -813,7 +865,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:lambda">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -839,7 +891,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -854,7 +906,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[*[1][self::m:compose]]">
   <m:mfenced separators="">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -865,7 +917,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mo>
  <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:compose/@id"/>
           </xsl:attribute>
         </xsl:if>&#x02218;</m:mo>
@@ -877,7 +929,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:ident">
   <xsl:choose>
     <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <m:mo m:xref="{@id}">id</m:mo>
+      <m:mo xref="{@id}">id</m:mo>
     </xsl:when>
     <xsl:otherwise>
       <m:mo>id</m:mo>
@@ -891,7 +943,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:quotient[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -899,7 +951,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mfrac>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:quotient/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -922,14 +974,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[*[1][self::m:exp]]">
   <m:msup>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
     <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:exp/@id"/>
           </xsl:attribute>
         </xsl:if>e</m:mo>
@@ -940,7 +992,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:factorial[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -951,7 +1003,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:factorial/@id"/>
           </xsl:attribute>
         </xsl:if>!</m:mo>
@@ -961,7 +1013,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:max[1] | m:min[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -971,7 +1023,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:max/@id"/>
           </xsl:attribute>
         </xsl:if>max</m:mo>
@@ -980,7 +1032,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:min/@id"/>
           </xsl:attribute>
         </xsl:if>min</m:mo>
@@ -1051,7 +1103,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                                                         $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1074,7 +1126,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1096,7 +1148,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:minus/@id"/>
           </xsl:attribute>
         </xsl:if>-</m:mo>
@@ -1116,7 +1168,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:minus/@id"/>
           </xsl:attribute>
         </xsl:if>-</m:mo>
@@ -1139,7 +1191,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                                                       $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1162,7 +1214,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1204,7 +1256,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:plus/@id"/>
           </xsl:attribute>
         </xsl:if>+</m:mo>
@@ -1232,7 +1284,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:msup>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1256,7 +1308,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                                                     $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1279,7 +1331,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1307,7 +1359,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:if test="m:rem">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:rem/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1316,7 +1368,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:if test="m:divide">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:divide/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1341,7 +1393,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                                                     $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1364,7 +1416,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1395,7 +1447,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:times/@id"/>
           </xsl:attribute>
         </xsl:if>*</m:mo>
@@ -1411,7 +1463,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:root[1]]">
   <m:msqrt>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1435,7 +1487,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:gcd[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1443,7 +1495,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:gcd/@id"/>
           </xsl:attribute>
         </xsl:if>gcd</m:mo>
@@ -1453,7 +1505,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:gcd/@id"/>
           </xsl:attribute>
         </xsl:if>gcd</m:mo>
@@ -1476,7 +1528,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:when test="$IN_PREC &gt; $AND_PREC">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1498,7 +1550,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1526,7 +1578,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:and/@id"/>
           </xsl:attribute>
         </xsl:if>&#x02227;</m:mo>
@@ -1546,7 +1598,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:when test="$IN_PREC &gt; $OR_PREC">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1568,7 +1620,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1596,7 +1648,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo> 
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:or/@id"/>
           </xsl:attribute>
         </xsl:if>&#x02228;</m:mo>
@@ -1616,7 +1668,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:when test="$IN_PREC &gt; $XOR_PREC">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1637,7 +1689,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1665,7 +1717,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
  <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:xor/@id"/>
           </xsl:attribute>
         </xsl:if>&#x022BB;</m:mo>
@@ -1680,7 +1732,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:not[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1688,7 +1740,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:not/@id"/>
           </xsl:attribute>
         </xsl:if>&#x000AC;</m:mo>
@@ -1701,14 +1753,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:forall[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:forall/@id"/>
           </xsl:attribute>
         </xsl:if>for all</m:mo>
@@ -1735,14 +1787,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:exists[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo> 
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:exists/@id"/>
           </xsl:attribute>
         </xsl:if>&#x02203;</m:mo>
@@ -1772,7 +1824,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
   <xsl:if test="not(parent::m:apply[m:power[1]])">
     <m:mfenced open="|" close="|" separators="">
       <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-        <xsl:attribute name="m:xref">
+        <xsl:attribute name="xref">
           <xsl:value-of select="@id"/>
         </xsl:attribute>
       </xsl:if>
@@ -1783,7 +1835,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:msup>
       <m:mfenced open="|" close="|" separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1797,7 +1849,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:conjugate[1]]">
   <m:mover>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1807,7 +1859,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
  <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:conjugate/@id"/>
           </xsl:attribute>
         </xsl:if>&#x00332;</m:mo>
@@ -1817,7 +1869,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1825,7 +1877,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="m:arg">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:arg/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1834,7 +1886,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="m:real">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:real/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1843,7 +1895,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="m:imaginary">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:imaginary/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1865,7 +1917,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                      | m:geq | m:leq | m:equivalent]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -1877,7 +1929,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:neq">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:neq/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1886,7 +1938,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:approx">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:approx/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1895,7 +1947,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:tendsto">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:tendsto/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1904,7 +1956,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:implies">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:implies/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1913,7 +1965,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:in">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:in/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1922,7 +1974,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:notin">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:notin/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1931,7 +1983,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:notsubset">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:notsubset/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1940,7 +1992,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <xsl:if test="*[1]=m:notprsubset">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:notprsubset/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1952,7 +2004,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:tendsto/@id"/>
           </xsl:attribute>
         </xsl:if>-</m:mo>
@@ -1961,7 +2013,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:tendsto/@id"/>
           </xsl:attribute>
         </xsl:if>+</m:mo>
@@ -1975,7 +2027,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:subset][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:subset/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1984,7 +2036,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:prsubset][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:prsubset/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -1993,7 +2045,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:eq][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:eq/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2002,7 +2054,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:gt][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:gt/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2011,7 +2063,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:lt][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:lt/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2020,7 +2072,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:geq][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:geq/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2029,7 +2081,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:leq][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:leq/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2038,7 +2090,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <xsl:if test="../*[self::m:equivalent][1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:equivalent/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2057,7 +2109,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[*[1][self::m:ln]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2067,7 +2119,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
           <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:ln/@id"/>
           </xsl:attribute>
         </xsl:if>ln</m:mo>
@@ -2078,7 +2130,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:ln/@id"/>
           </xsl:attribute>
         </xsl:if>ln</m:mo>
@@ -2094,7 +2146,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:log[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2105,7 +2157,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:log/@id"/>
           </xsl:attribute>
         </xsl:if>log</m:mo>
@@ -2117,7 +2169,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:log/@id"/>
           </xsl:attribute>
         </xsl:if>log</m:mo>
@@ -2135,7 +2187,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:log/@id"/>
           </xsl:attribute>
         </xsl:if>log</m:mo>
@@ -2161,7 +2213,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:diff[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2169,7 +2221,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mfrac>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:diff/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2190,7 +2242,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mfrac>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:diff/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2208,7 +2260,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:partialdiff[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2217,7 +2269,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mfrac>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:partialdiff/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2238,7 +2290,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
         <m:mfrac>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:partialdiff/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2262,7 +2314,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2270,7 +2322,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="*[1]=m:divergence">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:divergence/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2279,7 +2331,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="*[1]=m:grad">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:grad/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2288,7 +2340,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="*[1]=m:curl">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:curl/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2311,14 +2363,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:laplacian[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:msup>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:laplacian/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2335,7 +2387,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:set | m:list">
   <m:mfenced open="{{" close="}}" separators="">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2373,7 +2425,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                     and $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2396,7 +2448,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2424,7 +2476,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:union/@id"/>
           </xsl:attribute>
         </xsl:if>&#x022C3;</m:mo>
@@ -2445,7 +2497,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:when test="$IN_PREC &gt; $INTERSECT_PREC">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2468,7 +2520,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2496,7 +2548,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="../m:intersect/@id"/>
           </xsl:attribute>
         </xsl:if>&#x022C2;</m:mo>
@@ -2518,7 +2570,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                     and $PARAM=$PAR_SAME">
       <m:mfenced separators="">
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2541,7 +2593,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <xsl:otherwise>
       <m:mrow>
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2568,7 +2620,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
   <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:setdiff/@id"/>
           </xsl:attribute>
         </xsl:if>\</m:mo>
@@ -2583,7 +2635,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:card[1]]">
   <m:mfenced open="|" close="|" separators=",">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2599,7 +2651,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2610,7 +2662,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <xsl:if test="*[1]=m:sum">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:sum/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2619,7 +2671,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <xsl:if test="*[1]=m:product">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:product/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2641,7 +2693,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <xsl:if test="*[1]=m:sum">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:sum/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2650,7 +2702,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
             <xsl:if test="*[1]=m:product">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:product/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -2668,7 +2720,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:limit[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2676,7 +2728,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:lim/@id"/>
           </xsl:attribute>
         </xsl:if>lim</m:mo>
@@ -2706,7 +2758,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                        self::m:arctan]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2730,7 +2782,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "*" mode="trigonometry">
   <m:mo>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2790,7 +2842,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:mean[1]]">
   <m:mfenced open="&lt;" close="&gt;" separators=",">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2803,14 +2855,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:sdev[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:sdev/@id"/>
           </xsl:attribute>
         </xsl:if>&#x003C3;</m:mo>
@@ -2825,14 +2877,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:variance[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:variance/@id"/>
           </xsl:attribute>
         </xsl:if>&#x003C3;</m:mo>
@@ -2850,14 +2902,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:median[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:median/@id"/>
           </xsl:attribute>
         </xsl:if>median</m:mo>
@@ -2872,14 +2924,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:mode[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:mode/@id"/>
           </xsl:attribute>
         </xsl:if>mode</m:mo>
@@ -2894,7 +2946,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:moment[1]]">
   <m:mfenced open="&lt;" close="&gt;" separators="">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2918,7 +2970,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match="m:vector">
   <m:mfenced separators="">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2935,7 +2987,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:matrix">
   <m:mfenced separators="">
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2948,7 +3000,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:matrixrow">
   <m:mtr>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2963,14 +3015,14 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:determinant[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:determinant/@id"/>
           </xsl:attribute>
         </xsl:if>det</m:mo>
@@ -2981,7 +3033,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
 <xsl:template match = "m:apply[m:transpose[1]]">
   <m:msup>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -2989,7 +3041,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
     <m:mo>
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:transpose/@id"/>
           </xsl:attribute>
         </xsl:if>T</m:mo>
@@ -3019,7 +3071,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
                                  m:scalarproduct[1] | m:outerproduct[1]]">
   <m:mrow>
     <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
+      <xsl:attribute name="xref">
         <xsl:value-of select="@id"/>
       </xsl:attribute>
     </xsl:if>
@@ -3028,7 +3080,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="m:vectorproduct[1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="m:vectorproduct/@id"/>
           </xsl:attribute>
         </xsl:if>
@@ -3037,7 +3089,7 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
       <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
 <!-- HELM: added -->        
         <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="m:xref">
+          <xsl:attribute name="xref">
             <xsl:value-of select="*[1]/@id"/>
           </xsl:attribute>
         </xsl:if>