summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl')
-rw-r--r--Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl43
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl b/Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl
new file mode 100644
index 00000000000..9f854abee37
--- /dev/null
+++ b/Master/texmf-dist/source/latex/stex/xsl/ltxml2cnx.xsl
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ltx="http://dlmf.nist.gov/LaTeXML"
+ xmlns='http://cnx.rice.edu/cnxml'
+ xmlns:m='http://www.w3.org/1998/Math/MathML'
+ xmlns:md="http://cnx.rice.edu/mdml/0.4"
+ xmlns:bib="http://bibtexml.sf.net/"
+ exclude-result-prefixes="ltx md bib"
+ version="1.0">
+
+ <xsl:output method="xml" indent="yes"
+ doctype-public="-//CNX//DTD CNXML 0.5 plus MathML//EN"
+ doctype-system="http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd"/>
+
+ <xsl:strip-space elements="*"/>
+
+<!-- if there is no other template, give a warning -->
+<!-- <xsl:template match="*">
+ <xsl:message>Cannot deal with element <xsl:value-of select="local-name()"/> yet! (id=<xsl:value-of select="@xml:id"/>)</xsl:message>
+ <xsl:comment>elided element <xsl:value-of select="local-name()"/></xsl:comment>
+ </xsl:template> -->
+
+ <xsl:template match="*">
+ <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates/></xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="ltx:Math">
+ <xsl:copy-of select="m:math"/>
+ </xsl:template>
+
+<xsl:template match="ltx:*">
+ <xsl:element name="{local-name()}">
+ <xsl:copy-of select="@*"/><xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="ltx:tabular">
+ <table>
+ <xsl:copy-of select="@*"/><xsl:apply-templates/>
+ </table>
+</xsl:template>
+
+</xsl:stylesheet>