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