summaryrefslogtreecommitdiff
path: root/templates/svtplay.se/programmenu.xsl
blob: baf88c4453a329731229e0635fcea135de59dfb5 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:str="http://exslt.org/strings">

<xsl:template match="text()" />

<xsl:template match="div[@id='pb']">
  <xsl:apply-templates/>
</xsl:template>

<!-- Broadcasts -->
<xsl:template match="div[@class='content']//ul/li/a">
  <link>
    <label><xsl:value-of select="normalize-space(span)"/></label>
    <ref>wvt:///svtplay.se/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref>
    <stream>wvt:///svtplay.se/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></stream>
  </link>
</xsl:template>

<!-- next/prev links -->
<xsl:template match="div[@class='footer']/div[@class='pagination']/ul[@class='pagination program']/li">
    <xsl:if test="@class='prev '">
      <link>
        <label><xsl:value-of select="a/img/@alt"/></label>
        <ref>wvt:///svtplay.se/programmenu.xsl?srcurl=<xsl:value-of select="str:encode-uri(a/@href, true())"/></ref>
      </link>
    </xsl:if>

    <xsl:if test="@class='next '">
      <link>
        <label><xsl:value-of select="a/img/@alt"/></label>
        <ref>wvt:///svtplay.se/programmenu.xsl?srcurl=<xsl:value-of select="str:encode-uri(a/@href, true())"/></ref>
      </link>
    </xsl:if>
</xsl:template>

<xsl:template match="/">
<wvmenu>
  <title>
    <xsl:choose>
      <xsl:when test="normalize-space(//h1/a)">
        <xsl:value-of select="normalize-space(//h1/a)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="normalize-space(//h1/a/img/@alt)"/>
      </xsl:otherwise>
    </xsl:choose>
  </title>

  <xsl:apply-templates select="//div[@id='sb']"/>
</wvmenu>
</xsl:template>

</xsl:stylesheet>