Erlaube relative resource/@url für XHTML, ATOM, RSS & Podcast

TA-SILC: Folien als resource


git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@1033 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2007-10-27 14:16:39 +00:00
parent 36c0c849db
commit 7d358e1bc4
5 changed files with 68 additions and 32 deletions

View File

@ -29,13 +29,21 @@
<p> <p>
<link href="../media/c3d2_ta_silc.pdf">Plakat zum runterladen als PDF.</link> <link href="../media/c3d2_ta_silc.pdf">Plakat zum runterladen als PDF.</link>
</p> </p>
<p> <p>
Wie versprochen hier die Folien. Wie versprochen, hier die Folien.
</p> </p>
<dl> <resource title="Folien zum SILC-Vortrag"
<dd><link href="../media/ta-silc/silc.pdf">Folien zum SILC-Vortrag</link></dd> size="716645"
<dd><link href="../media/ta-silc/krypto.pdf">Folien zum Kryptovortrag</link></dd> type="application/pdf"
<dd><link href="../media/ta-silc/jabber.pdf">Folien zum Jabbervortrag</link></dd> url="media/ta-silc/silc.pdf"/>
</dl> <resource title="Folien zur Kryptoeinführung"
size="782157"
type="application/pdf"
url="media/ta-silc/krypto.pdf"/>
<resource title="Folien zum Jabber-Teil"
size="128328"
type="application/pdf"
url="media/ta-silc/jabber.pdf"/>
</item> </item>

View File

@ -5,12 +5,12 @@
xmlns:date="http://exslt.org/dates-and-times" xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="xsl date"> exclude-result-prefixes="xsl date">
<xsl:include href="common.xsl" /> <xsl:include href="common.xsl" />
<xsl:output method="xml" <xsl:output method="xml"
version="1.0" version="1.0"
encoding="utf-8" encoding="utf-8"
indent="yes"/> indent="yes"/>
<xsl:variable name="baseurl">https://www.c3d2.de/</xsl:variable> <xsl:variable name="baseurl">https://www.c3d2.de/</xsl:variable>
@ -74,14 +74,20 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</content> </content>
<xsl:for-each select="resource"> <xsl:for-each select="resource">
<link <xsl:variable name="resource_href">
rel="enclosure" <xsl:call-template name="make-href">
href="{@url}" <xsl:with-param name="href" select="@url"/>
type="{@type}" </xsl:call-template>
length="{@size}" </xsl:variable>
/>
<link rel="enclosure"
href="{$resource_href}"
type="{@type}"
length="{@size}" />
</xsl:for-each> </xsl:for-each>
</entry> </entry>
</xsl:template> </xsl:template>

View File

@ -15,7 +15,7 @@
encoding="utf-8" encoding="utf-8"
indent="yes"/> indent="yes"/>
<xsl:include href="date.xsl" /> <xsl:include href="common.xsl" />
<xsl:variable name="baseurl">http://www.c3d2.de/</xsl:variable> <xsl:variable name="baseurl">http://www.c3d2.de/</xsl:variable>
@ -80,13 +80,19 @@
<xsl:template match="resource"> <xsl:template match="resource">
<xsl:param name="newsfile"/> <xsl:param name="newsfile"/>
<xsl:variable name="href">
<xsl:call-template name="make-href">
<xsl:with-param name="href" select="@url"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="generate-item"> <xsl:call-template name="generate-item">
<xsl:with-param name="newsfile" select="$newsfile"/> <xsl:with-param name="newsfile" select="$newsfile"/>
<xsl:with-param name="item_title" select="../@title"/> <xsl:with-param name="item_title" select="../@title"/>
<xsl:with-param name="resource_title" select="@title"/> <xsl:with-param name="resource_title" select="@title"/>
<xsl:with-param name="author" select="../@author"/> <xsl:with-param name="author" select="../@author"/>
<xsl:with-param name="date" select="../@date"/> <xsl:with-param name="date" select="../@date"/>
<xsl:with-param name="resource_url" select="@url"/> <xsl:with-param name="resource_url" select="$href"/>
<xsl:with-param name="resource_size" select="@size"/> <xsl:with-param name="resource_size" select="@size"/>
<xsl:with-param name="resource_type" select="@type"/> <xsl:with-param name="resource_type" select="@type"/>
</xsl:call-template> </xsl:call-template>
@ -95,13 +101,19 @@
<xsl:template match="alternative"> <xsl:template match="alternative">
<xsl:param name="newsfile"/> <xsl:param name="newsfile"/>
<xsl:variable name="href">
<xsl:call-template name="make-href">
<xsl:with-param name="href" select="@url"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="generate-item"> <xsl:call-template name="generate-item">
<xsl:with-param name="newsfile" select="$newsfile"/> <xsl:with-param name="newsfile" select="$newsfile"/>
<xsl:with-param name="item_title" select="../../@title"/> <xsl:with-param name="item_title" select="../../@title"/>
<xsl:with-param name="resource_title" select="../@title"/> <xsl:with-param name="resource_title" select="../@title"/>
<xsl:with-param name="author" select="../../@author"/> <xsl:with-param name="author" select="../../@author"/>
<xsl:with-param name="date" select="../../@date"/> <xsl:with-param name="date" select="../../@date"/>
<xsl:with-param name="resource_url" select="@url"/> <xsl:with-param name="resource_url" select="$href"/>
<xsl:with-param name="resource_size" select="@size"/> <xsl:with-param name="resource_size" select="@size"/>
<xsl:with-param name="resource_type" select="@type"/> <xsl:with-param name="resource_type" select="@type"/>
</xsl:call-template> </xsl:call-template>

