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