17 along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 --> |
18 --> |
19 <xsl:stylesheet version="2.0" |
19 <xsl:stylesheet version="2.0" |
20 xmlns="http://www.w3.org/1999/xhtml" |
20 xmlns="http://www.w3.org/1999/xhtml" |
21 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
21 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
|
22 xmlns:xs="http://www.w3.org/2001/XMLSchema" |
22 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
23 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
23 exclude-result-prefixes="m"> |
24 exclude-result-prefixes="m xs"> |
24 |
25 |
25 <!-- |
26 <!-- |
26 Interní odkazy |
27 Interní odkazy |
27 ************** |
28 ************** |
28 Slouží k vkládání odkazů na jiné stránky v rámci webu. |
29 Slouží k vkládání odkazů na jiné stránky v rámci webu. |
49 --> |
52 --> |
50 <xsl:template match="m:a[@typ='trac' and not(number(@href))]"> |
53 <xsl:template match="m:a[@typ='trac' and not(number(@href))]"> |
51 <xsl:call-template name="vložOdkaz"> |
54 <xsl:call-template name="vložOdkaz"> |
52 <xsl:with-param name="url" select=" |
55 <xsl:with-param name="url" select=" |
53 concat( |
56 concat( |
54 'https://trac.frantovo.cz/xml-web-generator/wiki/', |
57 $tracURL, '/wiki/', |
55 replace(encode-for-uri(@href), '%2F', '/') |
58 m:escapuj-url-zachovej-lomítka(@href) |
56 )"/> |
59 )"/> |
57 </xsl:call-template> |
60 </xsl:call-template> |
58 </xsl:template> |
61 </xsl:template> |
59 |
62 |
60 <!-- |
63 <!-- |
61 Trac – úkoly |
64 Trac – úkoly |
62 ************ |
65 ************ |
63 Odkazy na Trac našeho generátoru. |
66 Odkazy na Trac našeho generátoru. |
64 * |
67 * |
66 --> |
69 --> |
67 <xsl:template match="m:a[@typ='trac' and number(@href)]"> |
70 <xsl:template match="m:a[@typ='trac' and number(@href)]"> |
68 <xsl:call-template name="vložOdkaz"> |
71 <xsl:call-template name="vložOdkaz"> |
69 <xsl:with-param name="url" select=" |
72 <xsl:with-param name="url" select=" |
70 concat( |
73 concat( |
71 'https://trac.frantovo.cz/xml-web-generator/ticket/', |
74 $tracURL, '/ticket/', |
72 @href |
75 @href |
73 )"/> |
76 )"/> |
74 </xsl:call-template> |
77 </xsl:call-template> |
75 </xsl:template> |
78 </xsl:template> |
|
79 |
|
80 <!-- |
|
81 Zdroják |
|
82 ******* |
|
83 Odkazy zdrojový kód našeho generátoru. |
|
84 * |
|
85 @href název souboru |
|
86 @řádek číslo řádku (volitelně) |
|
87 --> |
|
88 <xsl:template match="m:a[@typ='zdroják' and (not(@řádek) or number(@řádek))]"> |
|
89 <xsl:call-template name="vložOdkaz"> |
|
90 <xsl:with-param name="url" select=" |
|
91 concat( |
|
92 $tracURL, '/browser/', |
|
93 m:escapuj-url-zachovej-lomítka(@href), |
|
94 '#L', |
|
95 (@řádek,'1')[1] |
|
96 )"/> |
|
97 </xsl:call-template> |
|
98 </xsl:template> |
|
99 |
|
100 <xsl:function name="m:escapuj-url-zachovej-lomítka" as="xs:string"> |
|
101 <xsl:param name="cesta"/> |
|
102 <xsl:value-of select="replace(encode-for-uri($cesta), '%2F', '/')"/> |
|
103 </xsl:function> |
76 |
104 |
77 <!-- |
105 <!-- |
78 Wikipedia |
106 Wikipedia |
79 ********* |
107 ********* |
80 Stránka v encyklopedii. |
108 Stránka v encyklopedii. |
164 |
192 |
165 |
193 |
166 <xsl:template name="vložOdkaz"> |
194 <xsl:template name="vložOdkaz"> |
167 <xsl:param name="url"/> |
195 <xsl:param name="url"/> |
168 <a> |
196 <a> |
169 <xsl:copy-of select="@*"/> |
197 <!-- Zachováme pouze povolené atributy: --> |
|
198 |
|
199 <xsl:copy-of select="@charset"/> |
|
200 <xsl:copy-of select="@coords"/> |
|
201 <xsl:copy-of select="@hreflang"/> |
|
202 <xsl:copy-of select="@name"/> |
|
203 <xsl:copy-of select="@rel"/> |
|
204 <xsl:copy-of select="@rev"/> |
|
205 <xsl:copy-of select="@shape"/> |
|
206 <xsl:copy-of select="@target"/> <!-- Pozor: nepatří do striktního XHTML --> |
|
207 |
|
208 <xsl:copy-of select="@accesskey"/> |
|
209 <xsl:copy-of select="@class"/> |
|
210 <xsl:copy-of select="@dir"/> |
|
211 <xsl:copy-of select="@id"/> |
|
212 <xsl:copy-of select="@lang"/> |
|
213 <xsl:copy-of select="@style"/> |
|
214 <xsl:copy-of select="@tabindex"/> |
|
215 <xsl:copy-of select="@title"/> |
|
216 <xsl:copy-of select="@xml:lang"/> |
|
217 |
|
218 <xsl:copy-of select="@onblur"/> |
|
219 <xsl:copy-of select="@onclick"/> |
|
220 <xsl:copy-of select="@ondblclick"/> |
|
221 <xsl:copy-of select="@onfocus"/> |
|
222 <xsl:copy-of select="@onmousedown"/> |
|
223 <xsl:copy-of select="@onmousemove"/> |
|
224 <xsl:copy-of select="@onmouseout"/> |
|
225 <xsl:copy-of select="@onmouseover"/> |
|
226 <xsl:copy-of select="@onmouseup"/> |
|
227 <xsl:copy-of select="@onkeydown"/> |
|
228 <xsl:copy-of select="@onkeypress"/> |
|
229 <xsl:copy-of select="@onkeyup"/> |
|
230 |
170 <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute> |
231 <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute> |
171 <xsl:apply-templates/> |
232 <xsl:apply-templates/> |
172 </a> |
233 </a> |
173 </xsl:template> |
234 </xsl:template> |
174 |
235 |