aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/htdocs/multimedia/tags.xsl
blob: 555e33f2ed2184d2d144fee8909958ba99d193df (plain) (blame)
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
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN"
                                "http://www.FreeBSD.org/XML/share/xml/xslt10-freebsd.dtd" [
<!ENTITY title "FreeBSD Multimedia">
]>

<!-- $FreeBSD$ -->

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:set="http://exslt.org/sets"
	xmlns="http://www.w3.org/1999/xhtml"
	extension-element-prefixes="set">

  <xsl:import href="http://www.FreeBSD.org/XML/share/xml/xhtml.xsl"/>
  <xsl:import href="include.xsl"/>

  <xsl:variable name="title">&title;</xsl:variable>

  <xsl:template name="process.sidewrap">&nav.about;</xsl:template>

  <xsl:template name="process.contentwrap">
    <xsl:param name="nodes" select="//tag"/>

    <xsl:call-template name="multimedia.pre"/>

    <h1>Tag Cloud</h1>

    <xsl:for-each select="set:distinct(//tag)">
      <xsl:sort select="."/>

      <xsl:variable name="tagName" select="./text()"/>

      <a>
        <xsl:attribute name="style">
          <xsl:text>font-size:</xsl:text>
          <xsl:value-of select="count(//tag[. = $tagName]) div 3 + 6"/>
          <xsl:text>pt;</xsl:text>
        </xsl:attribute>

        <xsl:attribute name="href">
          <xsl:value-of select="concat('#', translate($tagName, ' ', '_'))"/>
        </xsl:attribute>

        <xsl:value-of select="translate($tagName, ' ', '&nbsp;')"/>
      </a>
    </xsl:for-each>

    <br/>

    <h1 style="margin-top: 32pt">Multimedia Resources</h1>

    <xsl:for-each select="set:distinct(//tag)">
      <xsl:sort select="."/>

      <xsl:variable name="tagName" select="./text()"/>

      <h2 id="{translate($tagName, ' ', '_')}"><xsl:value-of select="."/></h2>

      <ul>
	<xsl:apply-templates select="/multimedia/items/item[tags/tag = $tagName]"/>
      </ul>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>