2 <!-- this stylesheet builds the API*.html , it works based on libxml2-refs.xml
4 <xsl:stylesheet version="1.0"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 xmlns:exsl="http://exslt.org/common"
7 extension-element-prefixes="exsl"
8 exclude-result-prefixes="exsl">
10 <!-- Import the rest of the site stylesheets -->
11 <xsl:import href="site.xsl"/>
13 <!-- Generate XHTML-1.0 transitional -->
14 <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
15 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
16 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
18 <xsl:param name="libname" select="'libxslt'"/>
19 <xsl:param name="dirname" select="''"/>
20 <xsl:param name="logo_base" select="''"/>
22 <!-- href_base controls URI's in site.xsl as well as this stylesheet -->
23 <xsl:variable name="href_base" select="''"/>
25 <xsl:variable name="apirefs" select="document(concat($dirname, $libname, '-refs.xml'))"/>
26 <xsl:variable name="module" select="$apirefs/apirefs/@name"/>
27 <xsl:key name="refhref" match="reference" use="@name"/>
29 <xsl:template match="ref" mode="anchor">
30 <xsl:variable name="name" select="@name"/>
31 <xsl:for-each select="document(concat($dirname, $libname, '-refs.xml'))">
32 <a href="{key('refhref', $name)/@href}"><xsl:value-of select="$name"/></a><br/>
36 <xsl:template match="type" mode="reflist">
37 <h2>Type <xsl:value-of select="@name"/>:</h2>
39 <xsl:for-each select="ref">
40 <xsl:apply-templates mode="anchor" select="."/>
47 <xsl:template match="letter" mode="reflist">
48 <h2>Letter <xsl:value-of select="@name"/>:</h2>
50 <xsl:for-each select="ref">
51 <xsl:apply-templates mode="anchor" select="."/>
58 <xsl:template match="file" mode="reflist">
59 <h2><a name="{@name}">Module <xsl:value-of select="@name"/></a>:</h2>
61 <xsl:for-each select="ref">
62 <xsl:apply-templates mode="anchor" select="."/>
68 <xsl:template match="letter" mode="wordlist">
69 <h2>Letter <xsl:value-of select="@name"/>:</h2>
71 <xsl:for-each select="word">
72 <dt><xsl:value-of select="@name"/></dt>
74 <xsl:for-each select="ref">
75 <xsl:apply-templates mode="anchor" select="."/>
84 <xsl:template match="constructors">
85 <xsl:message>Generating API Constructors</xsl:message>
86 <xsl:variable name="title">List of constructors for <xsl:value-of select="$module"/></xsl:variable>
87 <xsl:variable name="doref">
88 <xsl:apply-templates mode="reflist" select="type"/>
90 <xsl:call-template name="new_page">
91 <xsl:with-param name="filename" select="'APIconstructors.html'"/>
92 <xsl:with-param name="title" select="$title"/>
93 <xsl:with-param name="target" select="$doref"/>
97 <xsl:template match="files">
98 <xsl:message>Generating API List of symbols per file</xsl:message>
99 <xsl:variable name="title">List of Symbols per Module for <xsl:value-of select="$module"/></xsl:variable>
100 <xsl:variable name="doref">
101 <xsl:apply-templates mode="reflist" select="file"/>
103 <xsl:call-template name="new_page">
104 <xsl:with-param name="filename" select="'APIfiles.html'"/>
105 <xsl:with-param name="title" select="$title"/>
106 <xsl:with-param name="target" select="$doref"/>
110 <xsl:template match="functions">
111 <xsl:message>Generating API Functions by Type</xsl:message>
112 <xsl:variable name="title">List of function manipulating types in <xsl:value-of select="$module"/></xsl:variable>
113 <xsl:variable name="doref">
114 <xsl:apply-templates mode="reflist" select="type"/>
116 <xsl:call-template name="new_page">
117 <xsl:with-param name="filename" select="'APIfunctions.html'"/>
118 <xsl:with-param name="title" select="$title"/>
119 <xsl:with-param name="target" select="$doref"/>
123 <xsl:template match="alpha">
124 <xsl:message>Generating API Alphabetic list</xsl:message>
125 <xsl:variable name="title">Alphabetic List of Symbols in <xsl:value-of select="$module"/></xsl:variable>
126 <xsl:variable name="doref">
127 <xsl:apply-templates mode="reflist" select="letter"/>
129 <xsl:call-template name="new_page">
130 <xsl:with-param name="filename" select="'APIsymbols.html'"/>
131 <xsl:with-param name="title" select="$title"/>
132 <xsl:with-param name="target" select="$doref"/>
136 <xsl:template name="apichunks">
138 <xsl:for-each select="/apirefs/index/chunks/chunk">
139 <xsl:variable name="name" select="@name"/>
140 <xsl:variable name="start" select="@start"/>
141 <xsl:variable name="end" select="@end"/>
142 <xsl:variable name="block" select="concat($start, '-', $end)"/>
143 <a href="API{$name}.html"><xsl:value-of select="$block"/></a>
150 <xsl:template match="chunk">
151 <xsl:variable name="name" select="@name"/>
152 <xsl:variable name="start" select="@start"/>
153 <xsl:variable name="end" select="@end"/>
154 <xsl:variable name="block" select="concat($start, '-', $end)"/>
155 <xsl:variable name="target" select="/apirefs/index/chunk[@name = $name]"/>
156 <xsl:variable name="title">API Alphabetic Index <xsl:value-of select="$block"/> for <xsl:value-of select="$module"/></xsl:variable>
157 <xsl:variable name="dochunk">
158 <xsl:call-template name="apichunks"/>
159 <xsl:apply-templates mode="wordlist" select="$target/letter"/>
160 <xsl:call-template name="apichunks"/>
162 <xsl:call-template name="new_page">
163 <xsl:with-param name="filename" select="concat('API', $name, '.html')"/>
164 <xsl:with-param name="title" select="$title"/>
165 <xsl:with-param name="target" select="$dochunk"/>
169 <xsl:template match="index">
170 <xsl:message>Generating API Index</xsl:message>
171 <xsl:apply-templates select="chunks/chunk"/>
174 <xsl:template match="apirefs">
175 <xsl:message>Generating API Cross References</xsl:message>
176 <xsl:apply-templates select="constructors"/>
177 <xsl:apply-templates select="functions"/>
178 <xsl:apply-templates select="alpha"/>
179 <xsl:apply-templates select="files"/>
180 <xsl:apply-templates select="index"/>
183 <xsl:template match="/">
184 <xsl:message>Executing api.xsl</xsl:message>
185 <xsl:apply-templates select="$apirefs/apirefs"/>
186 <xsl:if test="$dirname=''"> <!-- template for search only for base dir -->
187 <xsl:message>Generating search template</xsl:message>
188 <xsl:variable name="dummydata">
189 <xsl:element name="insert_php">
190 <xsl:value-of select="'Insert point for php code'"/>
193 <xsl:call-template name="new_page">
194 <xsl:with-param name="filename" select="'search.templ'"/>
195 <xsl:with-param name="title" select="'Search engine'"/>
196 <xsl:with-param name="target" select="$dummydata"/>