# HG changeset patch # User František Kučera <franta-hg@frantovo.cz> # Date 1301842266 -7200 # Node ID 5b46493979c9d5842219649bac6f13ab916d7b5b # Parent 801a8935caf766c2ddabe5b0a39adc385026aa00 Atom – zjednodušení, #2 diff -r 801a8935caf7 -r 5b46493979c9 build.xml --- a/build.xml Sun Apr 03 16:34:42 2011 +0200 +++ b/build.xml Sun Apr 03 16:51:06 2011 +0200 @@ -21,14 +21,15 @@ </target> <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml"> + <!-- Atom --> <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl"> - <param name="konfigurák" expression="../vstup/web.conf"/> <classpath location="/usr/share/java/saxonb-9.0.jar"/> <classpath location="${funkce}"/> <factory name="net.sf.saxon.TransformerFactoryImpl"> <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> </factory> - </xslt> + </xslt> + </target> <target name="kompiluj-funkce" description=""> diff -r 801a8935caf7 -r 5b46493979c9 šablona/atom.xsl --- a/šablona/atom.xsl Sun Apr 03 16:34:42 2011 +0200 +++ b/šablona/atom.xsl Sun Apr 03 16:51:06 2011 +0200 @@ -8,24 +8,21 @@ exclude-result-prefixes="fn g j"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> - <xsl:param name="konfigurák"></xsl:param> - - <xsl:template match="/"> - <!-- TODO: proměnná: --> - <xsl:variable name="konfigurace" select="document($konfigurák)"/> + <xsl:template match="/"> <feed> - <title><xsl:value-of select="$konfigurace/g:web/g:název"/></title> - <subtitle><xsl:value-of select="$konfigurace/g:web/g:podtitul"/></subtitle> - <link rel="self" href="{concat($konfigurace/g:web/g:url, 'atom.xml')}"/> - <link href="{$konfigurace/g:web/g:url}"/> + <title><xsl:value-of select="g:web/g:název"/></title> + <subtitle><xsl:value-of select="g:web/g:podtitul"/></subtitle> + <link rel="self" href="{concat(g:web/g:url, 'atom.xml')}"/> + <link href="{g:web/g:url}"/> <updated><xsl:value-of select="current-dateTime()"/></updated> <author> - <name><xsl:value-of select="$konfigurace/g:web/g:autor/g:jméno"/></name> - <email><xsl:value-of select="$konfigurace/g:web/g:autor/g:email"/></email> + <name><xsl:value-of select="g:web/g:autor/g:jméno"/></name> + <email><xsl:value-of select="g:web/g:autor/g:email"/></email> </author> - <id><xsl:value-of select="concat('urn:uuid:', $konfigurace/g:web/g:uuid)"/></id> + <id><xsl:value-of select="concat('urn:uuid:', g:web/g:uuid)"/></id> + <xsl:variable name="konfigurace" select="/"/> <xsl:for-each select="collection('../vstup/?select=*.xml')[empty(g:stránka/g:skrytá) or not(g:stránka/g:skrytá)]"> <entry> <title><xsl:value-of select="g:stránka/g:nadpis"/></title>