aboutsummaryrefslogtreecommitdiff
path: root/share/sgml/templates.entries.xsl
blob: a33ba8da8e347ecc8f61829174643efc4612cfd6 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?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/www/share/sgml/xslt10-freebsd.dtd" [
<!ENTITY title "Commercial Vendors">
]>

<!-- $FreeBSD$ -->

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

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

  <xsl:param name="basename" select="'none'" />
  <xsl:param name="sort" select="'none'" />

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

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

  <xsl:template name="process.contentwrap">
		<xsl:for-each select="/entries">
		<xsl:call-template name="html-commercial-preface" />

		<xsl:call-template name="html-commercial-listing" />
		</xsl:for-each>
  </xsl:template>

  <xsl:template name="html-commercial-preface">
    <p>The power, flexibility, and reliability of FreeBSD attract
      a wide variety of users and vendors. Here you will find
      vendors offering commercial products and/or services for
      FreeBSD.</p>

    <p>For your convenience, we have divided our growing
      commercial listing into several sections. If your company
      supports a FreeBSD-compatible product or service that should
      be added to this page, please fill out a
      <a href="http://www.FreeBSD.org/send-pr.html">problem report</a> for
      category www.  Submissions should be in HTML and a medium-sized
      paragraph in length.</p>

    <xsl:choose>
      <xsl:when test="$basename = 'software.html'">
	<h2>Software Vendors</h2>

	<p>This file has been divided into sub-categories for your
	  convenience.	The following shortcuts will take you to the
	  proper gallery entries.</p>

      </xsl:when>
      <xsl:when test="$basename = 'consult.html'">
	<h2>Consulting Services</h2>

	<p>This file has been divided into sub-categories for your convenience.
	  The following shortcuts will take you to the proper gallery entries.</p>
      </xsl:when>
      <xsl:otherwise>
	<h2><xsl:value-of select="$pagename" /></h2>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="html-commercial-listing">
    <xsl:choose>
      <xsl:when test="$sort = 'bycat'">
	<xsl:for-each select="/entries/categories/category/@id">
	  <xsl:variable name="id" select="." />

	  <h3><xsl:value-of select="/entries/categories/category[@id = $id]" /></h3>

	  <ul>
	    <xsl:for-each select="/entries/entry[@category = $id]">
	      <xsl:sort select="name"/>

	      <li><xsl:element name="a">
		  <xsl:attribute name="href">
		    <xsl:value-of select='concat($basename, "#", @id)' />
		  </xsl:attribute>
		  <xsl:value-of select="name"/>
		</xsl:element></li>
	    </xsl:for-each>
	  </ul>
	</xsl:for-each>
      </xsl:when>

      <xsl:otherwise>
	<dl>
	  <xsl:for-each select="/entries/entry">
	    <xsl:sort select="translate(name, $uppercase, $lowercase)" order="ascending"/>

	    <dt><xsl:element name="a">
		<xsl:attribute name="name">
		  <xsl:value-of select='@id' />
		</xsl:attribute>

		<xsl:attribute name="href">
		  <xsl:value-of select='url' />
		</xsl:attribute>

		<xsl:value-of select="name"/>
	      </xsl:element></dt>

	    <dd><xsl:apply-templates select="description/child::node()" mode="copy.html"/></dd>
	  </xsl:for-each>
	</dl>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>