root/šablona/atom.xsl @ 87:25dec6931f18

Revision 87:25dec6931f18, 3.0 KB (checked in by František Kučera <franta-hg@…>, 12 years ago)

Lepší odsazení, tabulátory.

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