]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlctop.xsl-0.14
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / style / mmlctop.xsl-0.14
index 4ab889155b1293fd5cfab544a816643e7889c290..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,23 +535,44 @@ 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>
 
 <!-- HELM: ci could not contain MAthML presentation -->
 <xsl:template match = "m:ci">
-<!-- HELM: added -->
-<xsl:choose>
-  <xsl:when test="child::text()">
 <!-- HELM -->
   <xsl:choose>
     <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>
@@ -533,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>
@@ -544,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>
@@ -556,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>
@@ -564,21 +613,22 @@ LINEAR ALGEBRA
         </m:mrow>
       </xsl:if>
       <xsl:if test="not(*[2])">
+<!--HELM: Was:
         <xsl:apply-templates select="*[1]"/>
+HELM: Now is: -->
+        <xsl:variable name="id" select="@id"/>
+        <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>
+<!-- HELM -->
       </xsl:if>
     </xsl:otherwise>
   </xsl:choose>
-<!-- HELM: added -->
-</xsl:when>
-  <xsl:otherwise>
-   <m:mrow>
-    <xsl:copy-of select="*"/>
-    <xsl:attribute name="m:xref">
-     <xsl:value-of select="@id"/>
-    </xsl:attribute>
-   </m:mrow> 
-  </xsl:otherwise>
- </xsl:choose>
 <!-- HELM -->
 </xsl:template>
 
@@ -590,7 +640,7 @@ LINEAR ALGEBRA
 <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 -->
@@ -639,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>
@@ -647,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>
@@ -666,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>
@@ -683,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>
@@ -704,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>
@@ -714,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>
@@ -791,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>
@@ -815,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>
@@ -841,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>
@@ -856,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>
@@ -867,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>
@@ -879,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>
@@ -893,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>
@@ -901,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>
@@ -924,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>
@@ -942,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>
@@ -953,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>
@@ -963,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>
@@ -973,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>
@@ -982,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>
@@ -1053,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>
@@ -1076,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>
@@ -1098,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>
@@ -1118,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>
@@ -1141,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>
@@ -1164,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>
@@ -1206,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>
@@ -1234,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>
@@ -1258,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>
@@ -1281,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>
@@ -1309,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>
@@ -1318,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>
@@ -1343,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>
@@ -1366,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>
@@ -1397,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>
@@ -1413,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>
@@ -1437,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>
@@ -1445,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>
@@ -1455,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>
@@ -1478,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>
@@ -1500,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>
@@ -1528,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>
@@ -1548,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>
@@ -1570,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>
@@ -1598,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>
@@ -1618,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>
@@ -1639,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>
@@ -1667,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>
@@ -1682,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>
@@ -1690,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>
@@ -1703,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>
@@ -1737,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>
@@ -1774,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>
@@ -1785,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>
@@ -1799,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>
@@ -1809,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>
@@ -1819,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>
@@ -1827,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>
@@ -1836,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>
@@ -1845,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>
@@ -1867,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>
@@ -1879,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>
@@ -1888,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>
@@ -1897,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>
@@ -1906,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>
@@ -1915,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>
@@ -1924,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>
@@ -1933,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>
@@ -1942,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>
@@ -1954,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>
@@ -1963,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>
@@ -1977,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>
@@ -1986,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>
@@ -1995,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>
@@ -2004,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>
@@ -2013,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>
@@ -2022,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>
@@ -2031,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>
@@ -2040,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>
@@ -2059,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>
@@ -2069,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>
@@ -2080,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>
@@ -2096,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>
@@ -2107,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>
@@ -2119,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>
@@ -2137,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>
@@ -2163,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>
@@ -2171,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>
@@ -2192,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>
@@ -2210,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>
@@ -2219,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>
@@ -2240,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>
@@ -2264,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>
@@ -2272,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>
@@ -2281,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>
@@ -2290,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>
@@ -2313,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>
@@ -2337,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>
@@ -2375,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>
@@ -2398,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>
@@ -2426,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>
@@ -2447,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>
@@ -2470,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>
@@ -2498,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>
@@ -2520,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>
@@ -2543,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>
@@ -2570,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>
@@ -2585,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>
@@ -2601,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>
@@ -2612,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>
@@ -2621,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>
@@ -2643,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>
@@ -2652,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>
@@ -2670,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>
@@ -2678,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>
@@ -2708,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>
@@ -2732,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>
@@ -2792,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>
@@ -2805,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>
@@ -2827,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>
@@ -2852,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>
@@ -2874,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>
@@ -2896,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>
@@ -2920,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>
@@ -2937,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>
@@ -2950,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>
@@ -2965,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>
@@ -2983,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>
@@ -2991,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>
@@ -3021,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>
@@ -3030,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>
@@ -3039,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>