3 this stylesheet builds the API*.html , it works based on the api
4 reference file defined in the first 'document' below below.
6 <xsl:stylesheet version="1.0"
7 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8 xmlns:exsl="http://exslt.org/common"
9 extension-element-prefixes="exsl"
10 exclude-result-prefixes="exsl">
12 <!-- Import the rest of the site stylesheets -->
13 <xsl:import href="site.xsl"/>
15 <!-- Generate XHTML-1.0 transitional -->
16 <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
17 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
18 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
20 <xsl:variable name="href_base" select="''"/>
21 <xsl:variable name="apirefs" select="document('libxslt-refs.xml')"/>
22 <xsl:variable name="module" select="$apirefs/apirefs/@name"/>
23 <xsl:key name="refhref" match="reference" use="@name"/>
25 <xsl:template match="ref" mode="anchor">
26 <xsl:variable name="name" select="@name"/>
27 <xsl:for-each select="document('libxslt-refs.xml')">
28 <a href="{key('refhref', $name)/@href}"><xsl:value-of select="$name"/></a><br/>
31 <xsl:template match="type" mode="reflist">
32 <h2>Type <xsl:value-of select="@name"/>:</h2>
34 <xsl:for-each select="ref">
35 <xsl:apply-templates mode="anchor" select="."/>
41 <xsl:template match="letter" mode="reflist">
42 <h2>Letter <xsl:value-of select="@name"/>:</h2>
44 <xsl:for-each select="ref">
45 <xsl:apply-templates mode="anchor" select="."/>
51 <xsl:template match="file" mode="reflist">
52 <h2><a name="{@name}">Module <xsl:value-of select="@name"/></a>:</h2>
54 <xsl:for-each select="ref">
55 <xsl:apply-templates mode="anchor" select="."/>
61 <xsl:template match="letter" mode="wordlist">
62 <h2>Letter <xsl:value-of select="@name"/>:</h2>
64 <xsl:for-each select="word">
65 <dt><xsl:value-of select="@name"/></dt>
67 <xsl:for-each select="ref">
68 <xsl:apply-templates mode="anchor" select="."/>
77 <xsl:template match="constructors">
78 <xsl:message>Generating API Constructors</xsl:message>
79 <xsl:variable name="title">List of constructors for <xsl:value-of select="$module"/></xsl:variable>
80 <xsl:document href="APIconstructors.html" method="xml" encoding="ISO-8859-1"
81 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
82 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
85 <xsl:call-template name="style"/>
86 <xsl:element name="title">
87 <xsl:value-of select="$title"/>
90 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
91 <xsl:call-template name="titlebox">
92 <xsl:with-param name="title" select="$title"/>
94 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
96 <td bgcolor="#8b7765">
97 <table border="0" cellspacing="0" cellpadding="2" width="100%">
99 <td valign="top" width="200" bgcolor="#8b7765">
100 <xsl:call-template name="develtoc"/>
102 <td valign="top" bgcolor="#8b7765">
103 <table border="0" cellspacing="0" cellpadding="1" width="100%">
106 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
109 <table border="0" cellpadding="3" cellspacing="1" width="100%">
111 <td bgcolor="#fffacd">
112 <xsl:apply-templates mode="reflist" select="type"/>
113 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
133 <xsl:template match="files">
134 <xsl:message>Generating API List of synbols per file</xsl:message>
135 <xsl:variable name="title">List of Symbols per Module for <xsl:value-of select="$module"/></xsl:variable>
136 <xsl:document href="APIfiles.html" method="xml" encoding="ISO-8859-1"
137 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
138 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
141 <xsl:call-template name="style"/>
142 <xsl:element name="title">
143 <xsl:value-of select="$title"/>
146 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
147 <xsl:call-template name="titlebox">
148 <xsl:with-param name="title" select="$title"/>
150 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
152 <td bgcolor="#8b7765">
153 <table border="0" cellspacing="0" cellpadding="2" width="100%">
155 <td valign="top" width="200" bgcolor="#8b7765">
156 <xsl:call-template name="develtoc"/>
158 <td valign="top" bgcolor="#8b7765">
159 <table border="0" cellspacing="0" cellpadding="1" width="100%">
162 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
165 <table border="0" cellpadding="3" cellspacing="1" width="100%">
167 <td bgcolor="#fffacd">
168 <xsl:apply-templates mode="reflist" select="file"/>
169 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
189 <xsl:template match="functions">
190 <xsl:message>Generating API Functions by Type</xsl:message>
191 <xsl:variable name="title">List of function manipulating types in <xsl:value-of select="$module"/></xsl:variable>
192 <xsl:document href="APIfunctions.html" method="xml" encoding="ISO-8859-1"
193 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
194 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
197 <xsl:call-template name="style"/>
198 <xsl:element name="title">
199 <xsl:value-of select="$title"/>
202 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
203 <xsl:call-template name="titlebox">
204 <xsl:with-param name="title" select="$title"/>
206 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
208 <td bgcolor="#8b7765">
209 <table border="0" cellspacing="0" cellpadding="2" width="100%">
211 <td valign="top" width="200" bgcolor="#8b7765">
212 <xsl:call-template name="develtoc"/>
214 <td valign="top" bgcolor="#8b7765">
215 <table border="0" cellspacing="0" cellpadding="1" width="100%">
218 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
221 <table border="0" cellpadding="3" cellspacing="1" width="100%">
223 <td bgcolor="#fffacd">
224 <xsl:apply-templates mode="reflist" select="type"/>
225 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
245 <xsl:template match="alpha">
246 <xsl:message>Generating API Alphabetic list</xsl:message>
247 <xsl:variable name="title">Alphabetic List of Symbols in <xsl:value-of select="$module"/></xsl:variable>
248 <xsl:document href="APIsymbols.html" method="xml" encoding="ISO-8859-1"
249 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
250 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
253 <xsl:call-template name="style"/>
254 <xsl:element name="title">
255 <xsl:value-of select="$title"/>
258 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
259 <xsl:call-template name="titlebox">
260 <xsl:with-param name="title" select="$title"/>
262 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
264 <td bgcolor="#8b7765">
265 <table border="0" cellspacing="0" cellpadding="2" width="100%">
267 <td valign="top" width="200" bgcolor="#8b7765">
268 <xsl:call-template name="develtoc"/>
270 <td valign="top" bgcolor="#8b7765">
271 <table border="0" cellspacing="0" cellpadding="1" width="100%">
274 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
277 <table border="0" cellpadding="3" cellspacing="1" width="100%">
279 <td bgcolor="#fffacd">
280 <xsl:apply-templates mode="reflist" select="letter"/>
281 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
301 <xsl:template name="apichunks">
303 <xsl:for-each select="/apirefs/index/chunks/chunk">
304 <xsl:variable name="name" select="@name"/>
305 <xsl:variable name="start" select="@start"/>
306 <xsl:variable name="end" select="@end"/>
307 <xsl:variable name="block" select="concat($start, '-', $end)"/>
308 <a href="API{$name}.html"><xsl:value-of select="$block"/></a>
314 <xsl:template match="chunk">
315 <xsl:variable name="name" select="@name"/>
316 <xsl:variable name="start" select="@start"/>
317 <xsl:variable name="end" select="@end"/>
318 <xsl:variable name="block" select="concat($start, '-', $end)"/>
319 <xsl:variable name="target" select="/apirefs/index/chunk[@name = $name]"/>
320 <xsl:variable name="title">API Alphabetic Index <xsl:value-of select="$block"/> for <xsl:value-of select="$module"/></xsl:variable>
321 <xsl:document href="API{$name}.html" method="xml" encoding="ISO-8859-1"
322 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
323 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
326 <xsl:call-template name="style"/>
327 <xsl:element name="title">
328 <xsl:value-of select="$title"/>
331 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
332 <xsl:call-template name="titlebox">
333 <xsl:with-param name="title" select="$title"/>
335 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
337 <td bgcolor="#8b7765">
338 <table border="0" cellspacing="0" cellpadding="2" width="100%">
340 <td valign="top" width="200" bgcolor="#8b7765">
341 <xsl:call-template name="develtoc"/>
343 <td valign="top" bgcolor="#8b7765">
344 <table border="0" cellspacing="0" cellpadding="1" width="100%">
347 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
350 <table border="0" cellpadding="3" cellspacing="1" width="100%">
352 <td bgcolor="#fffacd">
353 <xsl:call-template name="apichunks"/>
354 <xsl:apply-templates mode="wordlist"
355 select="$target/letter"/>
356 <xsl:call-template name="apichunks"/>
357 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
378 <xsl:template match="index">
379 <xsl:message>Generating API Index</xsl:message>
380 <xsl:apply-templates select="chunks/chunk"/>
383 <xsl:template match="apirefs">
384 <xsl:message>Generating API Cross References</xsl:message>
385 <xsl:apply-templates select="constructors"/>
386 <xsl:apply-templates select="functions"/>
387 <xsl:apply-templates select="alpha"/>
388 <xsl:apply-templates select="files"/>
389 <xsl:apply-templates select="index"/>
392 <xsl:template match="/">
393 <xsl:apply-templates select="$apirefs/apirefs"/>