Imported Upstream version 3.2.1
[debian/amanda] / man / xslt / html.xsl.in
1 <?xml version='1.0'?>
2 <!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 version='1.0'>
5
6
7 <!-- the @..@ is substituted by config.status to contain the XSL release selected
8      at configure time -->
9 <xsl:import href="http://docbook.sourceforge.net/release/xsl/@XSLREL@/html/docbook.xsl"/>
10
11 <xsl:import href="settings.xsl"/>
12
13 <xsl:param name="citerefentry.link" select="'1'"/>
14 <xsl:param name="css.decoration" select="1"/>
15 <xsl:param name="html.stylesheet" select="'amanda.css'"/>
16 <xsl:param name="html.stylesheet.type">text/css</xsl:param>
17 <xsl:param name="html.cleanup" select="1"/>
18 <xsl:param name="use.extensions" select="'0'"/>
19 <xsl:param name="use.id.as.filename" select="'0'"/>
20 <xsl:param name="use.local.olink.style" select="1"/>
21 <xsl:param name="use.role.as.xrefstyle" select="1"/>
22 <xsl:param name="refentry.generate.title" select="1"/>
23
24 <xsl:output method="html" 
25             encoding="UTF-8"
26             indent="no" />
27
28 <!-- generate correct links to other manpages -->
29 <xsl:template name="generate.citerefentry.link">
30   <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text>
31 </xsl:template>
32
33 <!--  add missing AUTHOR(S) section -->
34 <!-- this section originated with fglrx_man:
35         http://vcs.wgdd.de/cvsweb/fglrx_man/fglrx_html.xsl?rev=1.5
36      License information from that file:
37         This file is free software. The copyright owner gives unlimited
38         permission to copy, distribute and modify it.
39   -->
40 <xsl:template match="refentry">
41   <div class="refentry">
42   <xsl:apply-templates/>
43   <xsl:choose>
44     <xsl:when test="refentryinfo//author">
45       <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
46     </xsl:when>
47   </xsl:choose>
48   </div>
49 </xsl:template>
50
51 <xsl:template match="refentryinfo" mode="authorsect">
52   <div class="refsect1">
53     <h2>
54       <xsl:text>AUTHOR</xsl:text>
55       <xsl:if test="count(.//author)+count(.//othercredit)>1">
56         <xsl:text>S</xsl:text>
57       </xsl:if>
58     </h2>
59     <xsl:text>&#10;</xsl:text>
60     <xsl:if test="count(.//author)>0">
61       <p>
62         <xsl:text>This manual page was written by </xsl:text>
63         <xsl:for-each select=".//author">
64           <xsl:if test="position() > 1">
65             <xsl:choose>
66               <xsl:when test="position() = last()">
67                 <xsl:text> and </xsl:text>
68               </xsl:when>
69               <xsl:otherwise>
70                 <xsl:text>, </xsl:text>
71               </xsl:otherwise>
72             </xsl:choose>
73           </xsl:if>
74           <xsl:apply-templates select="." mode="authorsect"/>
75         </xsl:for-each>
76         <xsl:text>.</xsl:text>
77       </p>
78     </xsl:if>
79     <xsl:if test="count(.//othercredit)>0">
80       <p>
81         <xsl:text>Contributions were derived from </xsl:text>
82         <xsl:for-each select=".//othercredit">
83           <xsl:if test="position() > 1">
84             <xsl:choose>
85               <xsl:when test="position() = last()">
86                 <xsl:text> and </xsl:text>
87               </xsl:when>
88               <xsl:otherwise>
89                 <xsl:text>, </xsl:text>
90               </xsl:otherwise>
91             </xsl:choose>
92           </xsl:if>
93           <xsl:apply-templates select="." mode="authorsect"/>
94         </xsl:for-each>
95         <xsl:text>.</xsl:text>
96       </p>
97     </xsl:if>
98     <xsl:if test="count(.//editor)>0">
99       <p>
100         <xsl:text disable-output-escaping="yes">Edited by </xsl:text>
101         <xsl:for-each select=".//editor">
102           <xsl:if test="position() > 1">
103             <xsl:choose>
104               <xsl:when test="position() = last()">
105                 <xsl:text> and </xsl:text>
106               </xsl:when>
107               <xsl:otherwise>
108                 <xsl:text>, </xsl:text>
109               </xsl:otherwise>
110             </xsl:choose>
111           </xsl:if>
112           <xsl:apply-templates select="." mode="authorsect"/>
113         </xsl:for-each>
114         <xsl:text>.</xsl:text>
115       </p>
116     </xsl:if>
117   </div>
118 </xsl:template>
119
120 <xsl:template match="affiliation" mode="authorsect">
121   <xsl:choose>
122     <xsl:when test="./org/uri">
123       <a>
124        <xsl:attribute name="href">
125          <xsl:apply-templates select="./org/uri" />
126        </xsl:attribute>
127        <xsl:apply-templates select="./org/orgname" />
128       </a>
129     </xsl:when>
130     <xsl:otherwise>
131       <xsl:apply-templates select="./org/orgname" />
132     </xsl:otherwise>
133   </xsl:choose>
134 </xsl:template>
135
136 <xsl:template match="author|editor|othercredit" mode="authorsect">
137   <span class="{name(.)}">
138     <xsl:call-template name="anchor"/>
139     <xsl:call-template name="person.name"/>
140     <xsl:if test=".//email">
141       <xsl:text> </xsl:text>
142       <xsl:apply-templates select=".//email"/>
143     </xsl:if>
144     <xsl:if test=".//affiliation">
145       <xsl:text> (</xsl:text>
146       <xsl:apply-templates mode="authorsect" select="./affiliation"/>
147       <xsl:text>)</xsl:text>
148     </xsl:if>
149   </span>
150 </xsl:template>
151
152 <xsl:template name="user.header.content">
153   <center>Amanda-@VERSION@</center>
154   <hr />
155 </xsl:template>
156
157 <xsl:template name="user.footer.content">
158   <hr />
159   <center>Amanda-@VERSION@</center>
160 </xsl:template>
161
162 </xsl:stylesheet>