root/šablona/atom.xsl @ 18:45e41566f8a6

Revision 18:45e41566f8a6, 2.0 KB (checked in by František Kučera <franta-hg@…>, 13 years ago)

Nové jmenné prostory: „s“ a „k“ místo „g“.

Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="2.0"
3        xmlns="http://www.w3.org/2005/Atom"
4        xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
5        xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
6        xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
7        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8        xmlns:fn="http://www.w3.org/2005/xpath-functions"
9        exclude-result-prefixes="fn s k j">
10        <xsl:output     method="xml" indent="yes" encoding="UTF-8"/>
11       
12        <xsl:param name="vstupníPřípona" select="'.xml'"/>
13        <xsl:param name="výstupníPřípona" select="'.xhtml'"/>
14       
15        <xsl:template match="/">               
16       
17                <feed>
18                        <title><xsl:value-of select="k:web/k:název"/></title>
19                        <subtitle><xsl:value-of select="k:web/k:podtitul"/></subtitle>
20                        <link rel="self" href="{concat(k:web/k:url, 'atom.xml')}"/>
21                        <link href="{k:web/k:url}"/>                   
22                        <updated><xsl:value-of select="current-dateTime()"/></updated>                 
23                        <author>
24                                <name><xsl:value-of select="k:web/k:autor/k:jméno"/></name>
25                                <email><xsl:value-of select="k:web/k:autor/k:email"/></email>
26                        </author>
27                        <id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
28                       
29                        <xsl:variable name="konfigurace" select="/"/>
30                        <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[empty(s:stránka/s:skrytá) or not(s:stránka/s:skrytá)]">
31                                <entry>
32                                        <title><xsl:value-of select="s:stránka/s:nadpis"/></title>
33                                        <xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
34                                        <link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
35                                        <id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>                                 
36                                        <updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
37                                        <summary><xsl:value-of select="s:stránka/s:perex"/></summary>
38                                </entry>
39                        </xsl:for-each>
40                       
41                </feed>
42        </xsl:template>
43       
44</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.