summaryrefslogtreecommitdiffstats
path: root/packaging/bookinfo.xsl
blob: f18c1995dd7de10fd43e0a5e25bdbb56cc14e88c (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
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
<!-- Transform rpm-info.xml into either "bookinfo" or "articleinfo" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:param name="lang" select="'en'"/>
  <xsl:param name="doctype" select="'bookinfo'"/>
  <xsl:param name="who" select="''"/>
  <xsl:param name="fdpcommondir" select="'..'"/>
  <xsl:param name="legalbase" select="'legalnotice-opl'"/>

  <xsl:output encoding="UTF-8" indent="yes" method="xml"
    omit-xml-declaration="no" version="1.0"
    doctype-public="-//OASIS//DTD DocBook XML V4.4//EN"
    doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" />

  <xsl:template match="/">
    <xsl:comment>
	Warning! Warning! Danger, Will Robinson!
	This is a generated file, produced from information in
	the &quot;rpm-info.xml&quot; file.

	DO NOT EDIT THIS FILE DIRECTLY!
	Edit &quot;rpm-info.xml&quot; to change this information.
    </xsl:comment>
    <xsl:element name="{$doctype}">
      <xsl:element name="title">
	<xsl:call-template name="get-title"/>
      </xsl:element>
      <xsl:element name="releaseinfo">
	<xsl:text>Version </xsl:text><xsl:value-of
	  select="/rpm-info/changelog/revision[@role =
	  'doc'][1]/@number"/><xsl:text> (</xsl:text><xsl:value-of
	  select="/rpm-info/changelog/revision[@role =
	  'doc'][1]/@date"/><xsl:text>)</xsl:text>
      </xsl:element>
      <xsl:for-each select="/rpm-info/copyright">
	<xsl:copy-of select="."/>
      </xsl:for-each>
      <xsl:element name="authorgroup">
	<xsl:for-each select="/rpm-info/author">
	  <xsl:element name="author">
	    <xsl:call-template name="human"><xsl:with-param name="who" select="@worker"/></xsl:call-template>
	  </xsl:element>
	</xsl:for-each>
	<xsl:for-each select="/rpm-info/editor">
	  <xsl:element name="editor">
	    <xsl:call-template name="human"><xsl:with-param name="who" select="@worker"/></xsl:call-template>
	  </xsl:element>
	</xsl:for-each>
      </xsl:element>
      <xsl:for-each select="/rpm-info/translator">
	<othercredit class="translator">
	  <xsl:call-template name="human"><xsl:with-param name="who"
	      select="@worker"/></xsl:call-template>
	</othercredit>
      </xsl:for-each>
      <xsl:element name="revhistory" use-attribute-sets="revhist">
	<xsl:for-each select="/rpm-info/changelog/revision[@role != 'rpm']">
	  <xsl:element name="revision">
	    <xsl:element name="revnumber">
	      <xsl:value-of select="@number"/>
	    </xsl:element>
	    <xsl:element name="date">
	      <xsl:value-of select="@date"/>
	    </xsl:element>
	    <xsl:element name="authorinitials">
	      <xsl:call-template name="initials"><xsl:with-param name="who" select="author/@worker"/></xsl:call-template>
	    </xsl:element>
	    <xsl:element name="revdescription">
	      <xsl:element name="para">
		<xsl:value-of select="details"/>
	      </xsl:element>
	    </xsl:element>
	  </xsl:element>
	</xsl:for-each>
      </xsl:element>
      <xsl:choose>
	<xsl:when test="/rpm-info/license/rights='OPL'">
	  <xsl:element name="xi:include"
	    namespace="http://www.w3.org/2001/XInclude"><xsl:attribute
	    name="href"><xsl:value-of
	    select="$fdpcommondir"/>/common/<xsl:value-of
	    select="$legalbase"/>-<xsl:value-of
	    select="$lang"/>.xml</xsl:attribute></xsl:element>
	</xsl:when>
	<xsl:otherwise> <!-- assume OPL for now -->
	  <xsl:element name="xi:include"
	    namespace="http://www.w3.org/2001/XInclude"><xsl:attribute
	      name="href"><xsl:value-of
		select="$fdpcommondir"/>/common/legalnotice-<xsl:value-of
		select="$lang"/>.xml</xsl:attribute></xsl:element>
	</xsl:otherwise>
      </xsl:choose>
      <!-- Allow for an extra chunk inside *info of the writer's choice -->
      <xsl:element name="xi:include" 
		   namespace="http://www.w3.org/2001/XInclude">
	<xsl:attribute name="href">_extrainfo.xml</xsl:attribute>
	<xsl:element name="xi:fallback"
		     namespace="http://www.w3.org/2001/XInclude"/>
      </xsl:element>
    </xsl:element>
  </xsl:template>

  <xsl:include href="templates.xsl"/>

  <!-- This attribute set guarantees the write chunk file name, since it is not
  set in the standard XSL stylesheets. -->
  <xsl:attribute-set name="revhist"><xsl:attribute name="id"><xsl:text>rv-revhistory</xsl:text></xsl:attribute></xsl:attribute-set>

</xsl:stylesheet>