Initialize the file descriptor in the files_struct before trying to close it. Otherwi...
[Samba/gebeck_regimport.git] / docs-xml / xslt / latex / samba.xsl
blob9fc27e6bbb119f5b97b872b7c94be3e4adc34d28
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3 Expand Samba-specific XML elements to LaTeX, for use with dblatex
5 Copyright (C) 2003,2004,2009 Jelmer Vernooij <jelmer@samba.org>
6 Published under the GNU GPLv3 or later
7 -->
8 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'
9 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
11 <!-- FIXME: dblatex should have some way to load additional packages, user.params.set2
12 isn't really meant for this sort of thing -->
13 <xsl:template name="user.params.set2">
14 <xsl:text>\usepackage{samba}&#10;</xsl:text>
15 </xsl:template>
17 <xsl:template match="smbconfblock/smbconfoption">
18 <xsl:text> </xsl:text><xsl:value-of select="@name"/>
19 <xsl:if test="text() != ''">
20 <xsl:text> = </xsl:text>
21 <xsl:value-of select="text()"/>
22 </xsl:if>
23 <xsl:text>&#10;</xsl:text>
24 </xsl:template>
26 <xsl:template match="smbconfblock/smbconfcomment">
27 <xsl:text># </xsl:text>
28 <xsl:apply-templates/>
29 <xsl:text>&#10;</xsl:text>
30 </xsl:template>
32 <xsl:template match="smbconfblock/smbconfsection">
33 <xsl:value-of select="@name"/>
34 <xsl:text>&#10;</xsl:text>
35 </xsl:template>
37 <xsl:template match="smbconfoption">
38 <xsl:text>\smbconfoption{</xsl:text>
39 <xsl:call-template name="scape">
40 <xsl:with-param name="string" select="@name"/>
41 </xsl:call-template>
42 <xsl:text>}</xsl:text>
44 <xsl:choose>
45 <xsl:when test="text() != ''">
46 <xsl:text> = </xsl:text>
47 <xsl:call-template name="scape">
48 <xsl:with-param name="string" select="text()"/>
49 </xsl:call-template>
50 </xsl:when>
51 </xsl:choose>
52 </xsl:template>
54 <xsl:template match="smbconfblock">
55 <xsl:text>&#10;\begin{lstlisting}[language=smbconf,style=smbconfblock]&#10;</xsl:text>
56 <xsl:apply-templates/>
57 <xsl:text>\end{lstlisting}&#10;</xsl:text>
58 </xsl:template>
60 <xsl:template match="smbconfsection">
61 <xsl:text>\smbconfsection{</xsl:text>
62 <xsl:call-template name="scape">
63 <xsl:with-param name="string" select="@name"/>
64 </xsl:call-template>
65 <xsl:text>}</xsl:text>
66 </xsl:template>
69 <xsl:template match="description"><xsl:apply-templates/></xsl:template>
71 <xsl:template match="value"><xsl:apply-templates/></xsl:template>
73 <xsl:template match="synonym"><xsl:apply-templates/></xsl:template>
75 <xsl:template match="related"><xsl:apply-templates/></xsl:template>
77 <xsl:template match="//samba:parameterlist">
78 <xsl:text>\begin{description}&#10;</xsl:text>
79 <xsl:apply-templates>
80 <xsl:sort select="samba:parameter/@name"/>
81 </xsl:apply-templates>
82 <xsl:text>\end{description}&#10;</xsl:text>
83 </xsl:template>
85 <xsl:template match="value/comment">
86 <xsl:text>&#10;# </xsl:text>
87 <xsl:apply-templates/>
88 </xsl:template>
90 <xsl:template match="/">
91 <xsl:apply-templates/>
92 </xsl:template>
94 <xsl:template match="refentry">
95 <xsl:text>\section{</xsl:text><xsl:value-of select="refmeta/refentrytitle"/><xsl:text>}&#10;</xsl:text>
96 <xsl:apply-templates/>
97 </xsl:template>
99 <xsl:template match="//samba:parameter">
100 <xsl:for-each select="synonym">
101 <xsl:text>\item[{</xsl:text><xsl:value-of select="."/><xsl:text>}]\null{}&#10;</xsl:text>
102 <xsl:text>\index{</xsl:text><xsl:value-of select="."/><xsl:text>}&#10;</xsl:text>
103 <xsl:text>This parameter is a synonym for \smbconfoption{</xsl:text><xsl:value-of select="../@name"/><xsl:text>}.</xsl:text>
104 </xsl:for-each>
106 <xsl:text>\item[{</xsl:text><xsl:value-of select="@name"/>
107 <xsl:text> (</xsl:text>
108 <xsl:value-of select="@context"/>
109 <xsl:text>)</xsl:text>
110 <xsl:text>}]\null{}&#10;&#10;</xsl:text>
111 <xsl:text>\index{</xsl:text><xsl:value-of select="@name"/><xsl:text>}&#10;</xsl:text>
113 <!-- Print default value-->
114 <xsl:text>&#10;</xsl:text>
115 <xsl:text>Default: </xsl:text>
116 <xsl:text>\emph{</xsl:text>
117 <xsl:choose>
118 <xsl:when test="value[@type='default'] != ''">
119 <xsl:value-of select="@name"/>
120 <xsl:text> = </xsl:text>
121 <xsl:apply-templates select="value"/>
122 </xsl:when>
123 <xsl:otherwise>
124 <xsl:text>No default</xsl:text>
125 </xsl:otherwise>
126 </xsl:choose>
127 <xsl:text>}</xsl:text>
128 <xsl:text>&#10;</xsl:text>
130 <!-- Generate list of examples -->
131 <xsl:text>&#10;</xsl:text>
132 <xsl:for-each select="value[@type='example']">
133 <xsl:text>&#10;</xsl:text>
134 <xsl:text>Example: </xsl:text>
135 <xsl:text>\emph{</xsl:text><xsl:value-of select="../@name"/>
136 <xsl:text> = </xsl:text>
137 <xsl:apply-templates select="."/>
138 <xsl:text>}</xsl:text>
139 <xsl:text>&#10;</xsl:text>
140 </xsl:for-each>
142 <!-- Description -->
143 <xsl:apply-templates select="description"/>
144 </xsl:template>
146 </xsl:stylesheet>