| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<xsl:stylesheet version="1.0" xmlns="http://www.devhelp.net/book" |
| 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
<xsl:strip-space elements="*"/> |
| 23 |
<xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8"/> |
| 24 |
|
| 25 |
<xsl:param name="book_title"/> |
| 26 |
<xsl:param name="book_name"/> |
| 27 |
<xsl:param name="book_base"/> |
| 28 |
|
| 29 |
|
| 30 |
<xsl:key name="nested-group" match="compound[@kind='group']" use="subgroup"/> |
| 31 |
<xsl:key name="nested-scope" match="compound[@kind='namespace']" use="namespace|class"/> |
| 32 |
<xsl:key name="nested-scope" match="compound[@kind='class' or @kind='struct' or @kind='union']" |
| 33 |
use="class"/> |
| 34 |
|
| 35 |
<xsl:template match="/"> |
| 36 |
<book title="{$book_title}" name="{$book_name}" base="{$book_base}" |
| 37 |
link="index.html" version="2" language="c++"> |
| 38 |
<chapters> |
| 39 |
<xsl:variable name="modules" select="tagfile/compound[@kind='group']"/> |
| 40 |
<xsl:if test="$modules"> |
| 41 |
<sub name="Modules" link="modules.html"> |
| 42 |
|
| 43 |
<xsl:apply-templates select="$modules[not(key('nested-group', name))]" |
| 44 |
mode="module-list"> |
| 45 |
<xsl:sort lang="en" select="title"/> |
| 46 |
</xsl:apply-templates> |
| 47 |
</sub> |
| 48 |
</xsl:if> |
| 49 |
<xsl:variable name="namespaces" select="tagfile/compound[@kind='namespace']"/> |
| 50 |
<xsl:if test="$namespaces"> |
| 51 |
<sub name="Namespaces" link="namespaces.html"> |
| 52 |
|
| 53 |
<xsl:for-each select="$namespaces"> |
| 54 |
<xsl:sort lang="en" case-order="upper-first" select="name"/> |
| 55 |
<sub name="{name}" link="{filename}"/> |
| 56 |
</xsl:for-each> |
| 57 |
</sub> |
| 58 |
</xsl:if> |
| 59 |
<xsl:if test="tagfile/compound[@kind='class' or @kind='struct' or @kind='union']"> |
| 60 |
<sub name="Classes" link="classes.html"> |
| 61 |
|
| 62 |
<xsl:apply-templates select="tagfile/compound[not(key('nested-scope', name))]" |
| 63 |
mode="class-list"> |
| 64 |
<xsl:sort lang="en" case-order="upper-first" select="name"/> |
| 65 |
</xsl:apply-templates> |
| 66 |
</sub> |
| 67 |
</xsl:if> |
| 68 |
</chapters> |
| 69 |
<functions> |
| 70 |
<xsl:apply-templates select="tagfile/compound" mode="keyword-list"/> |
| 71 |
</functions> |
| 72 |
</book> |
| 73 |
</xsl:template> |
| 74 |
|
| 75 |
<xsl:template match="compound" mode="module-list"> |
| 76 |
<xsl:variable name="children" select="subgroup"/> |
| 77 |
<sub name="{title}" link="{filename}"> |
| 78 |
|
| 79 |
<xsl:apply-templates select="../compound[@kind='group' and name=$children]" |
| 80 |
mode="module-list"> |
| 81 |
<xsl:sort lang="en" select="title"/> |
| 82 |
</xsl:apply-templates> |
| 83 |
</sub> |
| 84 |
</xsl:template> |
| 85 |
|
| 86 |
<xsl:template match="compound[@kind='namespace' or @kind='class' or @kind='struct' or @kind='union']" |
| 87 |
mode="class-list"> |
| 88 |
|
| 89 |
<xsl:param name="scope"/> |
| 90 |
<xsl:variable name="fullname" select="name"/> |
| 91 |
<xsl:variable name="children" select="namespace|class"/> |
| 92 |
<sub name="{substring-after($fullname, $scope)}" link="{filename}"> |
| 93 |
|
| 94 |
<xsl:apply-templates select="../compound[name=$children]" mode="class-list"> |
| 95 |
<xsl:sort lang="en" case-order="upper-first" select="name"/> |
| 96 |
<xsl:with-param name="scope" select="concat($fullname, '::')"/> |
| 97 |
</xsl:apply-templates> |
| 98 |
</sub> |
| 99 |
</xsl:template> |
| 100 |
|
| 101 |
<xsl:template match="*" mode="class-list"/> |
| 102 |
|
| 103 |
<xsl:template match="compound[@kind='namespace']" mode="keyword-list"> |
| 104 |
|
| 105 |
<xsl:apply-templates select="member" mode="keyword-list"/> |
| 106 |
</xsl:template> |
| 107 |
<xsl:template match="compound[@kind='class' or @kind='struct' or @kind='union']" |
| 108 |
mode="keyword-list"> |
| 109 |
|
| 110 |
<keyword type="struct" name="{name}" link="{filename}"/> |
| 111 |
<xsl:apply-templates select="member" mode="keyword-list"/> |
| 112 |
</xsl:template> |
| 113 |
|
| 114 |
<xsl:template match="member[@kind='typedef']" mode="keyword-list"> |
| 115 |
<keyword type="typedef" xsl:use-attribute-sets="keyword-member"/> |
| 116 |
</xsl:template> |
| 117 |
<xsl:template match="member[@kind='function' or @kind='friend']" mode="keyword-list"> |
| 118 |
<keyword type="function" xsl:use-attribute-sets="keyword-member"/> |
| 119 |
</xsl:template> |
| 120 |
<xsl:template match="member[@kind='enumeration']" mode="keyword-list"> |
| 121 |
<keyword type="enum" xsl:use-attribute-sets="keyword-member"/> |
| 122 |
</xsl:template> |
| 123 |
<xsl:template match="member[@kind='enumvalue' or @kind='define']" mode="keyword-list"> |
| 124 |
<keyword type="macro" xsl:use-attribute-sets="keyword-member"/> |
| 125 |
</xsl:template> |
| 126 |
|
| 127 |
<xsl:template match="*" mode="keyword-list"/> |
| 128 |
|
| 129 |
|
| 130 |
<xsl:attribute-set name="keyword-member"> |
| 131 |
<xsl:attribute name="name"> |
| 132 |
<xsl:value-of select="concat(../name, '::', name)"/> |
| 133 |
</xsl:attribute> |
| 134 |
<xsl:attribute name="link"> |
| 135 |
<xsl:value-of select="concat(anchorfile, '#', anchor)"/> |
| 136 |
</xsl:attribute> |
| 137 |
</xsl:attribute-set> |
| 138 |
|
| 139 |
</xsl:stylesheet> |