šablona/atom.xsl
author František Kučera <franta-hg@frantovo.cz>
Thu Oct 24 22:06:44 2019 +0200 (2019-10-24)
changeset 136 d5feb9d8ebc3
parent 87 25dec6931f18
permissions -rw-r--r--
fix license version: GNU GPLv3
franta-hg@6
     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@136
     8
the Free Software Foundation, version 3 of the License.
franta-hg@61
     9
franta-hg@61
    10
This program is distributed in the hope that it will be useful,
franta-hg@61
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@61
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
franta-hg@61
    13
GNU General Public License for more details.
franta-hg@61
    14
franta-hg@61
    15
You should have received a copy of the GNU General Public License
franta-hg@61
    16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
franta-hg@61
    17
-->
franta-hg@6
    18
<xsl:stylesheet version="2.0"
franta-hg@6
    19
	xmlns="http://www.w3.org/2005/Atom"
franta-hg@18
    20
	xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
franta-hg@18
    21
	xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
franta-hg@6
    22
	xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
franta-hg@6
    23
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
franta-hg@6
    24
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
franta-hg@18
    25
	exclude-result-prefixes="fn s k j">
franta-hg@6
    26
	<xsl:output	method="xml" indent="yes" encoding="UTF-8"/>
franta-hg@87
    27
franta-hg@15
    28
	<xsl:param name="vstupníPřípona" select="'.xml'"/>
franta-hg@15
    29
	<xsl:param name="výstupníPřípona" select="'.xhtml'"/>
franta-hg@87
    30
franta-hg@21
    31
	<xsl:template match="/">
franta-hg@87
    32
franta-hg@47
    33
		<xsl:if test="k:web/k:uuid = '399a714c-956e-444c-a8f4-afe8f0df802a'">
franta-hg@47
    34
			<xsl:message>Vygenerujte si prosím svoje vlastní UUID pro agregované výstupy a uložte ho do souboru web.conf.</xsl:message>
franta-hg@47
    35
			<!-- Nové UUID si můžete vygenerovat např. příkazem: uuidgen -->
franta-hg@47
    36
		</xsl:if>
franta-hg@87
    37
franta-hg@6
    38
		<feed>
franta-hg@18
    39
			<title><xsl:value-of select="k:web/k:název"/></title>
franta-hg@18
    40
			<subtitle><xsl:value-of select="k:web/k:podtitul"/></subtitle>
franta-hg@18
    41
			<link rel="self" href="{concat(k:web/k:url, 'atom.xml')}"/>
franta-hg@87
    42
			<link href="{k:web/k:url}"/>
franta-hg@87
    43
			<updated><xsl:value-of select="current-dateTime()"/></updated>	
franta-hg@6
    44
			<author>
franta-hg@18
    45
				<name><xsl:value-of select="k:web/k:autor/k:jméno"/></name>
franta-hg@18
    46
				<email><xsl:value-of select="k:web/k:autor/k:email"/></email>
franta-hg@6
    47
			</author>
franta-hg@18
    48
			<id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
franta-hg@87
    49
franta-hg@7
    50
			<xsl:variable name="konfigurace" select="/"/>
franta-hg@18
    51
			<xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[empty(s:stránka/s:skrytá) or not(s:stránka/s:skrytá)]">
franta-hg@6
    52
				<entry>
franta-hg@18
    53
					<title><xsl:value-of select="s:stránka/s:nadpis"/></title>
franta-hg@15
    54
					<xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
franta-hg@18
    55
					<link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
franta-hg@87
    56
					<id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>
franta-hg@6
    57
					<updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
franta-hg@18
    58
					<summary><xsl:value-of select="s:stránka/s:perex"/></summary>
franta-hg@6
    59
				</entry>
franta-hg@6
    60
			</xsl:for-each>
franta-hg@6
    61
			
franta-hg@6
    62
		</feed>
franta-hg@6
    63
	</xsl:template>
franta-hg@87
    64
franta-hg@6
    65
</xsl:stylesheet>
franta-hg@87
    66