File: pkglist.xsl

package info (click to toggle)
dctrl2xml 0.13
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 116 kB
  • ctags: 21
  • sloc: python: 255; xml: 147; makefile: 19
file content (58 lines) | stat: -rw-r--r-- 1,843 bytes parent folder | download | duplicates (5)
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Here is an example how dctrl2xml and this stylesheet can be used to
  create a packages overview page from a repository's Packages file:

  dctrl2xml -f /var/lib/apt/lists/ftp.debian.org_debian_dists_sid_main_binary-i386_Packages > /tmp/packages.xml
  xsltproc -o /tmp/packages.html pkglist.xsl /tmp/packages.xml
-->
<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output
    method="xml"
    encoding="UTF-8"
    indent="yes"
    omit-xml-declaration="yes"/>

  <!-- The base address of the repository. It is used as prefix in URLs to
       the .deb packages, see the "package" template for details. -->
  <xsl:param name="base_address">http://ftp.debian.org/debian/</xsl:param>

  <xsl:template match="packages">
    <div class="pkglist">
      <h2>Package list</h2>
      <xsl:apply-templates select="package"/>
    </div>
    <br/>
  </xsl:template>

  <xsl:template match="package">
    <div class="package">
      <h3>
        <xsl:value-of select="name/text()"/>
        (<xsl:value-of select="version/text()"/>)
      </h3>
      <h4><xsl:value-of select="description/text()"/></h4>
      <pre>
        <xsl:value-of select="long-description/text()"/>
      </pre>
      <p>
        <b>Architecture</b>: <xsl:value-of select="architecture/text()"/>
        (<a href="{$base_address}{filename/text()}">Download</a>)<br/>
        <xsl:apply-templates select="maintainer"/>
      </p>
    </div>
  </xsl:template>

  <xsl:template match="maintainer">
    <b>Maintainer</b>:
    <xsl:value-of select="contact/name/text()"/>
    &lt;<xsl:apply-templates select="contact/email"/>&gt;<br/>
  </xsl:template>

  <xsl:template match="email">
    <a href="mailto:{text()}"><tt><xsl:value-of select="text()"/></tt></a>
  </xsl:template>

</xsl:stylesheet>