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