root/src/modules/module.xsl

Revision 412c3dbfb208525e7fa8d2885a956e8295721507, 2.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 months ago)

Actual native docbook.

  • Property mode set to 100644
Line 
1 <xsl:stylesheet version="1.0"
2                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4 <xsl:template match="parameter" name="configparams">
5   <variablelist>
6     <varlistentry><term><xsl:value-of select="@name"/></term>
7       <listitem>
8         <variablelist>
9           <varlistentry><term>required</term><listitem><para><xsl:value-of select="@required"/></para></listitem></varlistentry>
10           <xsl:if test="@default">
11           <varlistentry><term>default</term><listitem><para>
12             <xsl:value-of select="@default"/>
13             </para></listitem></varlistentry>
14           </xsl:if>
15           <varlistentry><term>allowed</term><listitem><para><xsl:value-of select="@allowed"/></para></listitem></varlistentry>
16         </variablelist>
17       <para>
18         <xsl:value-of select="." />
19       </para>
20       </listitem>
21     </varlistentry>
22   </variablelist>
23 </xsl:template>
24
25 <xsl:template match="/">
26   <section xmlns="http://docbook.org/ns/docbook" version="5">
27     <title><xsl:value-of select="module/name"/></title>
28     <xsl:copy-of disable-output-escaping="yes" select="module/description/*"/>
29
30     <variablelist>
31       <varlistentry><term>loader</term><listitem><para><xsl:value-of select="module/loader"/></para></listitem></varlistentry>
32       <xsl:if test="module/image">
33       <varlistentry><term>image</term><listitem><para><xsl:value-of select="module/image"/></para></listitem></varlistentry>
34       </xsl:if>
35       <xsl:if test="module/object">
36       <varlistentry><term>object</term><listitem><para><xsl:value-of select="module/object"/></para></listitem></varlistentry>
37       </xsl:if>
38     </variablelist>
39
40   <xsl:if test="module/moduleconfig/parameter">
41   <section>
42     <title>Module Configuration</title>
43     <xsl:for-each select="module/moduleconfig/parameter">
44       <xsl:call-template name="configparams" />
45     </xsl:for-each>
46   </section>
47   </xsl:if>
48
49   <xsl:if test="module/checkconfig/parameter">
50   <section>
51     <title>Check Configuration</title>
52     <xsl:for-each select="module/checkconfig/parameter">
53       <xsl:call-template name="configparams" />
54     </xsl:for-each>
55   </section>
56   </xsl:if>
57
58   <xsl:if test="module/examples/example">
59   <section>
60   <title>Examples</title>
61   <xsl:for-each select="module/examples/example">
62     <xsl:copy-of select="."/>
63   </xsl:for-each>
64   </section>
65   </xsl:if>
66
67   <xsl:for-each select="module/section">
68     <xsl:copy-of select="."/>
69   </xsl:for-each>
70
71   </section>
72 </xsl:template>
73 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.