summaryrefslogtreecommitdiffstats
path: root/packaging/bookinfo.xsl
blob: 4cebf4c1ad06b7614cd565ed01d14287154645a5 (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
<!-- 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:output encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="yes" standalone="no" version="1.0"/>

  <xsl:param name="lang" select="'en'"/>
  <xsl:param name="doctype" select="'bookinfo'"/>
  <xsl:param name="who" select="''"/>

  <xsl:template match="/">
    <xsl:element name="{$doctype}">
      <xsl:element name="title">
	<xsl:call-template name="get-title"/>
      </xsl:element>
      <xsl:for-each select="/rpm-info/copyright">
	<xsl:element name="copyright">
	  <xsl:for-each select="/rpm-info/copyright/year"><xsl:element name="year">
	      <xsl:value-of select="node()"/>
	    </xsl:element></xsl:for-each>
	  <xsl:for-each select="/rpm-info/copyright/holder">
	    <xsl:element name="holder">
	      <xsl:value-of select="node()"/>
	    </xsl:element>
	  </xsl:for-each>
	</xsl:element>
      </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:text disable-output-escaping="yes">&amp;LEGALNOTICE;</xsl:text>
      <xsl:element name="revhistory">
	<xsl:for-each select="/rpm-info/changelog/revision[@role != 'rpm']">
	  <xsl:element name="revision">
	    <xsl:element name="revnumber">
	      <xsl:value-of select="@version"/>
	    </xsl:element>
	    <xsl:element name="date">
	      <xsl:value-of select="@date"/>
	    </xsl:element>
	    <xsl:element name="authorinitials">
	      <xsl:value-of select="author/@initials"/>
	    </xsl:element>
	    <xsl:element name="revdescription">
	      <xsl:for-each select="details[@lang = $lang]">
		<xsl:element name="para">
		  <xsl:apply-templates/>
		</xsl:element>
	      </xsl:for-each>
	    </xsl:element>
	  </xsl:element>
	</xsl:for-each>
      </xsl:element>
    </xsl:element>
  </xsl:template>

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

</xsl:stylesheet>