franta-hg@51
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
franta-hg@61
|
2 |
<!--
|
franta-hg@61
|
3 |
XML Web generátor – program na generování webových stránek
|
franta-hg@61
|
4 |
Copyright © 2012 František Kučera (frantovo.cz)
|
franta-hg@61
|
5 |
|
franta-hg@61
|
6 |
This program is free software: you can redistribute it and/or modify
|
franta-hg@61
|
7 |
it under the terms of the GNU General Public License as published by
|
franta-hg@61
|
8 |
the Free Software Foundation, either version 3 of the License, or
|
franta-hg@61
|
9 |
(at your option) any later version.
|
franta-hg@61
|
10 |
|
franta-hg@61
|
11 |
This program is distributed in the hope that it will be useful,
|
franta-hg@61
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
franta-hg@61
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
franta-hg@61
|
14 |
GNU General Public License for more details.
|
franta-hg@61
|
15 |
|
franta-hg@61
|
16 |
You should have received a copy of the GNU General Public License
|
franta-hg@61
|
17 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
franta-hg@61
|
18 |
-->
|
franta-hg@51
|
19 |
<xsl:stylesheet version="2.0"
|
franta-hg@51
|
20 |
xmlns="http://www.w3.org/1999/xhtml"
|
franta-hg@51
|
21 |
xmlns:h="http://www.w3.org/1999/xhtml"
|
franta-hg@51
|
22 |
xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
|
franta-hg@51
|
23 |
xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
|
franta-hg@51
|
24 |
xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
|
franta-hg@51
|
25 |
xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
|
franta-hg@51
|
26 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
franta-hg@51
|
27 |
xmlns:fn="http://www.w3.org/2005/xpath-functions"
|
franta-hg@51
|
28 |
xmlns:svg="http://www.w3.org/2000/svg"
|
franta-hg@51
|
29 |
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
franta-hg@51
|
30 |
exclude-result-prefixes="fn h s k m j xs">
|
franta-hg@51
|
31 |
|
franta-hg@51
|
32 |
<xsl:param name="vstup" select="'../vstup/'"/>
|
franta-hg@51
|
33 |
<xsl:param name="výstup" select="'../výstup/'"/>
|
franta-hg@51
|
34 |
<xsl:param name="vstupníPřípona" select="'.xml'"/>
|
franta-hg@51
|
35 |
<xsl:param name="výstupníPřípona" select="'.xhtml'"/>
|
franta-hg@51
|
36 |
<xsl:param name="vsuvkováPřípona" select="'.inc'"/>
|
franta-hg@51
|
37 |
<xsl:param name="podporaZaostalýchProhlížečů" select="false()" as="xs:boolean"/>
|
franta-hg@51
|
38 |
|
franta-hg@51
|
39 |
<xsl:variable name="konfigurace" select="document(concat($vstup, 'web.conf'))"/>
|
franta-hg@51
|
40 |
|
franta-hg@51
|
41 |
<xsl:include href=".makra-seznam.xsl"/>
|
franta-hg@51
|
42 |
|
franta-hg@51
|
43 |
|
franta-hg@51
|
44 |
<!-- Kopírujeme elementy, ale vynecháme nepoužité xmlns deklarace: -->
|
franta-hg@51
|
45 |
<xsl:template match="*">
|
franta-hg@51
|
46 |
<xsl:element name="{name()}">
|
franta-hg@51
|
47 |
<xsl:copy-of select="@*"/>
|
franta-hg@51
|
48 |
<xsl:apply-templates/>
|
franta-hg@51
|
49 |
</xsl:element>
|
franta-hg@51
|
50 |
</xsl:template>
|
franta-hg@51
|
51 |
|
franta-hg@51
|
52 |
<!-- Varování pro případ, že jsme v režimu podpory pro zaostalé prohlížeče -->
|
franta-hg@51
|
53 |
<xsl:template name="varováníRetardace">
|
franta-hg@51
|
54 |
<xsl:if test="$podporaZaostalýchProhlížečů">
|
franta-hg@51
|
55 |
<xsl:comment>
|
franta-hg@51
|
56 |
Generátor byl spuštěn v režimu podpory zaostalých prohlížečů.
|
franta-hg@51
|
57 |
Uživatelům doporučujeme upgrade na skutečný WWW prohlížeč,
|
franta-hg@51
|
58 |
jako je např. Firefox nebo Chromium (případně Opera či Safari).
|
franta-hg@51
|
59 |
</xsl:comment>
|
franta-hg@51
|
60 |
</xsl:if>
|
franta-hg@51
|
61 |
</xsl:template>
|
franta-hg@51
|
62 |
|
franta-hg@51
|
63 |
<!-- Odkazy na JavaScript a kaskádové styly -->
|
franta-hg@51
|
64 |
<xsl:template match="k:web/k:js">
|
franta-hg@51
|
65 |
<script src="{text()}" type="text/javascript">
|
franta-hg@51
|
66 |
<xsl:call-template name="varováníRetardace"/>
|
franta-hg@51
|
67 |
</script>
|
franta-hg@51
|
68 |
</xsl:template>
|
franta-hg@51
|
69 |
<xsl:template match="k:web/k:css">
|
franta-hg@51
|
70 |
<link href="{text()}" type="text/css" rel="StyleSheet" />
|
franta-hg@51
|
71 |
</xsl:template>
|
franta-hg@51
|
72 |
|
franta-hg@71
|
73 |
<xsl:function name="m:escapuj-url-zachovej-lomítka" as="xs:string">
|
franta-hg@71
|
74 |
<xsl:param name="cesta"/>
|
franta-hg@71
|
75 |
<xsl:value-of select="replace(encode-for-uri($cesta), '%2F', '/')"/>
|
franta-hg@71
|
76 |
</xsl:function>
|
franta-hg@71
|
77 |
|
franta-hg@71
|
78 |
<!--
|
franta-hg@71
|
79 |
Vrací obsah textového souboru ve vstupním adresáři.
|
franta-hg@71
|
80 |
Obvykle jako parametr předáváme atribut „src“.
|
franta-hg@71
|
81 |
-->
|
franta-hg@71
|
82 |
<xsl:function name="m:načti-textový-soubor" as="xs:string">
|
franta-hg@71
|
83 |
<xsl:param name="soubor"/>
|
franta-hg@71
|
84 |
<xsl:value-of select="unparsed-text(concat($vstup, $soubor))"/>
|
franta-hg@71
|
85 |
</xsl:function>
|
franta-hg@71
|
86 |
|
franta-hg@51
|
87 |
</xsl:stylesheet>
|