summaryrefslogtreecommitdiffstats
path: root/packaging/bookinfo.xsl
blob: c16ac17796d28f6bd06f236163b7477a537f774b (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
110
111
112
113
114
115
<!-- Transform rpm-info.xml into either "bookinfo" or "articleinfo" -->
<xsl:stylesheet version="1.0" xml:space="preserve" 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="fdpdir" select="'../..'"/>

  <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: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:choose>
		<xsl:when test="details[@lang = $lang]">
		  <xsl:for-each select="details[@lang = $lang]">
		    <xsl:element name="para">
		      <xsl:apply-templates/>
		    </xsl:element>
		  </xsl:for-each>
		</xsl:when>
		<xsl:when test="details[@lang = 'en_US']">
		  <xsl:for-each select="details[@lang = 'en_US']">
		    <xsl:element name="para">
		      <xsl:apply-templates/>
		    </xsl:element>
		  </xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
		  <xsl:element name="para">
		    <xsl:text>(...)</xsl:text>
		  </xsl:element>
		</xsl:otherwise>
	      </xsl:choose>
	    </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="$fdpdir"/>/docs-common/common/legalnotice-opl-<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="$fdpdir"/>/docs-common/common/legalnotice-<xsl:value-of
		select="$lang"/>.xml</xsl:attribute></xsl:element>
	</xsl:otherwise>
      </xsl:choose>
    </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>