1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <xsl:import href="transform_base.xsl"/>
6 <xsl:output method="xml" indent="yes"/>
8 <xsl:param name="keyword.namespace" select="'Atmel.Language.C'"/>
10 <xsl:template name="generate.book.title">
11 <xsl:text>LUFA Library</xsl:text>
14 <xsl:template name="generate.book.id">
15 <xsl:param name="book.title"/>
18 <xsl:value-of select="@id"/>
21 <xsl:value-of select="translate($book.title, ' ','')"/>
26 <xsl:template match="doxygen">
27 <xsl:variable name="book.title">
28 <xsl:call-template name="generate.book.title"/>
30 <xsl:variable name="book.id">
31 <xsl:call-template name="generate.book.id">
32 <xsl:with-param name="book.title" select="$book.title"/>
36 <book name="{$book.id}">
38 <xsl:value-of select="$book.title"/>
41 <!-- Add index chapter -->
42 <xsl:call-template name="generate.top.level.page">
43 <xsl:with-param name="top.level.page" select="compounddef[@kind = 'page' and contains(@id, 'index')]"/>
46 <!-- Add free-floating chapters -->
47 <xsl:for-each select="compounddef[@kind = 'page' and not(contains(@id, 'index'))]">
48 <xsl:if test="not(//innerpage[@refid = current()/@id])">
49 <xsl:call-template name="generate.top.level.page">
50 <xsl:with-param name="top.level.page" select="current()"/>
55 <!-- Add Module chapter -->
57 <title>Modules</title>
58 <xsl:for-each select="compounddef[@kind = 'group']">
59 <xsl:if test="not(//innergroup[@refid = current()/@id])">
60 <xsl:apply-templates select="current()"/>
67 <xsl:template name="generate.top.level.page">
68 <xsl:param name="top.level.page"/>
70 <chapter id="{$top.level.page/@id}">
72 <xsl:value-of select="$top.level.page/title"/>
74 <xsl:apply-templates select="$top.level.page/detaileddescription"/>
76 <xsl:for-each select="$top.level.page/innerpage">
77 <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/>
82 <xsl:template match="compounddef[@kind = 'page']">
85 <xsl:value-of select="title"/>
87 <xsl:apply-templates select="detaileddescription"/>
89 <xsl:for-each select="innerpage">
90 <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/>
95 <xsl:template match="compounddef[@kind = 'group']">
98 <xsl:value-of select="title"/>
101 <xsl:variable name="book.title">
102 <xsl:call-template name="generate.book.title"/>
105 <xsl:variable name="name">
107 <xsl:when test="contains(compoundname, '_')">
108 <xsl:value-of select="translate(compoundname, '_', '/')"/>
109 <xsl:text>.h</xsl:text>
112 <xsl:value-of select="compoundname"/>
113 <xsl:text>.h</xsl:text>
118 <xsl:variable name="name.escaped">
120 <xsl:when test="contains(compoundname, '_')">
121 <xsl:value-of select="translate(compoundname, '_', '.')"/>
122 <xsl:text>.h</xsl:text>
125 <xsl:value-of select="compoundname"/>
126 <xsl:text>.h</xsl:text>
131 <indexterm id="{$keyword.namespace}.{$name.escaped}">
132 <primary>Header</primary>
134 <xsl:value-of select="$name"/>
139 <xsl:value-of select="$book.title"/>
142 <xsl:value-of select="$name"/>
147 <xsl:value-of select="$name"/>
151 <xsl:apply-templates/>
152 <xsl:for-each select="innerclass">
153 <xsl:apply-templates select="ancestor::*/compounddef[@id = current()/@refid]"/>
156 <xsl:for-each select="innergroup">
157 <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'group' and @id = current()/@refid]"/>
162 <xsl:template match="compounddef[@kind = 'struct' or @kind = 'union']">
163 <xsl:variable name="name" select="compoundname"/>
164 <xsl:variable name="book.title">
165 <xsl:call-template name="generate.book.title"/>
167 <xsl:variable name="book.id">
168 <xsl:call-template name="generate.book.id">
169 <xsl:with-param name="book.title" select="$book.title"/>
173 <section id="{@id}" xreflabel="{$name}">
175 <xsl:value-of select="@kind"/>
176 <xsl:text> </xsl:text>
177 <xsl:value-of select="$name"/>
180 <indexterm id="{$keyword.namespace}.{$name}">
182 <xsl:value-of select="$book.title"/>
185 <xsl:value-of select="$name"/>
189 <xsl:apply-templates select="detaileddescription"/>
190 <xsl:for-each select="sectiondef[@kind='public-attrib']">
191 <table abstyle="striped">
193 <xsl:value-of select="$name"/>
196 <colspec colnum="1" colname="start.col"/>
197 <colspec colnum="3" colname="stop.col"/>
198 <spanspec spanname="full" namest="start.col" nameend="stop.col"/>
201 <entry>Data type</entry>
202 <entry>Field name</entry>
203 <entry>Description</entry>
207 <xsl:for-each select="memberdef">
208 <row id="{@id}" xreflabel="{name}">
210 <xsl:apply-templates select="type"/>
213 <xsl:value-of select="name"/>
214 <indexterm id="{$keyword.namespace}.{$name}.{name}"/>
217 <xsl:apply-templates select="detaileddescription"/>
228 <xsl:template match="linebreak">
229 <xsl:text> </xsl:text>
232 <xsl:template match="image">
235 <xsl:value-of select="."/>
241 <xsl:attribute name="fileref">images/<xsl:value-of select="@name"/></xsl:attribute>
248 <xsl:template match="detaileddescription">
249 <xsl:apply-templates/>
252 <xsl:template match="sect1 | sect2 | sect3 | sect4 | sect5 | sect6 | sect7 | sect8 | sect9">
255 <xsl:attribute name="id">
256 <xsl:value-of select="@id"/>
261 <xsl:value-of select="title"/>
264 <xsl:apply-templates/>
268 <xsl:template match="anchor">
270 <indexterm id="{@id}"/>
274 <xsl:template match="compoundname"/>
276 <xsl:template match="title"/>
278 <xsl:template match="indexterm"/>
280 <xsl:template match="indexentry">
281 <xsl:variable name="prim">
283 <xsl:when test="contains(primaryie, ',')">
284 <xsl:value-of select="normalize-space(substring-before(primaryie, ','))"/>
287 <xsl:value-of select="primaryie"/>
292 <xsl:variable name="sec">
294 <xsl:when test="contains(primaryie, ',')">
295 <xsl:value-of select="normalize-space(substring-after(primaryie, ','))"/>
297 <xsl:when test="seondariye">
298 <xsl:value-of select="secondaryie"/>
304 <xsl:variable name="tert">
306 <xsl:when test="contains(primaryie, ',')">
308 <xsl:when test="secondaryie">
309 <xsl:value-of select="secondaryie"/>
313 <xsl:when test="tertiaryie">
314 <xsl:value-of select="tertiaryie"/>
322 <xsl:attribute name="id">
323 <xsl:value-of select="@id"/>
326 <xsl:if test="$prim">
328 <xsl:value-of select="$prim"/>
333 <xsl:value-of select="$sec"/>
336 <xsl:if test="$tert">
338 <xsl:value-of select="$tert"/>