šablona/atom.xsl
author František Kučera <franta-hg@frantovo.cz>
Sun, 08 Jan 2012 17:26:39 +0100
changeset 79 8ab1a1a666d8
parent 61 9503eb8377f1
child 87 25dec6931f18
permissions -rw-r--r--
Added tag v0.3 for changeset 7e478bfa5694
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@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@6
    19
<xsl:stylesheet version="2.0"
franta-hg@6
    20
	xmlns="http://www.w3.org/2005/Atom"
franta-hg@18
    21
	xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
franta-hg@18
    22
	xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
franta-hg@6
    23
	xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
franta-hg@6
    24
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
franta-hg@6
    25
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
franta-hg@18
    26
	exclude-result-prefixes="fn s k j">
franta-hg@6
    27
	<xsl:output	method="xml" indent="yes" encoding="UTF-8"/>
franta-hg@6
    28
	
franta-hg@15
    29
	<xsl:param name="vstupníPřípona" select="'.xml'"/>
franta-hg@15
    30
	<xsl:param name="výstupníPřípona" select="'.xhtml'"/>
franta-hg@15
    31
	
franta-hg@21
    32
	<xsl:template match="/">
franta-hg@6
    33
	
franta-hg@47
    34
		<xsl:if test="k:web/k:uuid = '399a714c-956e-444c-a8f4-afe8f0df802a'">
franta-hg@47
    35
			<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
    36
			<!-- Nové UUID si můžete vygenerovat např. příkazem: uuidgen -->
franta-hg@47
    37
		</xsl:if>
franta-hg@47
    38
	
franta-hg@6
    39
		<feed>
franta-hg@18
    40
			<title><xsl:value-of select="k:web/k:název"/></title>
franta-hg@18
    41
			<subtitle><xsl:value-of select="k:web/k:podtitul"/></subtitle>
franta-hg@18
    42
			<link rel="self" href="{concat(k:web/k:url, 'atom.xml')}"/>
franta-hg@18
    43
			<link href="{k:web/k:url}"/>			
franta-hg@6
    44
			<updated><xsl:value-of select="current-dateTime()"/></updated>			
franta-hg@6
    45
			<author>
franta-hg@18
    46
				<name><xsl:value-of select="k:web/k:autor/k:jméno"/></name>
franta-hg@18
    47
				<email><xsl:value-of select="k:web/k:autor/k:email"/></email>
franta-hg@6
    48
			</author>
franta-hg@18
    49
			<id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
franta-hg@6
    50
			
franta-hg@7
    51
			<xsl:variable name="konfigurace" select="/"/>
franta-hg@18
    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á)]">
franta-hg@6
    53
				<entry>
franta-hg@18
    54
					<title><xsl:value-of select="s:stránka/s:nadpis"/></title>
franta-hg@15
    55
					<xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
franta-hg@18
    56
					<link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
franta-hg@18
    57
					<id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>					
franta-hg@6
    58
					<updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
franta-hg@18
    59
					<summary><xsl:value-of select="s:stránka/s:perex"/></summary>
franta-hg@6
    60
				</entry>
franta-hg@6
    61
			</xsl:for-each>
franta-hg@6
    62
			
franta-hg@6
    63
		</feed>
franta-hg@6
    64
	</xsl:template>
franta-hg@6
    65
	
franta-hg@6
    66
</xsl:stylesheet>