5b35045596d40de74a9ef46cf80785f38120639d
[senf.git] / site_scons / lib / html-munge.xsl
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <xsl:stylesheet version="1.0"\r
3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
4   xmlns:str="http://exslt.org/strings"\r
5   xmlns:set="http://exslt.org/sets"\r
6   xmlns:exslt="http://exslt.org/common"\r
7   extension-element-prefixes="str">\r
8 \r
9   <xsl:output \r
10     method="html" \r
11     encoding="html" \r
12     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"\r
13     doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>\r
14 \r
15   <xsl:param name="topdir" select="''"/>\r
16   \r
17   <xsl:template match="*" name="copy">\r
18     <xsl:copy>\r
19       <xsl:call-template name="copy-attributes"/>\r
20       <xsl:apply-templates/>\r
21     </xsl:copy>\r
22   </xsl:template>\r
23 \r
24   <xsl:template name="copy-attributes">\r
25     <xsl:for-each select="@*">\r
26       <xsl:attribute name="{name(current())}">\r
27         <xsl:choose>\r
28           <xsl:when test="contains(current(),'@TOPDIR@')">\r
29             <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>\r
30             <xsl:value-of select="$topdir"/>\r
31             <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>\r
32           </xsl:when>\r
33           <xsl:otherwise>\r
34             <xsl:value-of select="current()"/>\r
35           </xsl:otherwise>\r
36         </xsl:choose>\r
37       </xsl:attribute>\r
38     </xsl:for-each>\r
39   </xsl:template>\r
40 \r
41   <!-- Replace @TOPDIR@ with relative top directory path -->\r
42 \r
43   <xsl:template match="@*[contains(current(),'@TOPDIR@')]">\r
44     <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>\r
45     <xsl:value-of select="$topdir"/>\r
46     <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>\r
47   </xsl:template>\r
48   \r
49   <!-- Add 'class' attribute  -->\r
50   \r
51   <xsl:template name="add-class">\r
52     <xsl:param name="class"/>\r
53     <xsl:copy>\r
54       <xsl:call-template name="copy-attributes"/>\r
55       <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>\r
56       <xsl:apply-templates/>\r
57     </xsl:copy>\r
58   </xsl:template>\r
59 \r
60   <!-- Add '<br/>' tag after every ', ' -->\r
61   <!-- This code is not very robust, it works with the doxygen output though -->\r
62 \r
63   <xsl:template name="break-comma">\r
64     <xsl:copy>\r
65       <xsl:call-template name="copy-attributes"/>\r
66       <xsl:attribute name="class">commalist</xsl:attribute>\r
67       <xsl:apply-templates mode="break-comma"/>\r
68     </xsl:copy>\r
69   </xsl:template>\r
70  \r
71   <xsl:template match="text()[1]" mode="break-comma">\r
72     <xsl:value-of select="current()"/><br/>\r
73   </xsl:template>\r
74 \r
75   <xsl:template match="*" mode="break-comma">\r
76     <xsl:call-template name="copy"/>\r
77   </xsl:template>\r
78 \r
79   <xsl:template match="text()[contains(current(),' and') or contains(current(),'and ')]" mode="break-comma" priority="1">\r
80     <xsl:value-of select="substring-before(current(),'and')"/>\r
81     <br/>\r
82     <xsl:value-of select="substring-after(current(),'and')"/>\r
83   </xsl:template>\r
84 \r
85   <xsl:template match="text()[contains(current(),',')]" mode="break-comma">\r
86     <xsl:value-of select="substring-before(current(),',')"/>\r
87     <xsl:text>,</xsl:text><br/>\r
88     <xsl:value-of select="substring-after(current(),',')"/>\r
89   </xsl:template>\r
90 \r
91   <!-- ====================================================================== -->\r
92 \r
93   <!-- Hack Glossary menu highlight -->\r
94 \r
95   <xsl:template match="div[@class='tabs menu']/ul[1]">\r
96     <xsl:choose>\r
97       <xsl:when test="//h1[.//text()='Glossary']">\r
98         <xsl:call-template name="add-class">\r
99           <xsl:with-param name="class">glossary</xsl:with-param>\r
100         </xsl:call-template>\r
101       </xsl:when>\r
102       <xsl:otherwise>\r
103         <xsl:copy>\r
104           <xsl:call-template name="copy-attributes"/>\r
105           <xsl:apply-templates/>\r
106         </xsl:copy>\r
107       </xsl:otherwise>\r
108     </xsl:choose>\r
109   </xsl:template>\r
110 \r
111   <!-- Autogenerate table-of-contents for a page -->\r
112 \r
113   <xsl:template match="div[@id='autotoc']">\r
114     <xsl:copy>\r
115       <xsl:call-template name="copy-attributes"/>\r
116       <h1>Contents</h1>\r
117       <ul>\r
118         <xsl:for-each select="following::h2|following::h3|following::h4">\r
119           <xsl:element name="li">\r
120             <xsl:attribute name="class">\r
121               <xsl:value-of select="concat('level_',local-name())"/>\r
122             </xsl:attribute>\r
123             <b><xsl:call-template name="section-number"/><xsl:text> </xsl:text></b>\r
124             <xsl:element name="a">\r
125               <xsl:choose>\r
126                 <xsl:when test="a/@name">\r
127                   <xsl:attribute name="href">\r
128                     <xsl:value-of select="concat('#',a/@name)"/>\r
129                   </xsl:attribute>\r
130                 </xsl:when>\r
131                 <xsl:otherwise>\r
132                   <xsl:attribute name="href">\r
133                     <xsl:text>#autotoc-</xsl:text>\r
134                     <xsl:call-template name="section-number"/>\r
135                   </xsl:attribute>\r
136                 </xsl:otherwise>\r
137               </xsl:choose>\r
138               <xsl:value-of select="string(current())"/>\r
139             </xsl:element>\r
140           </xsl:element>\r
141         </xsl:for-each>\r
142       </ul>\r
143     </xsl:copy>\r
144   </xsl:template>\r
145 \r
146   <xsl:template name="section-number">\r
147     <xsl:number level="any" from="div[@id='autotoc']" count="h2"/>\r
148     <xsl:text>.</xsl:text>\r
149     <xsl:if test="self::h3|self::h4">\r
150       <xsl:number level="any" from="h2" count="h3"/>\r
151       <xsl:text>.</xsl:text>\r
152     </xsl:if>\r
153     <xsl:if test="self::h4">\r
154       <xsl:number level="any" from="h3" count="h4"/>\r
155       <xsl:text>.</xsl:text>\r
156     </xsl:if>\r
157   </xsl:template>\r
158   \r
159   <xsl:template match="h2|h3|h4">\r
160     <xsl:copy>\r
161       <xsl:call-template name="copy-attributes"/>\r
162       <xsl:choose>\r
163         <xsl:when test="preceding::div[@id='autotoc']">\r
164           <xsl:call-template name="section-number"/>\r
165           <xsl:text> </xsl:text>\r
166           <xsl:choose>\r
167             <xsl:when test="a">\r
168               <xsl:apply-templates/>\r
169             </xsl:when>\r
170             <xsl:otherwise>\r
171               <xsl:element name="a">\r
172                 <xsl:attribute name="class"><xsl:text>anchor</xsl:text></xsl:attribute>\r
173                 <xsl:attribute name="name">\r
174                   <xsl:text>autotoc-</xsl:text>\r
175                   <xsl:call-template name="section-number"/>\r
176                 </xsl:attribute>\r
177                 <xsl:apply-templates/>\r
178               </xsl:element>\r
179             </xsl:otherwise>\r
180           </xsl:choose>\r
181         </xsl:when>\r
182         <xsl:otherwise>\r
183           <xsl:apply-templates/>\r
184         </xsl:otherwise>\r
185       </xsl:choose>\r
186     </xsl:copy>\r
187   </xsl:template>\r
188 \r
189   <!-- Build dia image-map from special div/span elements -->\r
190   <xsl:template match="div[@class='diamap']">\r
191     <xsl:element name="map">\r
192       <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>\r
193       <xsl:for-each select="span">\r
194         <xsl:if test="a">\r
195           <xsl:variable name="name" select="string(a[1])"/>\r
196           <xsl:element name="area">\r
197             <xsl:attribute name="shape">rect</xsl:attribute>\r
198             <xsl:attribute name="alt"><xsl:value-of select="$name"/></xsl:attribute>\r
199             <xsl:attribute name="title"><xsl:value-of select="$name"/></xsl:attribute>\r
200             <xsl:attribute name="href"><xsl:value-of select="a[1]/@href"/></xsl:attribute>\r
201             <xsl:attribute name="coords"><xsl:value-of select="@coords"/></xsl:attribute>\r
202           </xsl:element>\r
203         </xsl:if>\r
204       </xsl:for-each>\r
205     </xsl:element>\r
206   </xsl:template>\r
207 \r
208   <!-- Reformat detailed member documentation -->\r
209 \r
210   <xsl:template match="table[@class='memname']">\r
211     <xsl:variable name="name1"><xsl:value-of select="str:split(tr/td[@class='memname'],'::')[position()=last()]"/></xsl:variable>\r
212     <xsl:variable name="name2"><xsl:value-of select="str:split(tr/td[@class='memname'],' ')[position()=last()]"/></xsl:variable>\r
213     <xsl:variable name="name"><xsl:value-of select="substring($name1,string-length($name1)-string-length($name2))"/></xsl:variable>\r
214     <xsl:element name="table">\r
215       <xsl:attribute name="class">\r
216         <xsl:text>memname</xsl:text>\r
217         <xsl:if test="contains(tr/td[@class='memname'],'#define')"><xsl:text> macro</xsl:text></xsl:if>\r
218       </xsl:attribute>\r
219       <tr>\r
220         <td class="memtype" colspan="5">\r
221           <xsl:for-each select="tr/td[@class='memname']/*|tr/td[@class='memname']/text()">\r
222             <xsl:choose>\r
223               <xsl:when test="position()=last()">\r
224                 <xsl:value-of select="substring(.,1,string-length(.)-string-length($name))"/>\r
225               </xsl:when>\r
226               <xsl:otherwise>\r
227                 <xsl:copy-of select="."/>\r
228               </xsl:otherwise>\r
229             </xsl:choose>\r
230           </xsl:for-each>\r
231         </td>\r
232       </tr>\r
233 \r
234       <xsl:choose>\r
235         <xsl:when test="tr/td[@class='paramtype']">\r
236           <tr>\r
237             <td class="memname"><xsl:copy-of select="$name"/></td>\r
238             <td class="memparen">(</td>\r
239             <xsl:copy-of select="tr[1]/td[@class='paramtype']"/>\r
240             <xsl:copy-of select="tr[1]/td[@class='paramname']"/>\r
241             <td class="memparen"><xsl:if test="not(tr[td[@class='paramkey']])">)</xsl:if></td>\r
242           </tr>\r
243 \r
244           <xsl:for-each select="tr[td[@class='paramkey']]">\r
245             <tr>\r
246               <td class="memname"></td>\r
247               <td class="memparen"></td>\r
248               <xsl:copy-of select="td[@class='paramtype']"/>\r
249               <xsl:copy-of select="td[@class='paramname']"/>\r
250               <td class="memparen"><xsl:if test="position()=last()">)</xsl:if></td>\r
251             </tr>\r
252           </xsl:for-each>\r
253         </xsl:when>\r
254         <xsl:otherwise>\r
255           <tr>\r
256             <td class="memname"><xsl:copy-of select="$name"/></td>\r
257             <td class="memparen"><xsl:if test="tr/td[.='(']">()</xsl:if></td>\r
258             <td class="paramtype"></td>\r
259             <td class="paramname"></td>\r
260             <td class="memparen"></td>\r
261           </tr>\r
262         </xsl:otherwise>\r
263       </xsl:choose>\r
264       <tr>\r
265         <td colspan="5" class="memattrs"><xsl:copy-of select="tr/td[@width='100%']/*|tr/td[@width='100%']/text()"/></td>\r
266       </tr>\r
267     </xsl:element>\r
268   </xsl:template>\r
269 \r
270   <!-- no idea, where these &nbsp;'s come frome ... -->\r
271   <xsl:template match="div[@class='memproto']/text()[.='&#160;&#x0a;']">\r
272   </xsl:template>\r
273 \r
274   <!-- Add grouping to all-members page -->\r
275 \r
276   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]">\r
277     <table class="allmembers">\r
278 \r
279       <!-- We need to filter the table rows by looking for indications on the object type       -->\r
280       <!-- The table has 3 acolumns:                                                            -->\r
281       <!--    td[1] is the name of the object,                                                  -->\r
282       <!--    td[2] is the name of the class the object is defined in                           -->\r
283       <!--    td[3] contains additional flags                                                   -->\r
284       <!--                                                                                      -->\r
285       <!-- The conditions we have are:                                                          -->\r
286       <!--                                                                                      -->\r
287       <!--    contains(td[3],'static')        static member (variable or function)              -->\r
288       <!--    contains(td[3],'protected')     protected member of arbitrary type                -->\r
289       <!--    contains(td[3],'private')       private member of arbitrary type                  -->\r
290       <!--    contains(td{3],'friend')        friend declaration (function or class)            -->\r
291       <!--    contains(td[3],'pure virtual')  entry is a pure-virtual member function           -->\r
292       <!--    starts-with(td[1]/text(),'(')   function entry (member, static or friend)         -->\r
293       <!--    contains(td[1], 'typedef')      entry is a typdef                                 -->\r
294       <!--    contains(td[1], 'enum ')        entry is enum type or enumerator                  -->\r
295       <!--    contains(td[1], 'enum name')    entry is the name of an enum type                 -->\r
296       <!--    contains(td[1], 'enum value')   entry is an enumerator value                      -->\r
297       <!--    str:split(substring-before(concat(td[2]/a,'&lt;'),'&lt;'),'::')[position()=last()]==string(td[1]/a) -->\r
298       <!--                                    entry is a constructor                            -->\r
299       <!--    not(starts-with(td[1]/a,'~'))   entry is a destructor                             -->\r
300 \r
301       <xsl:variable name="public-static-memfn">\r
302         <xsl:apply-templates select="tr[contains(td[3],'static')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][starts-with(td[1]/text(),'(')]"/>\r
303       </xsl:variable>\r
304       <xsl:if test="string($public-static-memfn)">\r
305         <tr><td colspan="3"><h2>Static Public Member Functions</h2></td></tr>\r
306         <xsl:copy-of select="$public-static-memfn"/>\r
307       </xsl:if>\r
308 \r
309       <xsl:variable name="public-static-var">\r
310         <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][contains(td[3],'static')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(starts-with(td[1]/text(),'('))]"/>\r
311       </xsl:variable>\r
312       <xsl:if test="string($public-static-var)">\r
313         <tr><td colspan="3"><h2>Static Public Attributes</h2></td></tr>\r
314         <xsl:copy-of select="$public-static-var"/>\r
315       </xsl:if>\r
316       \r
317       <xsl:variable name="public-memfn">\r
318         <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][not(contains(td[3],'static'))][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][starts-with(td[1]/text(),'(')][str:split(substring-before(concat(td[2]/a,'&lt;'),'&lt;'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>\r
319       </xsl:variable>\r
320       <xsl:if test="string($public-memfn)">\r
321         <tr><td colspan="3"><h2>Public Member Functions</h2></td></tr>\r
322         <xsl:copy-of select="set:distinct(exslt:node-set($public-memfn)/tr)"/>\r
323       </xsl:if>\r
324 \r
325       <xsl:variable name="public-var">\r
326         <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][not(contains(td[1],'enum '))][not(contains(td[3],'static'))][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(starts-with(td[1]/text(),'('))]"/>\r
327       </xsl:variable>\r
328       <xsl:if test="string($public-var)">\r
329         <tr><td colspan="3"><h2>Public Attributes</h2></td></tr>\r
330         <xsl:copy-of select="$public-var"/>\r
331       </xsl:if>\r
332       \r
333       <xsl:variable name="public-enum">\r
334         <xsl:apply-templates select="tr[contains(td[1],'enum value')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))]"/>\r
335       </xsl:variable>\r
336       <xsl:if test="string($public-enum)">\r
337         <tr><td colspan="3"><h2>Public Enumerators</h2></td></tr>\r
338         <xsl:copy-of select="$public-enum"/>\r
339       </xsl:if>\r
340       \r
341       <xsl:variable name="public-type">\r
342         <xsl:apply-templates select="tr[contains(td[1],'typedef') or contains(td[1],'enum name')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))]"/>\r
343       </xsl:variable>\r
344       <xsl:if test="string($public-type)">\r
345         <tr><td colspan="r"><h2>Public Types</h2></td></tr>\r
346         <xsl:copy-of select="$public-type"/>\r
347       </xsl:if>\r
348       \r
349       <xsl:variable name="non-public">\r
350         <xsl:apply-templates select="tr[contains(td[3],'protected') or contains(td[3],'private') or contains(td[3],'friend')][str:split(substring-before(concat(td[2]/a,'&lt;'),'&lt;'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>\r
351       </xsl:variable>\r
352       <xsl:if test="string($non-public)">\r
353         <tr><td colspan="3"><h2>Non-Public Members</h2></td></tr>\r
354         <xsl:copy-of select="$non-public"/>\r
355       </xsl:if>\r
356 \r
357     </table>\r
358   </xsl:template>\r
359 \r
360   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[2]/a/text()[contains(.,'&lt;')]">\r
361     <!-- this removes the template args form the second column to make the table more compact -->\r
362     <xsl:value-of select="substring-before(.,'&lt;')"/>\r
363   </xsl:template>\r
364 \r
365   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[1]/a/text()[contains(.,'::')]">\r
366     <!-- for some weird reason, some members have a fully qualified name in the first column -->\r
367     <!-- remove the qualification here -->\r
368     <xsl:value-of select="str:split(.,'::')[position()=last()]"/>\r
369   </xsl:template>\r
370 \r
371   <!-- Remove the automatically inserted search form (we build our own) -->\r
372   <xsl:template match="li[form]"> \r
373   </xsl:template>\r
374 \r
375   <!-- Add CSS class to alphabetical class index table -->\r
376   <xsl:template match="table[preceding-sibling::*[1][self::div][@class='qindex']]">\r
377     <xsl:call-template name="add-class">\r
378       <xsl:with-param name="class">qindextable</xsl:with-param>\r
379     </xsl:call-template>\r
380   </xsl:template>\r
381 \r
382   <!-- Add CSS class to special paragraphs -->\r
383 \r
384   <xsl:template match="dl[dt/b/a/text()='Bug:']">\r
385     <xsl:call-template name="add-class">\r
386       <xsl:with-param name="class">xref-bug</xsl:with-param>\r
387     </xsl:call-template>\r
388   </xsl:template>\r
389 \r
390   <xsl:template match="dl[dt/b/a/text()='Fix:']">\r
391     <xsl:call-template name="add-class">\r
392       <xsl:with-param name="class">xref-fix</xsl:with-param>\r
393     </xsl:call-template>\r
394   </xsl:template>\r
395 \r
396   <xsl:template match="dl[dt/b/a/text()='Todo:']">\r
397     <xsl:call-template name="add-class">\r
398       <xsl:with-param name="class">xref-todo</xsl:with-param>\r
399     </xsl:call-template>\r
400   </xsl:template>\r
401 \r
402   <xsl:template match="dl[dt/b/a/text()='Idea:']">\r
403     <xsl:call-template name="add-class">\r
404       <xsl:with-param name="class">xref-idea</xsl:with-param>\r
405     </xsl:call-template>\r
406   </xsl:template>\r
407 \r
408   <xsl:template match="dl[dt/b/text()='Parameters:']|dl[dt/b/text()='Template Parameters:']">\r
409     <xsl:call-template name="add-class">\r
410       <xsl:with-param name="class">parameters</xsl:with-param>\r
411     </xsl:call-template>\r
412   </xsl:template>\r
413 \r
414   <xsl:template match="dl[dt/b/text()='Implementation note:']">\r
415     <xsl:call-template name="add-class">\r
416       <xsl:with-param name="class">implementation</xsl:with-param>\r
417     </xsl:call-template>\r
418   </xsl:template>\r
419 \r
420   <xsl:template match="p[starts-with(text(),'Definition at line ')]">\r
421     <xsl:call-template name="add-class">\r
422       <xsl:with-param name="class">sourceline</xsl:with-param>\r
423     </xsl:call-template>\r
424   </xsl:template>\r
425 \r
426   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'References ')]">\r
427     <xsl:call-template name="add-class">\r
428       <xsl:with-param name="class">references</xsl:with-param>\r
429     </xsl:call-template>\r
430   </xsl:template>\r
431 \r
432   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Referenced by ')]">\r
433     <xsl:call-template name="add-class">\r
434       <xsl:with-param name="class">referencedby</xsl:with-param>\r
435     </xsl:call-template>\r
436   </xsl:template>\r
437 \r
438   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented from ')]">\r
439     <xsl:call-template name="add-class">\r
440       <xsl:with-param name="class">reimplementedfrom</xsl:with-param>\r
441     </xsl:call-template>\r
442   </xsl:template>\r
443 \r
444   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented in ')]">\r
445     <xsl:call-template name="add-class">\r
446       <xsl:with-param name="class">reimplementedin</xsl:with-param>\r
447     </xsl:call-template>\r
448   </xsl:template>\r
449 \r
450   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Implemented in ')]">\r
451     <xsl:call-template name="add-class">\r
452       <xsl:with-param name="class">implementedin</xsl:with-param>\r
453     </xsl:call-template>\r
454   </xsl:template>\r
455 \r
456   <!-- Break the following lists after each komma -->\r
457 \r
458   <xsl:template match="p[starts-with(text(),'Inherited by ')]">\r
459     <xsl:call-template name="break-comma"/>\r
460   </xsl:template>\r
461 \r
462   <xsl:template match="p[starts-with(text(),'Inherits ')]">\r
463     <xsl:call-template name="break-comma"/>\r
464   </xsl:template>\r
465 \r
466   <!-- Add CSS class to the member overview table of a class documentation -->\r
467   <xsl:template match="table[descendant::td[@class='memItemLeft']]">\r
468     <xsl:call-template name="add-class">\r
469       <xsl:with-param name="class">members</xsl:with-param>\r
470     </xsl:call-template>\r
471   </xsl:template>\r
472 \r
473   <!-- Add CSS class to literal links (links, where link text and href attribute are the same -->\r
474   <xsl:template match="a[@href=string(current())]" priority="1">\r
475     <xsl:call-template name="add-class">\r
476       <xsl:with-param name="class">literal</xsl:with-param>\r
477     </xsl:call-template>\r
478   </xsl:template>\r
479 \r
480   <!-- Add CSS class to external links -->\r
481   <xsl:template match="a[contains(@href,'http://')]">\r
482     <xsl:call-template name="add-class">\r
483       <xsl:with-param name="class">ext</xsl:with-param>\r
484     </xsl:call-template>\r
485   </xsl:template>\r
486 \r
487   <!-- Add CSS class to anchor-only links -->\r
488   <xsl:template match="a[not(@href)]">\r
489     <xsl:call-template name="add-class">\r
490       <xsl:with-param name="class">anchor</xsl:with-param>\r
491     </xsl:call-template>\r
492   </xsl:template>\r
493 \r
494   <!-- Add CSS class to the brief documentation paragraph of the member documentation -->\r
495   <xsl:template match="div[@class='memdoc']/p[1][not(contains(.,'Definition at line'))]">\r
496     <xsl:call-template name="add-class">\r
497       <xsl:with-param name="class">memtitle</xsl:with-param>\r
498     </xsl:call-template>\r
499   </xsl:template>\r
500 \r
501   <!-- Remove external items from the namespace index -->\r
502   <xsl:template match="div[@id='content2']/table[contains(preceding-sibling::h1/text(),'Namespace Reference')]/tr[td[@class='memItemRight']/a[1][@class='elRef'][@doxygen]]">\r
503   </xsl:template>\r
504   \r
505   <!-- Remove [external] references from the modules page -->\r
506   <xsl:template match="div[@id='content2']/ul/li[a/@class='elRef'][a/@doxygen][code/text()='[external]'][not(ul)]">\r
507   </xsl:template>\r
508 \r
509 </xsl:stylesheet>\r