root/šablona/atom.xsl

Revision 136:d5feb9d8ebc3, 2.9 KB (checked in by František Kučera <franta-hg@…>, 5 years ago)

fix license version: GNU GPLv3

Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3XML Web generátor – program na generování webových stránek
4Copyright © 2012 František Kučera (frantovo.cz)
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, version 3 of the License.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program.  If not, see <http://www.gnu.org/licenses/>.
17-->
18<xsl:stylesheet version="2.0"
19        xmlns="http://www.w3.org/2005/Atom"
20        xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
21        xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
22        xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
23        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
24        xmlns:fn="http://www.w3.org/2005/xpath-functions"
25        exclude-result-prefixes="fn s k j">
26        <xsl:output     method="xml" indent="yes" encoding="UTF-8"/>
27
28        <xsl:param name="vstupníPřípona" select="'.xml'"/>
29        <xsl:param name="výstupníPřípona" select="'.xhtml'"/>
30
31        <xsl:template match="/">
32
33                <xsl:if test="k:web/k:uuid = '399a714c-956e-444c-a8f4-afe8f0df802a'">
34                        <xsl:message>Vygenerujte si prosím svoje vlastní UUID pro agregované výstupy a uložte ho do souboru web.conf.</xsl:message>
35                        <!-- Nové UUID si můžete vygenerovat např. příkazem: uuidgen -->
36                </xsl:if>
37
38                <feed>
39                        <title><xsl:value-of select="k:web/k:název"/></title>
40                        <subtitle><xsl:value-of select="k:web/k:podtitul"/></subtitle>
41                        <link rel="self" href="{concat(k:web/k:url, 'atom.xml')}"/>
42                        <link href="{k:web/k:url}"/>
43                        <updated><xsl:value-of select="current-dateTime()"/></updated> 
44                        <author>
45                                <name><xsl:value-of select="k:web/k:autor/k:jméno"/></name>
46                                <email><xsl:value-of select="k:web/k:autor/k:email"/></email>
47                        </author>
48                        <id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
49
50                        <xsl:variable name="konfigurace" select="/"/>
51                        <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[empty(s:stránka/s:skrytá) or not(s:stránka/s:skrytá)]">
52                                <entry>
53                                        <title><xsl:value-of select="s:stránka/s:nadpis"/></title>
54                                        <xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
55                                        <link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
56                                        <id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>
57                                        <updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
58                                        <summary><xsl:value-of select="s:stránka/s:perex"/></summary>
59                                </entry>
60                        </xsl:for-each>
61                       
62                </feed>
63        </xsl:template>
64
65</xsl:stylesheet>
66
Note: See TracBrowser for help on using the browser.