summaryrefslogtreecommitdiff
path: root/tex/context/base/x-sm2om.xsl
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2006-04-27 15:59:00 +0200
committerHans Hagen <pragma@wxs.nl>2006-04-27 15:59:00 +0200
commit7310101ce7739889fd4681864978f2c71722bbd6 (patch)
treef8780be74d43b16975221aa97c265d3ecc02debf /tex/context/base/x-sm2om.xsl
parent907edcfcac423f52f1b960a94a3242a0501c7afa (diff)
downloadcontext-7310101ce7739889fd4681864978f2c71722bbd6.tar.gz
stable 2006.04.27 15:59
Diffstat (limited to 'tex/context/base/x-sm2om.xsl')
-rw-r--r--tex/context/base/x-sm2om.xsl79
1 files changed, 79 insertions, 0 deletions
diff --git a/tex/context/base/x-sm2om.xsl b/tex/context/base/x-sm2om.xsl
new file mode 100644
index 000000000..022d37355
--- /dev/null
+++ b/tex/context/base/x-sm2om.xsl
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="xml"/>
+
+ <xsl:template match ="processing-instruction()"><xsl:copy/><xsl:text>
+ </xsl:text></xsl:template>
+
+ <xsl:template match = "node()|@*" >
+ <xsl:copy>
+ <xsl:apply-templates select = "node()|@*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment"></xsl:template>
+
+ <xsl:variable name='openmath-to-content-mathml'><value-of select='$stylesheet-path'/>/x-openmath.xsl</xsl:variable>
+
+ <xsl:template match='i|n'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMI">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match='v'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMV">
+ <xsl:attribute name="name"><xsl:apply-templates/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- r a/b split in two parts -->
+
+ <xsl:template match='r'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMA">
+ <xsl:element name="OMS">
+ <xsl:attribute name="cd">interval1</xsl:attribute>
+ <xsl:attribute name="name">interval_oo</xsl:attribute>
+ </xsl:element>
+ <xsl:choose>
+ <xsl:when test="not(number(substring-before(translate(text(),',','.'),':')))">
+ <xsl:element name="OMV">
+ <xsl:attribute name="name"><xsl:value-of select="substring-before(text(),':')"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="OMI">
+ <xsl:value-of select="substring-before(text(),':')"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="not(number(substring-after(translate(text(),',','.'),':')))">
+ <xsl:element name="OMV">
+ <xsl:attribute name="name"><xsl:value-of select="substring-after(text(),':')"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="OMI">
+ <xsl:value-of select="substring-after(text(),':')"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+</xsl:stylesheet>