summaryrefslogtreecommitdiff
path: root/templates/www.metacafe.com/navigation.xsl
blob: a4cb8e0f10528ad8a0e9c1c0d9c9c1147ff85abe (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:///www.youtube.com/video.xsl?srcurl=http://www.youtube.com/get_video_info?video_id=<xsl:value-of select="substring(id, 4)"/></stream>
      </xsl:when>
      <xsl:otherwise>
        <stream>wvt:///www.metacafe.com/videopage.xsl?srcurl=<xsl:value-of select="link"/></stream>
      </xsl:otherwise>
    </xsl:choose>

    <ref>wvt:///www.metacafe.com/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>