]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/xsl/d-xsl.xsl
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / xsl / d-xsl.xsl
diff --git a/helm/DEVEL/mathml_editor/xsl/d-xsl.xsl b/helm/DEVEL/mathml_editor/xsl/d-xsl.xsl
new file mode 100644 (file)
index 0000000..2ef6083
--- /dev/null
@@ -0,0 +1,131 @@
+<xsl2:stylesheet
+  version="1.0"
+  xmlns:xsl2="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias"
+  xmlns:tml="http://helm.cs.unibo.it/2002/TML">
+
+<xsl:namespace-alias stylesheet-prefix="xsl" result-prefix="xsl2"/>
+
+<xsl2:template match="/">
+  <xsl:stylesheet version="1.0">
+    <xsl:template match="tml:tex">
+      <xsl:apply-templates select="*"/>
+    </xsl:template>
+
+    <xsl:template match="tml:i">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:value-of select="@val"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:n">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:value-of select="@val"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:o">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:value-of select="@val"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:cursor">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:value-of select="@val"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:sb[@under='1']">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[1]"/>
+        <xsl:apply-templates select="*[2]"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:sb">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[1]"/>
+        <xsl:apply-templates select="*[2]"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:sb[@over='1']">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[1]"/>
+        <xsl:apply-templates select="*[2]"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:sp">
+      <xsl:element name="xxx">
+        <xsl:if test="@id">
+          <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[1]"/>
+        <xsl:apply-templates select="*[2]"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:g[@id]">
+      <xsl:element name="xxx">
+        <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+        <xsl:apply-templates select="*"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:g">
+      <xsl:element name="xxx">
+        <xsl:apply-templates select="*"/>
+      </xsl:element>
+    </xsl:template>
+
+    <xsl:template match="tml:row">
+      <xsl:apply-templates select="cell"/>
+    </xsl:template>
+
+    <xsl:template match="tml:cell">
+      <xsl:apply-templates select="*"/>
+    </xsl:template>
+    
+    <xsl2:comment>/// CONTROL SEQUENCES ///</xsl2:comment>
+
+    <xsl2:apply-templates/>
+  </xsl:stylesheet>
+</xsl2:template>
+
+<xsl2:template match="entry[not(@class) or @class='m']">
+  <xsl:template match="tml:c[@name='{@name}']">
+    <xsl2:comment><xsl2:value-of select="concat(' ',@name,' ')"/></xsl2:comment>
+    <xsl:element name="xxx">
+      <xsl:if test="@id">
+        <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates select="*"/>
+    </xsl:element>
+  </xsl:template>
+</xsl2:template>
+
+</xsl2:stylesheet>
+