šablona/atom.xsl
author František Kučera <franta-hg@frantovo.cz>
Sun Apr 03 16:34:42 2011 +0200 (2011-04-03)
changeset 6 801a8935caf7
child 7 5b46493979c9
permissions -rw-r--r--
Java funkce pro zjištění poslední úpravy souboru, Atom agregace, konfigurační soubor webu.
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@6
     4
	xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor"
franta-hg@6
     5
	xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
franta-hg@6
     6
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
franta-hg@6
     7
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
franta-hg@6
     8
	exclude-result-prefixes="fn g j">
franta-hg@6
     9
	<xsl:output	method="xml" indent="yes" encoding="UTF-8"/>
franta-hg@6
    10
	
franta-hg@6
    11
	<xsl:param name="konfigurák"></xsl:param>
franta-hg@6
    12
	
franta-hg@6
    13
	<xsl:template match="/">
franta-hg@6
    14
		<!-- TODO: proměnná: -->
franta-hg@6
    15
		<xsl:variable name="konfigurace" select="document($konfigurák)"/>
franta-hg@6
    16
	
franta-hg@6
    17
		<feed>
franta-hg@6
    18
			<title><xsl:value-of select="$konfigurace/g:web/g:název"/></title>
franta-hg@6
    19
			<subtitle><xsl:value-of select="$konfigurace/g:web/g:podtitul"/></subtitle>
franta-hg@6
    20
			<link rel="self" href="{concat($konfigurace/g:web/g:url, 'atom.xml')}"/>
franta-hg@6
    21
			<link href="{$konfigurace/g:web/g:url}"/>			
franta-hg@6
    22
			<updated><xsl:value-of select="current-dateTime()"/></updated>			
franta-hg@6
    23
			<author>
franta-hg@6
    24
				<name><xsl:value-of select="$konfigurace/g:web/g:autor/g:jméno"/></name>
franta-hg@6
    25
				<email><xsl:value-of select="$konfigurace/g:web/g:autor/g:email"/></email>
franta-hg@6
    26
			</author>
franta-hg@6
    27
			<id><xsl:value-of select="concat('urn:uuid:', $konfigurace/g:web/g:uuid)"/></id>
franta-hg@6
    28
			
franta-hg@6
    29
			<xsl:for-each select="collection('../vstup/?select=*.xml')[empty(g:stránka/g:skrytá) or not(g:stránka/g:skrytá)]">
franta-hg@6
    30
				<entry>
franta-hg@6
    31
					<title><xsl:value-of select="g:stránka/g:nadpis"/></title>
franta-hg@6
    32
					<xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], '.xml', '')"/>
franta-hg@6
    33
					<link href="{concat($konfigurace/g:web/g:url, encode-for-uri($soubor), '.xhtml')}" />
franta-hg@6
    34
					<id><xsl:value-of select="concat('urn:', $konfigurace/g:web/g:kod ,':strana:', encode-for-uri($soubor))"/></id>
franta-hg@6
    35
					<!--2010-10-09T20:51:04Z-->
franta-hg@6
    36
					<updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
franta-hg@6
    37
					<summary><xsl:value-of select="g:stránka/g:perex"/></summary>
franta-hg@6
    38
				</entry>
franta-hg@6
    39
			</xsl:for-each>
franta-hg@6
    40
			
franta-hg@6
    41
		</feed>
franta-hg@6
    42
	</xsl:template>
franta-hg@6
    43
	
franta-hg@6
    44
</xsl:stylesheet>