summaryrefslogtreecommitdiffstats
path: root/packaging/doc-date.xsl
blob: 84b4294b3dfc14bedc0d3597c71c536b09ca1e49 (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
<!-- 

Extract date for latest revision from rpm-info.xml.
Optional stringparam "role" allows querying of appropriate revision type.

-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output encoding="UTF-8" indent="no" method="text"/>

  <xsl:param name="role" select="'doc'"/>

  <xsl:template match="/">
    <xsl:choose>
      <xsl:when test="$role='rpm'">
	<xsl:choose>
	  <xsl:when test="/rpm-info/changelog/revision[1]/@role='doc'">
	    <xsl:text>0</xsl:text>
	  </xsl:when>
	  <xsl:otherwise>
	    <xsl:value-of
	      select="/rpm-info/changelog/revision[@role=$role][1]/@date"/>
	  </xsl:otherwise>
	</xsl:choose>
      </xsl:when>
      <xsl:otherwise>
	<xsl:value-of
	  select="/rpm-info/changelog/revision[@role=$role][1]/@date"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>