summaryrefslogtreecommitdiff
path: root/templates/metacafe/navigation.xsl
blob: 4ff821ab26a442614c09a4edc51a7d5428d465bf (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
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<xsl:template match="item">
  <link>
    <label><xsl:value-of select="title" /></label>
    <xsl:choose>
      <xsl:when test="starts-with(id, 'yt-')">
        <stream>wvt:///youtube/video.xsl?srcurl=http%3A//www.youtube.com/watch%3Fv=<xsl:value-of select="substring(id, 4)"/></stream>
      </xsl:when>
      <xsl:otherwise>
        <stream>wvt:///metacafe/video.xsl?srcurl=<xsl:value-of select="link"/></stream>
      </xsl:otherwise>
    </xsl:choose>

    <ref>wvt:///metacafe/description.xsl?srcurl=/api/item/<xsl:value-of select="id"/></ref>
  </link>
</xsl:template>

<xsl:template match="/">
<wvmenu>
  <title><xsl:value-of select="/rss/channel/title"/></title>

  <xsl:apply-templates select="/rss/channel/item"/>

  <xsl:if test="count(/rss/channel/item) = 0">
    <textarea>
      <label>No matching results.</label>
    </textarea>
  </xsl:if>
</wvmenu>
</xsl:template>

</xsl:stylesheet>