1 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
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>
19 <xsl:if test=
"not($generateServerSideCommands)">
20 <!--
<xsl:value-of select=
"$code"/> --
>
27 <xsl:template match=
"/">
29 <xsl:apply-templates/>
33 <xsl:template match=
"faq">
34 <xsl:apply-templates select=
"head"/>
35 <xsl:apply-templates select=
"body"/>
38 <xsl:template match=
"head">
40 <title><xsl:value-of select=
"title"/> <xsl:value-of select=
"version" /></title>
44 <xsl:template match=
"body">
48 <xsl:value-of select=
"/faq/head/title"/>
49 <xsl:value-of select=
"version" />
52 <xsl:apply-templates select=
"/faq/head/summary"/>
56 <H2>Table of Contents
</H2>
58 <xsl:apply-templates select=
"section" mode=
"TOC"/>
61 <xsl:apply-templates select=
"about-section" mode=
"TOC"/>
63 <xsl:apply-templates select=
"about-section"/>
65 <!-- A download section -->
68 <H2>Download the FAQ
</H2>
69 <xsl:apply-templates select=
"/faq/head/download"/>
73 <!-- contents of each section -->
74 <xsl:apply-templates select=
"section"/>
81 <xsl:template match=
"summary">
84 <xsl:apply-templates/>
92 <xsl:template match=
"maintainers">
93 <xsl:apply-templates/>
99 <xsl:template match=
"maintainer">
100 <A href=
"mailto:{email}">
101 <xsl:value-of select=
"name"/>
109 <xsl:template match=
"section" mode=
"TOC">
110 <li><a href=
"{@id}.shtml"><xsl:value-of select=
"title"/></a></li>
117 <xsl:template match=
"about-section" mode=
"TOC">
118 <p><a href=
"{@id}.shtml"><xsl:value-of select=
"title"/></a></p>
125 <xsl:template match=
"section | about-section">
126 <xt:document method=
"html" href=
"{@id}.shtml">
130 <title>[NEdit] FAQ:
<xsl:value-of select=
"title"/></title>
135 <H1><xsl:value-of select=
"title"/></H1>
137 <!-- include the paragraphs outside of qna-s -->
139 <xsl:apply-templates select=
"p|div"/>
142 <xsl:apply-templates select=
"qna" mode=
"TOC"/>
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>]
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>]
186 <xsl:template match=
"qna" mode=
"TOC">
189 <xsl:apply-templates select=
"q" mode=
"TOC"/>
195 <xsl:template match=
"q" mode=
"TOC">
196 <xsl:apply-templates/>
200 <xsl:template match=
"qna">
201 <xsl:variable name=
"prefix"><xsl:number value=
"position()"/>.
</xsl:variable>
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>
213 <xsl:if test=
"not(long-q)">
215 <xsl:value-of select=
"$prefix"/><xsl:apply-templates select=
"q"/>
219 <xsl:apply-templates select=
"a"/>
224 <xsl:template match=
"q">
225 <xsl:apply-templates/>
228 <xsl:template match=
"a">
229 <xsl:apply-templates/>
235 <!-- paragraph and divisions -->
237 <xsl:template match=
"ul|ol|blockquote|p|pre">
238 <xsl:param name=
"prefix"/>
239 <xsl:param name=
"citation"/>
241 <xsl:when test=
"$citation">
243 <xsl:element name=
"{name()}">
244 <xsl:attribute name=
"class">FAQ
</xsl:attribute>
245 <xsl:value-of select=
"$prefix"/>
246 <xsl:apply-templates/>
251 <xsl:element name=
"{name()}">
252 <xsl:attribute name=
"class">FAQ
</xsl:attribute>
253 <xsl:value-of select=
"$prefix"/>
254 <xsl:apply-templates/>
260 <xsl:template match=
"li">
261 <li><xsl:apply-templates/></li>
264 <!-- style elements -->
266 <xsl:template match=
"email">
267 <a href=
"mailto:{.}"><xsl:value-of select=
"."/></a>
270 <xsl:template match=
"site">
271 <a href=
"{.}" id=
"{@id}" class=
"{@class}"><xsl:value-of select='.'
/></a>
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"/>
280 <xsl:if test=
"$text = ''">
281 <xsl:value-of select=
"@href"/>
284 <a href=
"{@href}"><xsl:value-of select=
"$text1"/></a>
287 <xsl:template match=
"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>
298 <xsl:template match=
"em">
299 <em><xsl:apply-templates/></em>
302 <xsl:template match=
"strong">
303 <strong><xsl:apply-templates/></strong>
306 <xsl:template match=
"tt">
307 <tt><xsl:apply-templates/></tt>
310 <xsl:template match=
"code">
311 <code><xsl:apply-templates/></code>
317 <!-- $Id: faq.xsl,v 1.3 2002/09/26 12:37:37 ajhood Exp $ -->