View File

@ -3,11 +3,13 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times" xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="xsl date"> exclude-result-prefixes="xsl date">
<xsl:include href="common.xsl" />
<xsl:output method="xml" <xsl:output method="xml"
version="1.0" version="1.0"
encoding="utf-8" encoding="utf-8"
indent="yes"/> indent="yes"/>
<xsl:variable name="baseurl">https://www.c3d2.de/</xsl:variable> <xsl:variable name="baseurl">https://www.c3d2.de/</xsl:variable>
@ -77,11 +79,15 @@
http://www.apple.com/itunes/podcasts/techspecs.html http://www.apple.com/itunes/podcasts/techspecs.html
--> -->
<xsl:for-each select="resource"> <xsl:for-each select="resource">
<enclosure <xsl:variable name="resource_href">
url="{@url}" <xsl:call-template name="make-href">
length="{@size}" <xsl:with-param name="href" select="@url"/>
type="{@type}" </xsl:call-template>
/> </xsl:variable>
<enclosure url="{$resource_href}"
length="{@size}"
type="{@type}" />
</xsl:for-each> </xsl:for-each>
</item> </item>
</xsl:template> </xsl:template>
@ -118,7 +124,6 @@
<xsl:template match="resource" mode="escaped"/> <xsl:template match="resource" mode="escaped"/>
<!-- Support für <event/> --> <!-- Support für <event/> -->
<xsl:include href="date.xsl" />
<xsl:template match="item/event/start" mode="escaped"> <xsl:template match="item/event/start" mode="escaped">
&lt;dl&gt; &lt;dl&gt;
&lt;dt&gt; &lt;dt&gt;

View File

@ -439,13 +439,18 @@ div#akct a#akpeel:hover {
<xsl:template name="resource-item"> <xsl:template name="resource-item">
<xsl:param name="title" select="@title"/> <xsl:param name="title" select="@title"/>
<xsl:variable name="href">
<xsl:call-template name="make-href">
<xsl:with-param name="href" select="@url"/>
</xsl:call-template>
</xsl:variable>
<li> <li>
<!-- MIME-Type ist nützlich z.B. für ftp:// URLs --> <!-- MIME-Type ist nützlich z.B. für ftp:// URLs -->
<a href="{@url}" type="{@type}" class="mime" rel="enclosure"> <a href="{$href}" type="{@type}" class="mime" rel="enclosure">
<xsl:choose> <xsl:choose>
<xsl:when test="string-length(string($title))"><xsl:value-of select="$title"/></xsl:when> <xsl:when test="string-length(string($title))"><xsl:value-of select="$title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@url"/></xsl:otherwise> <xsl:otherwise><xsl:value-of select="$href"/></xsl:otherwise>
</xsl:choose> </xsl:choose>
</a> </a>