]> matita.cs.unibo.it Git - helm.git/commitdiff
The patch of Irene to allow MathML presentation inside <m:ci>
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Nov 2001 18:07:59 +0000 (18:07 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Nov 2001 18:07:59 +0000 (18:07 +0000)
was not correct. As a consequence (but there were worst ones)
hyperlinks were not created to sub-scripted identifiers.
I have changed the patch. Though, I am not sure it is the correct one.
In particular, what happens if I put content markup inside the m:ci?
(It was recursively processed in the original stylesheet)

helm/style/mmlctop.xsl-0.14

index 4ab889155b1293fd5cfab544a816643e7889c290..ade27944aa038424e6755b845ff74dd010aa0bfb 100755 (executable)
@@ -515,9 +515,6 @@ LINEAR ALGEBRA
 
 <!-- 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">
@@ -564,21 +561,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="m: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>