Fix documentation build: manpages, links in the HTML documents.
[bbaumbach/samba-autobuild/.git] / docs-xml / xslt / html-common.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- This file is generated from param.xweb; do not edit this file! -->
3
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
5                 xmlns:xlink='http://www.w3.org/1999/xlink'
6                 exclude-result-prefixes="xlink"
7                 version="1.0">
8
9 <xsl:param name="base.dir" select="'../htmldocs/'"/>
10 <xsl:param name="bridgehead.in.toc" select="1"/>
11 <xsl:param name="citerefentry.link" select="'1'"/>
12 <xsl:param name="css.decoration" select="1"/>
13 <xsl:param name="html.stylesheet" select="'../samba.css'"/>
14 <xsl:param name="html.stylesheet.type">text/css</xsl:param>
15 <xsl:param name="use.extensions" select="'0'"/>
16 <xsl:param name="use.id.as.filename" select="'1'"/>
17 <xsl:param name="use.local.olink.style" select="1"/> 
18 <xsl:param name="use.role.as.xrefstyle" select="1"/>
19 <xsl:param name="use.role.for.mediaobject" select="1"/>
20
21 <xsl:template name="generate.citerefentry.link">
22   <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text>
23 </xsl:template>
24
25 <xsl:template match="author">
26 </xsl:template>
27
28 <xsl:template match="link" name="link">
29   <xsl:param name="linkend" select="@linkend"/>
30   <xsl:param name="a.target"/>
31   <xsl:param name="xhref" select="@xlink:href"/>
32
33   <xsl:variable name="content">
34     <xsl:call-template name="anchor"/>
35     <xsl:choose>
36       <xsl:when test="count(child::node()) &gt; 0">
37         <!-- If it has content, use it -->
38         <xsl:apply-templates/>
39       </xsl:when>
40       <!-- else look for an endterm -->
41       <xsl:when test="@endterm">
42         <xsl:variable name="etargets" select="key('id',@endterm)"/>
43         <xsl:variable name="etarget" select="$etargets[1]"/>
44         <xsl:choose>
45           <xsl:when test="count($etarget) = 0">
46             <xsl:message>
47               <xsl:value-of select="count($etargets)"/>
48               <xsl:text>Endterm points to nonexistent ID: </xsl:text>
49               <xsl:value-of select="@endterm"/>
50             </xsl:message>
51             <xsl:text>???</xsl:text>
52           </xsl:when>
53           <xsl:otherwise>
54               <xsl:apply-templates select="$etarget" mode="endterm"/>
55           </xsl:otherwise>
56         </xsl:choose>
57       </xsl:when>
58       <xsl:otherwise>
59          <xsl:choose>
60             <xsl:when test="key('id', @linkend)/title[1]">
61               <xsl:call-template name="gentext.startquote"/>
62               <xsl:value-of select="key('id', @linkend)/title[1]"/>
63               <xsl:call-template name="gentext.endquote"/>
64             </xsl:when>
65          <xsl:otherwise>
66             <xsl:message>
67                 <xsl:text>Link element has no content and no Endterm. And linkend's pointer has no title. </xsl:text>
68                 <xsl:text>Nothing to show in the link to </xsl:text>
69                 <xsl:value-of select="(@linkend)[1]"/>
70             </xsl:message>
71          </xsl:otherwise>
72         </xsl:choose>
73       </xsl:otherwise>
74     </xsl:choose>
75   </xsl:variable>
76
77   <xsl:call-template name="simple.xlink">
78     <xsl:with-param name="node" select="."/>
79     <xsl:with-param name="linkend" select="$linkend"/>
80     <xsl:with-param name="content" select="$content"/>
81     <xsl:with-param name="a.target" select="$a.target"/>
82     <xsl:with-param name="xhref" select="$xhref"/>
83   </xsl:call-template>
84
85 </xsl:template>
86
87 </xsl:stylesheet>