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