]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/xsl/d-xsl.xsl
ocaml 3.09 transition
[helm.git] / helm / DEVEL / mathml_editor / xsl / d-xsl.xsl
1 <?xml version="1.0"?>
2
3 <!--
4  This file is part of EdiTeX, an editor of mathematical
5  expressions based on TeX syntax.
6  
7  Copyright (C) 2002-2003 Luca Padovani <lpadovan@cs.unibo.it>,
8                     2003 Paolo Marinelli <pmarinel@cs.unibo.it>.
9
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  Lesser General Public License for more details.
19
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
24  For more information, please visit the project's home page
25  http://helm.cs.unibo.it/editex/
26  or send an email to <lpadovan@cs.unibo.it>
27 -->
28
29 <xsl2:stylesheet
30   version="1.0"
31   xmlns:xsl2="http://www.w3.org/1999/XSL/Transform"
32   xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias"
33   xmlns:tml="http://helm.cs.unibo.it/2002/TML">
34
35 <xsl:namespace-alias stylesheet-prefix="xsl" result-prefix="xsl2"/>
36
37 <xsl2:template match="/">
38   <xsl:stylesheet version="1.0">
39     <xsl:template match="tml:tex">
40       <xsl:apply-templates select="*"/>
41     </xsl:template>
42
43     <xsl:template match="tml:i">
44       <xsl:element name="xxx">
45         <xsl:if test="@id">
46           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
47         </xsl:if>
48         <xsl:value-of select="@val"/>
49       </xsl:element>
50     </xsl:template>
51
52     <xsl:template match="tml:n">
53       <xsl:element name="xxx">
54         <xsl:if test="@id">
55           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
56         </xsl:if>
57         <xsl:value-of select="@val"/>
58       </xsl:element>
59     </xsl:template>
60
61     <xsl:template match="tml:o">
62       <xsl:element name="xxx">
63         <xsl:if test="@id">
64           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
65         </xsl:if>
66         <xsl:value-of select="@val"/>
67       </xsl:element>
68     </xsl:template>
69
70     <xsl:template match="tml:cursor">
71       <xsl:element name="xxx">
72         <xsl:if test="@id">
73           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
74         </xsl:if>
75         <xsl:value-of select="@val"/>
76       </xsl:element>
77     </xsl:template>
78
79     <xsl:template match="tml:sb[@under='1']">
80       <xsl:element name="xxx">
81         <xsl:if test="@id">
82           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
83         </xsl:if>
84         <xsl:apply-templates select="*[1]"/>
85         <xsl:apply-templates select="*[2]"/>
86       </xsl:element>
87     </xsl:template>
88
89     <xsl:template match="tml:sb">
90       <xsl:element name="xxx">
91         <xsl:if test="@id">
92           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
93         </xsl:if>
94         <xsl:apply-templates select="*[1]"/>
95         <xsl:apply-templates select="*[2]"/>
96       </xsl:element>
97     </xsl:template>
98
99     <xsl:template match="tml:sb[@over='1']">
100       <xsl:element name="xxx">
101         <xsl:if test="@id">
102           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
103         </xsl:if>
104         <xsl:apply-templates select="*[1]"/>
105         <xsl:apply-templates select="*[2]"/>
106       </xsl:element>
107     </xsl:template>
108
109     <xsl:template match="tml:sp">
110       <xsl:element name="xxx">
111         <xsl:if test="@id">
112           <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
113         </xsl:if>
114         <xsl:apply-templates select="*[1]"/>
115         <xsl:apply-templates select="*[2]"/>
116       </xsl:element>
117     </xsl:template>
118
119     <xsl:template match="tml:g[@id]">
120       <xsl:element name="xxx">
121         <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
122         <xsl:apply-templates select="*"/>
123       </xsl:element>
124     </xsl:template>
125
126     <xsl:template match="tml:g">
127       <xsl:element name="xxx">
128         <xsl:apply-templates select="*"/>
129       </xsl:element>
130     </xsl:template>
131
132     <xsl:template match="tml:row">
133       <xsl:apply-templates select="cell"/>
134     </xsl:template>
135
136     <xsl:template match="tml:cell">
137       <xsl:apply-templates select="*"/>
138     </xsl:template>
139     
140     <xsl2:comment>/// CONTROL SEQUENCES ///</xsl2:comment>
141
142     <xsl2:apply-templates/>
143   </xsl:stylesheet>
144 </xsl2:template>
145
146 <xsl2:template match="entry[not(@class) or @class='m']">
147   <xsl:template match="tml:c[@name='{@name}']">
148     <xsl2:comment><xsl2:value-of select="concat(' ',@name,' ')"/></xsl2:comment>
149     <xsl:element name="xxx">
150       <xsl:if test="@id">
151         <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
152       </xsl:if>
153       <xsl:apply-templates select="*"/>
154     </xsl:element>
155   </xsl:template>
156 </xsl2:template>
157
158 </xsl2:stylesheet>
159