The prog parameter from ExecRE() is first dereferenced and than checked for
[nedit.git] / doc / faq.xsl
blobb1f6846faabb4c8d0a0227d80648048890f4ecc7
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 version="1.0"
3 xmlns:xt="http://www.jclark.com/xt"
4 extension-element-prefixes="xt">
7 <!-- leave empty (zero-length) to mean false -->
8 <xsl:variable name="generateServerSideCommands">t</xsl:variable>
10 <!-- the stylesheet to use with the generated html pages -->
11 <xsl:variable name="css-stylesheet">/skin/style.css</xsl:variable>
14 <xsl:template name="serverSideInclude">
15 <xsl:param name="code"/>
16 <xsl:if test="$generateServerSideCommands">
17 <xsl:comment><xsl:value-of select="$code"/></xsl:comment>
18 </xsl:if>
19 <xsl:if test="not($generateServerSideCommands)">
20 &lt;!-- <xsl:value-of select="$code"/> --&gt;
21 </xsl:if>
22 </xsl:template>
27 <xsl:template match="/">
28 <html>
29 <xsl:apply-templates/>
30 </html>
31 </xsl:template>
33 <xsl:template match="faq">
34 <xsl:apply-templates select="head"/>
35 <xsl:apply-templates select="body"/>
36 </xsl:template>
38 <xsl:template match="head">
39 <head>
40 <title><xsl:value-of select="title"/> <xsl:value-of select="version" /></title>
41 </head>
42 </xsl:template>
44 <xsl:template match="body">
46 <BODY>
47 <H1>
48 <xsl:value-of select="/faq/head/title"/>
49 <xsl:value-of select="version" />
50 </H1>
52 <xsl:apply-templates select="/faq/head/summary"/>
54 <HR/>
56 <H2>Table of Contents</H2>
57 <ul>
58 <xsl:apply-templates select="section" mode="TOC"/>
59 </ul>
61 <xsl:apply-templates select="about-section" mode="TOC"/>
63 <xsl:apply-templates select="about-section"/>
65 <!-- A download section -->
66 <HR/>
68 <H2>Download the FAQ</H2>
69 <xsl:apply-templates select="/faq/head/download"/>
71 </BODY>
73 <!-- contents of each section -->
74 <xsl:apply-templates select="section"/>
76 </xsl:template>
81 <xsl:template match="summary">
82 <H2>Overview</H2>
83 <DIV>
84 <xsl:apply-templates/>
85 </DIV>
86 </xsl:template>
92 <xsl:template match="maintainers">
93 <xsl:apply-templates/>
94 </xsl:template>
99 <xsl:template match="maintainer">
100 <A href="mailto:{email}">
101 <xsl:value-of select="name"/>
102 </A>
103 </xsl:template>
109 <xsl:template match="section" mode="TOC">
110 <li><a href="{@id}.shtml"><xsl:value-of select="title"/></a></li>
111 </xsl:template>
117 <xsl:template match="about-section" mode="TOC">
118 <p><a href="{@id}.shtml"><xsl:value-of select="title"/></a></p>
119 </xsl:template>
125 <xsl:template match="section | about-section">
126 <xt:document method="html" href="{@id}.shtml">
128 <html>
129 <head>
130 <title>[NEdit] FAQ: <xsl:value-of select="title"/></title>
131 </head>
133 <body>
135 <H1><xsl:value-of select="title"/></H1>
137 <!-- include the paragraphs outside of qna-s -->
139 <xsl:apply-templates select="p|div"/>
141 <ol>
142 <xsl:apply-templates select="qna" mode="TOC"/>
143 </ol>
146 <HR/>
148 <xsl:apply-templates select="qna"/>
150 <xsl:variable name="prev-sect"><xsl:value-of
151 select="preceding-sibling::*[position() = 1]/@id"/></xsl:variable>
152 <xsl:variable name="prev-title"><xsl:value-of
153 select="id($prev-sect)/title"/></xsl:variable>
154 <xsl:variable name="next-sect"><xsl:value-of
155 select="following-sibling::*[position() = 1]/@id"/></xsl:variable>
156 <xsl:variable name="next-title"><xsl:value-of
157 select="id($next-sect)/title"/></xsl:variable>
160 <xsl:if test="$prev-sect != ''">
161 [<A HREF="{$prev-sect}.shtml">
162 <xsl:value-of select="$prev-title"/></A>]
163 </xsl:if>
165 [<A HREF="index.shtml">FAQ Contents</A>]
167 <xsl:if test="$next-sect != ''">
168 [<A HREF="{$next-sect}.shtml">
169 <xsl:value-of select="$next-title"/></A>]
170 </xsl:if>
172 </body>
174 </html>
176 </xt:document>
177 </xsl:template>
186 <xsl:template match="qna" mode="TOC">
187 <li>
188 <A HREF="#{@id}">
189 <xsl:apply-templates select="q" mode="TOC"/>
190 </A>
191 </li>
192 </xsl:template>
195 <xsl:template match="q" mode="TOC">
196 <xsl:apply-templates/>
197 </xsl:template>
200 <xsl:template match="qna">
201 <xsl:variable name="prefix"><xsl:number value="position()"/>. </xsl:variable>
202 <A NAME="{@id}"></A>
203 <xsl:if test="long-q">
204 <xsl:apply-templates select="long-q/*[position()=1]">
205 <xsl:with-param name="prefix"><xsl:value-of select="$prefix"/></xsl:with-param>
206 <xsl:with-param name="citation">true</xsl:with-param>
207 </xsl:apply-templates>
209 <xsl:apply-templates select="long-q/*[position()>1]">
210 <xsl:with-param name="citation">true</xsl:with-param>
211 </xsl:apply-templates>
212 </xsl:if>
213 <xsl:if test="not(long-q)">
214 <CITE><B>
215 <xsl:value-of select="$prefix"/><xsl:apply-templates select="q"/>
216 </B></CITE>
217 </xsl:if>
219 <xsl:apply-templates select="a"/>
221 <HR/>
222 </xsl:template>
224 <xsl:template match="q">
225 <xsl:apply-templates/>
226 </xsl:template>
228 <xsl:template match="a">
229 <xsl:apply-templates/>
230 </xsl:template>
235 <!-- paragraph and divisions -->
237 <xsl:template match="ul|ol|blockquote|p|pre">
238 <xsl:param name="prefix"/>
239 <xsl:param name="citation"/>
240 <xsl:choose>
241 <xsl:when test="$citation">
242 <cite id="FAQ"><b>
243 <xsl:element name="{name()}">
244 <xsl:attribute name="class">FAQ</xsl:attribute>
245 <xsl:value-of select="$prefix"/>
246 <xsl:apply-templates/>
247 </xsl:element>
248 </b></cite>
249 </xsl:when>
250 <xsl:otherwise>
251 <xsl:element name="{name()}">
252 <xsl:attribute name="class">FAQ</xsl:attribute>
253 <xsl:value-of select="$prefix"/>
254 <xsl:apply-templates/>
255 </xsl:element>
256 </xsl:otherwise>
257 </xsl:choose>
258 </xsl:template>
260 <xsl:template match="li">
261 <li><xsl:apply-templates/></li>
262 </xsl:template>
264 <!-- style elements -->
266 <xsl:template match="email">
267 <a href="mailto:{.}"><xsl:value-of select="."/></a>
268 </xsl:template>
270 <xsl:template match="site">
271 <a href="{.}" id="{@id}" class="{@class}"><xsl:value-of select='.'/></a>
272 </xsl:template>
274 <xsl:template match="link">
275 <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
276 <xsl:variable name="text1">
277 <xsl:if test="$text != ''">
278 <xsl:value-of select="$text"/>
279 </xsl:if>
280 <xsl:if test="$text = ''">
281 <xsl:value-of select="@href"/>
282 </xsl:if>
283 </xsl:variable>
284 <a href="{@href}"><xsl:value-of select="$text1"/></a>
285 </xsl:template>
287 <xsl:template match="img">
288 <img>
289 <xsl:attribute name="src"><xsl:value-of select="src"/></xsl:attribute>
290 <xsl:attribute name="alt"><xsl:value-of select="alt"/></xsl:attribute>
291 </img>
292 </xsl:template>
298 <xsl:template match="em">
299 <em><xsl:apply-templates/></em>
300 </xsl:template>
302 <xsl:template match="strong">
303 <strong><xsl:apply-templates/></strong>
304 </xsl:template>
306 <xsl:template match="tt">
307 <tt><xsl:apply-templates/></tt>
308 </xsl:template>
310 <xsl:template match="code">
311 <code><xsl:apply-templates/></code>
312 </xsl:template>
315 </xsl:stylesheet>
317 <!-- $Id: faq.xsl,v 1.3 2002/09/26 12:37:37 ajhood Exp $ -->