1 <?xml version=
"1.0" encoding=
"UTF-8"?><!-- -*- xml-*- -->
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
21 ==========================================================================
22 | File..........: convert.xsl
23 | Author........: Marco A. Montava
24 | Date..........: 29-Jul-2006
25 | Description...: Conversor de diccionaris amb polisemia a tractament simple
26 ==========================================================================
29 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
30 <xsl:output method=
"xml" encoding=
"UTF-8" indent=
"no"/>
32 <xsl:template match=
"/">
33 <xsl:value-of select=
"string('
')"/><!-- \n -->
34 <xsl:apply-templates select=
"dictionary"/>
37 <xsl:template match=
"dictionary">
38 <dictionary><xsl:value-of select=
"string('
')"/><!-- \n -->
39 <xsl:copy-of select=
"alphabet"/> <xsl:value-of select=
"string('
')"/><!-- \n -->
40 <xsl:copy-of select=
"sdefs"/> <xsl:value-of select=
"string('
')"/><!-- \n -->
41 <xsl:copy-of select=
"pardefs"/> <xsl:value-of select=
"string('
')"/><!-- \n -->
42 <xsl:apply-templates select=
"section"/>
43 </dictionary><xsl:value-of select=
"string('
')"/><!-- \n -->
46 <xsl:template match=
"section">
47 <xsl:value-of select=
"string('
')"/><!-- \n -->
48 <section id='{@id}' type='{@type}'
><xsl:value-of select=
"string('
')"/><!-- \n -->
49 <xsl:apply-templates />
50 </section><xsl:value-of select=
"string('
')"/><!-- \n -->
56 <xsl:template match=
"e[@slr|@srl]"> <!-- si te problemes de polisemia -->
58 <!-- si te conflicte L-R y R-L -->
59 <xsl:when test=
"./@slr!='' and ./@srl!='' ">
61 <!-- si es per Defecte R-L i L-R-->
62 <xsl:when test=
"substring(./@srl,(string-length(./@srl)-1),2)=' D' and substring(./@slr,(string-length(./@slr)-1),2)=' D' ">
63 <e><xsl:value-of select=
"string('
')"/><!-- \n -->
64 <xsl:copy-of select=
"*"/>
65 <xsl:value-of select=
"string('
')"/><!-- \n -->
68 <!-- si es per Defecte L-R -->
69 <xsl:when test=
"substring(./@slr,(string-length(./@slr)-1),2)=' D'">
70 <e r=
"LR"><xsl:value-of select=
"string('
')"/><!-- \n -->
71 <xsl:copy-of select=
"*"/>
72 <xsl:value-of select=
"string('
')"/><!-- \n -->
75 <!-- si es per Defecte R-L -->
76 <xsl:when test=
"substring(./@srl,(string-length(./@srl)-1),2)=' D'">
77 <e r=
"RL"><xsl:value-of select=
"string('
')"/><!-- \n -->
78 <xsl:copy-of select=
"*"/>
79 <xsl:value-of select=
"string('
')"/><!-- \n -->
82 <!-- **** si no es per defecte cap, llavors s'elimina, s'ignora **** -->
85 <!-- si sols te conflicte R-L -->
86 <xsl:when test=
"./@srl!='' ">
88 <!-- si es la solucio per Defecte R-L i te restriccio RL-->
89 <xsl:when test=
"substring(./@srl,(string-length(./@srl)-1),2)=' D' and ./@r='RL'">
90 <e r=
"RL"><xsl:value-of select=
"string('
')"/><!-- \n -->
91 <xsl:copy-of select=
"*"/>
92 <xsl:value-of select=
"string('
')"/><!-- \n -->
95 <!-- si es la solucio per Defecte R-L -->
96 <xsl:when test=
"substring(./@srl,(string-length(./@srl)-1),2)=' D' ">
97 <e><xsl:value-of select=
"string('
')"/><!-- \n -->
98 <xsl:copy-of select=
"*"/>
99 <xsl:value-of select=
"string('
')"/><!-- \n -->
102 <!-- si no es la solucio per Defecte R-L i te restriccio RL-->
103 <xsl:when test=
"@r='RL' ">
106 <!-- si no es la solucio per Defecte R-L -->
108 <e r=
"LR"><xsl:value-of select=
"string('
')"/><!-- \n -->
109 <xsl:copy-of select=
"*"/>
110 <xsl:value-of select=
"string('
')"/><!-- \n -->
115 <!-- si sols te conflicte L-R -->
116 <xsl:when test=
"./@slr!=''">
118 <!-- si es la solucio per Defecte L-R i te restriccio LR-->
119 <xsl:when test=
"substring(./@slr,(string-length(./@slr)-1),2)=' D' and ./@r='LR'">
120 <e r=
"LR"><xsl:value-of select=
"string('
')"/><!-- \n -->
121 <xsl:copy-of select=
"*"/>
122 <xsl:value-of select=
"string('
')"/><!-- \n -->
125 <!-- si es la solucio per Defecte L-R -->
126 <xsl:when test=
"substring(./@slr,(string-length(./@slr)-1),2)=' D' ">
127 <e><xsl:value-of select=
"string('
')"/><!-- \n -->
128 <xsl:copy-of select=
"*"/>
129 <xsl:value-of select=
"string('
')"/><!-- \n -->
132 <!-- si no es la solucio per Defecte L-R i te restriccio LR-->
133 <xsl:when test=
"@r='LR' ">
136 <!-- si no es la solucio per Defecte L-R -->
138 <e r=
"RL"><xsl:value-of select=
"string('
')"/><!-- \n -->
139 <xsl:copy-of select=
"*"/>
140 <xsl:value-of select=
"string('
')"/><!-- \n -->
148 <xsl:template match=
"e[not(@slr|@srl)]"> <!-- elements sense polisemia -->
149 <xsl:copy-of select =
"."/>