File: news-html.xsl

package info (click to toggle)
libvirt 5.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 240,844 kB
  • sloc: ansic: 584,521; xml: 176,725; sh: 9,912; python: 4,731; perl: 4,343; makefile: 3,321; ml: 465
file content (106 lines) | stat: -rw-r--r-- 3,142 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <!-- This XSLT stylesheet can be applied to the XML version of the release
       notes to produce an HTML document suitable for further processing.
       In particular, the final output will end up on the libvirt website -->

  <!-- Document -->
  <xsl:template match="/libvirt">
    <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
</xsl:text>
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      </head>
      <body>
        <xsl:text disable-output-escaping="yes">

        &lt;!-- DO NOT EDIT THIS FILE! It was generated automatically.
             Edit the source file (news.xml) instead --&gt;

        </xsl:text>
        <h1>Releases</h1>
        <p>This is the list of official releases for libvirt, along with an
        overview of the changes introduced by each of them.</p>
        <p>For a more fine-grained view, use the
        <a href="https://libvirt.org/git/?p=libvirt.git;a=log">git log</a>.
        </p>
        <xsl:apply-templates select="release"/>
        <p>Older libvirt releases didn't have proper release notes,
        and as such are not included in this page: if you're looking
        for information about them, start from those made in
        <a href="news-2016.html">2016</a> and work your way back.</p>
      </body>
    </html>
  </xsl:template>

  <!-- Release -->
  <xsl:template match="release">
    <h3>
      <a>
        <xsl:attribute name="id">
          <xsl:value-of select="@version"/>
        </xsl:attribute>
        <strong>
          <xsl:value-of select="@version"/>
          <xsl:text> (</xsl:text>
          <xsl:value-of select="@date"/>
          <xsl:text>)</xsl:text>
        </strong>
      </a>
    </h3>
    <ul>
      <xsl:apply-templates select="section"/>
    </ul>
  </xsl:template>

  <!-- Section -->
  <xsl:template match="section">
    <li>
      <strong>
        <xsl:value-of select="@title"/>
      </strong>
      <xsl:if test="*">
        <ul class="news-section-content">
          <xsl:apply-templates select="change"/>
        </ul>
      </xsl:if>
    </li>
  </xsl:template>

  <!-- Change -->
  <xsl:template match="change">
    <li>
      <dl>
        <dt>
          <xsl:apply-templates select="summary"/>
        </dt>
        <dd>
          <xsl:apply-templates select="description"/>
        </dd>
      </dl>
    </li>
  </xsl:template>

  <!-- Change summary -->
  <xsl:template match="summary">
    <xsl:apply-templates/>
  </xsl:template>

  <!-- Change description -->
  <xsl:template match="description">
    <xsl:apply-templates/>
  </xsl:template>

  <!-- <code> HTML tag -->
  <xsl:template match="code">
    <xsl:text disable-output-escaping="yes">&lt;code&gt;</xsl:text>
    <xsl:apply-templates/>
    <xsl:text disable-output-escaping="yes">&lt;/code&gt;</xsl:text>
  </xsl:template>

</xsl:stylesheet>