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>
<link href="../media/c3d2_ta_silc.pdf">Plakat zum runterladen als PDF.</link>
</p>
<p>
Wie versprochen hier die Folien.
Wie versprochen, hier die Folien.
</p>
<dl>
<dd><link href="../media/ta-silc/silc.pdf">Folien zum SILC-Vortrag</link></dd>
<dd><link href="../media/ta-silc/krypto.pdf">Folien zum Kryptovortrag</link></dd>
<dd><link href="../media/ta-silc/jabber.pdf">Folien zum Jabbervortrag</link></dd>
</dl>
<resource title="Folien zum SILC-Vortrag"
size="716645"
type="application/pdf"
url="media/ta-silc/silc.pdf"/>
<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>

View File

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

View File

@ -15,7 +15,7 @@
encoding="utf-8"
indent="yes"/>
<xsl:include href="date.xsl" />
<xsl:include href="common.xsl" />
<xsl:variable name="baseurl">http://www.c3d2.de/</xsl:variable>
@ -80,13 +80,19 @@
<xsl:template match="resource">
<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:with-param name="newsfile" select="$newsfile"/>
<xsl:with-param name="item_title" select="../@title"/>
<xsl:with-param name="resource_title" select="@title"/>
<xsl:with-param name="author" select="../@author"/>
<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_type" select="@type"/>
</xsl:call-template>
@ -95,13 +101,19 @@
<xsl:template match="alternative">
<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:with-param name="newsfile" select="$newsfile"/>
<xsl:with-param name="item_title" select="../../@title"/>
<xsl:with-param name="resource_title" select="../@title"/>
<xsl:with-param name="author" select="../../@author"/>
<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_type" select="@type"/>
</xsl:call-template>

View File

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

View File

@ -439,13 +439,18 @@ div#akct a#akpeel:hover {
<xsl:template name="resource-item">
<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>
<!-- 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: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>
</a>