summaryrefslogtreecommitdiff
path: root/services.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'services.xsl')
-rw-r--r--services.xsl30
1 files changed, 26 insertions, 4 deletions
diff --git a/services.xsl b/services.xsl
index 81f8cbb..695adb6 100644
--- a/services.xsl
+++ b/services.xsl
@@ -1,24 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
- xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="https://beratung-franzke.de/web-tpl"
xmlns:rss2="http://purl.org/rss/2.0/"
xmlns:str="http://exslt.org/strings"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="rss2"
extension-element-prefixes="str">
<xsl:include href="xsl/layout.xsl" />
+ <!-- Convert inline p-tags to spans, since there is not a
+ consistent use of p in buchhalterservice's xml. -->
+ <xsl:template match="p" mode="copy-description">
+ <span>
+ <xsl:apply-templates mode="copy-description"/>
+ </span>
+ </xsl:template>
+
+ <xsl:template match="*" mode="copy-description">
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates mode="copy-description" select="@*|node()" />
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="@*" mode="copy-description">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ </xsl:template>
+
<xsl:template match="s:buchhalterservice" mode="html">
<div class="news">
- <xsl:for-each select="document('buchhalterservice.xml')/rss2:rss/rss2:channel/rss2:item">
+ <xsl:for-each select="document(@filename)/rss2:rss/rss2:channel/rss2:item">
<xsl:variable name="i">
<xsl:number />
</xsl:variable>
<xsl:if test="$i &lt;= 5">
<div>
- <h3><a href="{rss2:link}"><xsl:value-of select="rss2:title" /></a></h3>
- <xsl:copy-of select="rss2:description/*" />
+ <a href="{rss2:link}"><xsl:value-of select="rss2:title" /></a>
+ <p>
+ <xsl:apply-templates mode="copy-description" select="rss2:description/node()"/>
+ </p>
</div>
</xsl:if>
</xsl:for-each>