[3.1.0] Remove multi-description functionality as well as file detection.
[htmlpurifier.git] / configdoc / styles / plain.xsl
blob96fe1b5361b5c3b14098309e10fc7f9eadb439bd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3 version = "1.0"
4 xmlns = "http://www.w3.org/1999/xhtml"
5 xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
7 <xsl:output
8 method = "xml"
9 encoding = "UTF-8"
10 doctype-public = "-//W3C//DTD XHTML 1.0 Transitional//EN"
11 doctype-system = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
12 indent = "no"
13 media-type = "text/html"
15 <xsl:param name="css" select="'styles/plain.css'"/>
16 <xsl:param name="title" select="'Configuration Documentation'"/>
18 <xsl:variable name="typeLookup" select="document('../types.xml')" />
20 <xsl:template match="/">
21 <html lang="en" xml:lang="en">
22 <head>
23 <title><xsl:value-of select="$title" /> - <xsl:value-of select="/configdoc/title" /></title>
24 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
25 <link rel="stylesheet" type="text/css" href="{$css}" />
26 </head>
27 <body>
28 <div id="library"><xsl:value-of select="/configdoc/title" /></div>
29 <h1><xsl:value-of select="$title" /></h1>
30 <h2>Table of Contents</h2>
31 <ul id="toc">
32 <xsl:apply-templates mode="toc" />
33 </ul>
34 <xsl:apply-templates />
35 </body>
36 </html>
37 </xsl:template>
39 <xsl:template match="title" mode="toc" />
40 <xsl:template match="namespace" mode="toc">
41 <xsl:if test="count(directive)&gt;0">
42 <li>
43 <a href="#{@id}"><xsl:value-of select="name" /></a>
44 <ul>
45 <xsl:apply-templates select="directive" mode="toc" />
46 </ul>
47 </li>
48 </xsl:if>
49 </xsl:template>
50 <xsl:template match="directive" mode="toc">
51 <li><a href="#{@id}"><xsl:value-of select="name" /></a></li>
52 </xsl:template>
54 <xsl:template match="title" />
56 <xsl:template match="namespace">
57 <xsl:apply-templates />
58 <xsl:if test="count(directive)=0">
59 <p>No configuration directives defined for this namespace.</p>
60 </xsl:if>
61 </xsl:template>
62 <xsl:template match="namespace/name">
63 <h2 id="{../@id}"><xsl:value-of select="." /></h2>
64 </xsl:template>
65 <xsl:template match="namespace/description">
66 <div class="description">
67 <xsl:copy-of select="div/node()" />
68 </div>
69 </xsl:template>
71 <xsl:template match="directive">
72 <xsl:apply-templates />
73 </xsl:template>
74 <xsl:template match="directive/name">
75 <xsl:apply-templates select="../aliases/alias" mode="anchor" />
76 <h3 id="{../@id}"><xsl:value-of select="../@id" /></h3>
77 </xsl:template>
78 <xsl:template match="alias" mode="anchor">
79 <a id="{.}"></a>
80 </xsl:template>
82 <!-- Do not pass through -->
83 <xsl:template match="alias"></xsl:template>
85 <xsl:template match="directive/constraints">
86 <table class="constraints">
87 <xsl:apply-templates />
88 <xsl:if test="../aliases/alias">
89 <xsl:apply-templates select="../aliases" mode="constraints" />
90 </xsl:if>
91 </table>
92 </xsl:template>
93 <xsl:template match="directive/aliases" mode="constraints">
94 <th>Aliases:</th>
95 <td>
96 <xsl:for-each select="alias">
97 <xsl:if test="position()&gt;1">, </xsl:if>
98 <xsl:value-of select="." />
99 </xsl:for-each>
100 </td>
101 </xsl:template>
102 <xsl:template match="directive/description">
103 <div class="description">
104 <xsl:copy-of select="div/node()" />
105 </div>
106 </xsl:template>
108 <xsl:template match="constraints/type">
109 <tr>
110 <th>Type:</th>
111 <td>
112 <xsl:variable name="type" select="text()" />
113 <xsl:attribute name="class">type type-<xsl:value-of select="$type" /></xsl:attribute>
114 <xsl:value-of select="$typeLookup/types/type[@id=$type]/text()" />
115 <xsl:if test="@allow-null='yes'">
116 (or null)
117 </xsl:if>
118 </td>
119 </tr>
120 </xsl:template>
121 <xsl:template match="constraints/allowed">
122 <tr>
123 <th>Allowed values:</th>
124 <td>
125 <xsl:for-each select="value"><!--
126 --><xsl:if test="position()&gt;1">, </xsl:if>
127 &quot;<xsl:value-of select="." />&quot;<!--
128 --></xsl:for-each>
129 </td>
130 </tr>
131 </xsl:template>
132 <xsl:template match="constraints/default">
133 <tr>
134 <th>Default:</th>
135 <td><pre><xsl:value-of select="." xml:space="preserve" /></pre></td>
136 </tr>
137 </xsl:template>
139 </xsl:stylesheet>