updated on Sun Jan 15 08:01:04 UTC 2012
[aur-mirror.git] / apertium-mk-en / lexchoicebil.xsl
blobc72e5c075d71f59f892118a70f881d3849e76313
1 <?xml version="1.0" encoding="UTF-8"?> <!-- -*- nxml -*- -->
2 <!--
3 Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 02111-1307, USA.
19 -->
20 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21 <xsl:output method="xml" encoding="UTF-8"/>
22 <xsl:param name="r2l"/>
24 <xsl:template match="s">
25 <s n="{./@n}"/>
26 </xsl:template>
28 <xsl:template match="b">
29 <b/>
30 </xsl:template>
32 <xsl:template match="g">
33 <g><xsl:apply-templates/></g>
34 </xsl:template>
36 <xsl:template match="a">
37 <a/>
38 </xsl:template>
40 <xsl:template match="j">
41 <j/>
42 </xsl:template>
44 <xsl:template match="l">
45 <xsl:apply-templates select="./*|text()"/>
46 </xsl:template>
48 <xsl:template match="r">
49 <xsl:apply-templates select="./*|text()"/>
50 </xsl:template>
52 <xsl:template match="par">
53 <par n="{./@n}"/>
54 </xsl:template>
56 <xsl:template match="re">
57 <re><xsl:apply-templates/></re>
58 </xsl:template>
60 <xsl:template match="p">
61 <p>
62 <xsl:choose>
63 <xsl:when test="not(count(../@slr)=0)">
64 <l><xsl:apply-templates select="./l/text()|./l/*[not(name(.)=string('s'))]"/>:<xsl:apply-templates select="../@slr"/><xsl:apply-templates select="./l/*[name(.)=string('s')]"/></l>
65 </xsl:when>
66 <xsl:otherwise>
67 <l><xsl:apply-templates select="./l/*|./l/text()"/></l>
68 </xsl:otherwise>
69 </xsl:choose>
70 <r><xsl:apply-templates select="./r/*|./r/text()"/></r>
71 </p>
72 </xsl:template>
75 <xsl:template match="i">
76 <p>
77 <xsl:choose>
78 <xsl:when test="not(count(../@slr)=0)">
79 <l><xsl:apply-templates select="text()|*[not(name(.)=string('s'))]"/>:<xsl:apply-templates select="../@slr"/><xsl:apply-templates select="*[name(.)=string('s')]"/></l>
80 </xsl:when>
81 <xsl:otherwise>
82 <l><xsl:apply-templates select="*|text()"/></l>
83 </xsl:otherwise>
84 </xsl:choose>
85 <r><xsl:apply-templates select="*|text()"/></r>
86 </p>
87 </xsl:template>
90 <xsl:template match="e">
91 <xsl:choose>
92 <xsl:when test="not(count(./@r)=0)">
93 <e r="{./@r}"><xsl:apply-templates select="./*"/></e>
94 </xsl:when>
95 <xsl:otherwise>
96 <e><xsl:apply-templates select="./*"/></e>
97 </xsl:otherwise>
98 </xsl:choose>
99 </xsl:template>
102 <xsl:template match="dictionary">
103 <dictionary>
104 <xsl:value-of select="string('&#xA;')"/>
105 <xsl:copy-of select="./alphabet"/>
106 <xsl:value-of select="string('&#xA;')"/>
107 <xsl:copy-of select="./sdefs"/>
108 <xsl:value-of select="string('&#xA;')"/>
109 <xsl:if test="not(count(./pardefs/pardef)=0)">
110 <pardefs>
111 <xsl:value-of select="string('&#xA;')"/>
113 <xsl:for-each select="./pardefs/pardef">
114 <xsl:value-of select="string('&#xA;')"/>
116 <pardef n="{./@n}">
117 <xsl:apply-templates/>
118 </pardef>
119 </xsl:for-each>
120 <xsl:value-of select="string('&#xA;')"/>
122 </pardefs>
123 </xsl:if>
124 <xsl:value-of select="string('&#xA;')"/>
126 <xsl:for-each select="./section">
127 <section id="{./@id}" type="{./@type}">
128 <xsl:apply-templates/>
129 </section>
131 </xsl:for-each>
133 </dictionary>
135 </xsl:template>
138 </xsl:stylesheet>