root/šablona/atom.xsl @ 136:d5feb9d8ebc3

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

fix license version: GNU GPLv3

RevLine 
[6]1<?xml version="1.0" encoding="UTF-8"?>
[61]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
[136]8the Free Software Foundation, version 3 of the License.
[61]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-->
[6]18<xsl:stylesheet version="2.0"
19        xmlns="http://www.w3.org/2005/Atom"
[18]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"
[6]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"
[18]25        exclude-result-prefixes="fn s k j">
[6]26        <xsl:output     method="xml" indent="yes" encoding="UTF-8"/>
[87]27
[15]28        <xsl:param name="vstupníPřípona" select="'.xml'"/>
29        <xsl:param name="výstupníPřípona" select="'.xhtml'"/>
[87]30
[21]31        <xsl:template match="/">
[87]32
[47]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>
[87]37
[6]38                <feed>
[18]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')}"/>
[87]42                        <link href="{k:web/k:url}"/>
43                        <updated><xsl:value-of select="current-dateTime()"/></updated> 
[6]44                        <author>
[18]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>
[6]47                        </author>
[18]48                        <id><xsl:value-of select="concat('urn:uuid:', k:web/k:uuid)"/></id>
[87]49
[7]50                        <xsl:variable name="konfigurace" select="/"/>
[18]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á)]">
[6]52                                <entry>
[18]53                                        <title><xsl:value-of select="s:stránka/s:nadpis"/></title>
[15]54                                        <xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/>
[18]55                                        <link href="{concat($konfigurace/k:web/k:url, encode-for-uri($soubor), $výstupníPřípona)}" />
[87]56                                        <id><xsl:value-of select="concat('urn:', $konfigurace/k:web/k:kod ,':strana:', encode-for-uri($soubor))"/></id>
[6]57                                        <updated><xsl:value-of select="j:posledníZměna(document-uri(.))"/></updated>
[18]58                                        <summary><xsl:value-of select="s:stránka/s:perex"/></summary>
[6]59                                </entry>
60                        </xsl:for-each>
61                       
62                </feed>
63        </xsl:template>
[87]64
[6]65</xsl:stylesheet>
[87]66
Note: See TracBrowser for help on using the browser.