šablona/atom.xsl
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:52:34 +0200
branchv_0
changeset 139 0246f4b2c827
parent 87 25dec6931f18
permissions -rw-r--r--
fix license version: GNU GPLv3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
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: 47
diff changeset
     2
<!--
9503eb8377f1 Licence: informace o licenci v každém souboru.
František Kučera <franta-hg@frantovo.cz>
parents: 47
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: 47
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: 47
diff changeset
     5
9503eb8377f1 Licence: informace o licenci v každém souboru.
František Kučera <franta-hg@frantovo.cz>
parents: 47
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: 47
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: 47
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: 47
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: 47
diff changeset
    10
9503eb8377f1 Licence: informace o licenci v každém souboru.
František Kučera <franta-hg@frantovo.cz>
parents: 47
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: 47
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: 47
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: 47
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: 47
diff changeset
    15
9503eb8377f1 Licence: informace o licenci v každém souboru.
František Kučera <franta-hg@frantovo.cz>
parents: 47
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: 47
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: 47
diff changeset
    18
-->
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
<xsl:stylesheet version="2.0"
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	xmlns="http://www.w3.org/2005/Atom"
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    21
	xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    22
	xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    26
	exclude-result-prefixes="fn s k j">
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	<xsl:output	method="xml" indent="yes" encoding="UTF-8"/>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    28
15
cfb2fc0ca242 Volitelná podpora zaostalých prohlížečů (MSIE).
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    29
	<xsl:param name="vstupníPřípona" select="'.xml'"/>
cfb2fc0ca242 Volitelná podpora zaostalých prohlížečů (MSIE).
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    30
	<xsl:param name="výstupníPřípona" select="'.xhtml'"/>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    31
21
2f50f9e10a27 drobnosti
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    32
	<xsl:template match="/">
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    33
47
97c25418c0e6 Přidáno varování při použití výchozího UUID (pro agregované výstupy).
František Kučera <franta-hg@frantovo.cz>
parents: 21
diff changeset
    34
		<xsl:if test="k:web/k:uuid = '399a714c-956e-444c-a8f4-afe8f0df802a'">
97c25418c0e6 Přidáno varování při použití výchozího UUID (pro agregované výstupy).
František Kučera <franta-hg@frantovo.cz>
parents: 21
diff changeset
    35
			<xsl:message>Vygenerujte si prosím svoje vlastní UUID pro agregované výstupy a uložte ho do souboru web.conf.</xsl:message>
97c25418c0e6 Přidáno varování při použití výchozího UUID (pro agregované výstupy).
František Kučera <franta-hg@frantovo.cz>
parents: 21
diff changeset
    36
			<!-- Nové UUID si můžete vygenerovat např. příkazem: uuidgen -->
97c25418c0e6 Přidáno varování při použití výchozího UUID (pro agregované výstupy).
František Kučera <franta-hg@frantovo.cz>
parents: 21
diff changeset
    37
		</xsl:if>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    38
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		<feed>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    40
			<title><xsl:value-of select="k:web/k:název"/></title>
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    41
			<subtitle><xsl:value-of select="k:web/k:podtitul"/></subtitle>
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    42
			<link rel="self" href="{concat(k:web/k:url, 'atom.xml')}"/>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    43
			<link href="{k:web/k:url}"/>
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    44
			<updated><xsl:value-of select="current-dateTime()"/></updated>	
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
			<author>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    46
				<name><xsl:value-of select="k:web/k:autor/k:jméno"/></name>
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    47
				<email><xsl:value-of select="k:web/k:autor/k:email"/></email>
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
			</author>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    49
			<id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    50
7
5b46493979c9 Atom – zjednodušení, #2
František Kučera <franta-hg@frantovo.cz>
parents: 6
diff changeset
    51
			<xsl:variable name="konfigurace" select="/"/>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    52
			<xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[empty(s:stránka/s:skrytá) or not(s:stránka/s:skrytá)]">
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
				<entry>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    54
					<title><xsl:value-of select="s:stránka/s:nadpis"/></title>
15
cfb2fc0ca242 Volitelná podpora zaostalých prohlížečů (MSIE).
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    55
					<xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    56
					<link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    57
					<id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
					<updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
18
45e41566f8a6 Nové jmenné prostory: „s“ a „k“ místo „g“.
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    59
					<summary><xsl:value-of select="s:stránka/s:perex"/></summary>
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
				</entry>
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
			</xsl:for-each>
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
			
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
		</feed>
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    64
	</xsl:template>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    65
6
801a8935caf7 Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
</xsl:stylesheet>
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 61
diff changeset
    67