1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="str">
<xsl:param name="docurl"/>
<xsl:variable name="programname" select="id('page')/div[@class='ohjelma_yla ohjelmanavi']/h1"/>
<xsl:template match="li">
<xsl:variable name="progId" select="substring-after(div[@class='outerwrap']//a/@href, '?')"/>
<xsl:variable name="title" select="concat($programname, ' - ', normalize-space(.//h5))"/>
<xsl:if test="$progId">
<link>
<label><xsl:value-of select="normalize-space(.//h5)"/></label>
<stream>wvt:///subtv/video.xsl?srcurl=<xsl:value-of select="str:encode-uri($docurl, true())"/>&param=pid,<xsl:value-of select="$progId"/>&param=title,<xsl:value-of select="str:encode-uri($title, true())"/></stream>
<ref>wvt:///subtv/description.xsl?param=title,<xsl:value-of select="str:encode-uri($title, true())"/>&param=desc,<xsl:value-of select="str:encode-uri(.//span[@class='verho_content']/div, true())"/>&param=pubdate,<xsl:value-of select="str:encode-uri(p[@class='julkaistu'], true())"/>&param=pid,<xsl:value-of select="$progId"/></ref>
</link>
</xsl:if>
</xsl:template>
<xsl:template match="/">
<wvmenu>
<title><xsl:value-of select="$programname"/></title>
<xsl:choose>
<xsl:when test="id('uusimmat')/li">
<xsl:apply-templates select="id('uusimmat')/li"/>
</xsl:when>
<xsl:otherwise>
<textarea>
<label>Ei jaksoja</label>
</textarea>
</xsl:otherwise>
</xsl:choose>
</wvmenu>
</xsl:template>
</xsl:stylesheet>
|