Moving docs tree to docs-xml to make room for generated docs in the release tarball.
[sfrench/samba-autobuild/.git] / docs-xml / xslt / db2latex-xsl / xsl / example.mod.xsl
1 <?xml version='1.0'?>
2 <!DOCTYPE xsl:stylesheet [ <!ENTITY % xsldoc.ent SYSTEM "./xsldoc.ent"> %xsldoc.ent; ]>
3 <!--############################################################################# 
4 |       $Id: example.mod.xsl,v 1.9 2004/01/26 09:40:43 j-devenish Exp $
5 |- #############################################################################
6 |       $Author: j-devenish $
7 + ############################################################################## -->
8
9 <xsl:stylesheet
10         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11         xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
12         exclude-result-prefixes="doc" version='1.0'>
13
14         <doc:reference id="example" xmlns="">
15                 <referenceinfo>
16                         <releaseinfo role="meta">
17                                 $Id: example.mod.xsl,v 1.9 2004/01/26 09:40:43 j-devenish Exp $
18                         </releaseinfo>
19                         <authorgroup>
20                                 &ramon;
21                                 &james;
22                         </authorgroup>
23                         <copyright>
24                                 <year>2000</year><year>2001</year><year>2002</year><year>2003</year>
25                                 <holder>Ramon Casellas</holder>
26                         </copyright>
27                         <revhistory>
28                                 <doc:revision rcasver="1.7">&rev_2003_05;</doc:revision>
29                         </revhistory>
30                 </referenceinfo>
31                 <title>Examples <filename>example.mod.xsl</filename></title>
32                 <partintro>
33                         <para>The file <filename>example.mod.xsl</filename> contains the
34                         XSL templates for <doc:db>example</doc:db> and
35                         <doc:db>informalexample</doc:db>.</para>
36                 </partintro>
37         </doc:reference>
38
39         <doc:template xmlns="">
40                 <refpurpose>Process <doc:db>example</doc:db> elements</refpurpose>
41                 <doc:description>
42                         <para>
43                                 Format a caption.
44                         </para>
45                 </doc:description>
46                 <doc:variables>
47                         <itemizedlist>
48                                 <listitem><simpara><xref linkend="param.latex.example.caption.style"/></simpara></listitem>
49                         </itemizedlist>
50                 </doc:variables>
51                 <!--
52                 <doc:notes>
53                 </doc:notes>
54                 -->
55                 <doc:samples>
56                         <simplelist type='inline'>
57                                 &test_book;
58                                 &test_program;
59                         </simplelist>
60                 </doc:samples>
61                 <doc:seealso>
62                         <itemizedlist>
63                                 <listitem><simpara><xref linkend="template.generate.formal.title.placement"/></simpara></listitem>
64                                 <listitem><simpara>&mapping;</simpara></listitem>
65                                 <listitem><simpara><xref linkend="template.title-caption.mode"/></simpara></listitem>
66                         </itemizedlist>
67                 </doc:seealso>
68         </doc:template>
69         <xsl:template match="example">
70                 <xsl:variable name="placement">
71                         <xsl:call-template name="generate.formal.title.placement">
72                                 <xsl:with-param name="object" select="local-name(.)" />
73                         </xsl:call-template>
74                 </xsl:variable>
75                 <xsl:variable name="caption">
76                         <xsl:text>{</xsl:text>
77                         <xsl:value-of select="$latex.example.caption.style"/>
78                         <xsl:text>{\caption{</xsl:text>
79                         <xsl:apply-templates select="title" mode="caption.mode"/>
80                         <xsl:text>}</xsl:text>
81                         <xsl:call-template name="label.id"/>
82                         <xsl:text>}}&#10;</xsl:text>
83                 </xsl:variable>
84                 <xsl:call-template name="map.begin"/>
85                 <xsl:if test="$placement='before'">
86                         <xsl:text>\captionswapskip{}</xsl:text>
87                         <xsl:value-of select="$caption" />
88                         <xsl:text>\captionswapskip{}</xsl:text>
89                 </xsl:if>
90                 <xsl:call-template name="content-templates"/>
91                 <xsl:if test="$placement!='before'"><xsl:value-of select="$caption" /></xsl:if>
92                 <xsl:call-template name="map.end"/>
93         </xsl:template>
94
95         <doc:template xmlns="">
96                 <refpurpose>Process <doc:db>informalexample</doc:db> elements</refpurpose>
97                 <doc:description>
98                         <para>
99                                 Calls <xref linkend="template.informal.object"/>.
100                         </para>
101                 </doc:description>
102                 <doc:variables>
103                         &no_var;
104                 </doc:variables>
105                 <!--
106                 <doc:notes>
107                 </doc:notes>
108                 -->
109                 <doc:samples>
110                         <simplelist type='inline'>
111                                 &test_book;
112                         </simplelist>
113                 </doc:samples>
114         </doc:template>
115         <xsl:template match="informalexample">
116                 <xsl:call-template name="informal.object"/>
117         </xsl:template>
118
119 </xsl:stylesheet>