summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2009-09-21 13:31:25 +0200
committerDaniel Elstner <danielk@openismus.com>2009-09-21 13:50:11 +0200
commit2111d89324e10140fa3e80166e37e0a31543e0e8 (patch)
tree16c4ed925473d8b04347921a5cf7cbb4ca974ab2 /util
parent849e551ee4a41e5ee71aa6c1db2b631e1099ef58 (diff)
downloadmm-common-2111d89324e10140fa3e80166e37e0a31543e0e8.tar.gz
Correct conditional generation of Devhelp chapters
* util/tagfile-to-devhelp2.xsl (chapters): Assign node sets to the intermediate variables using the select attribute, rather than trying to apply the templates in the element content. With this change, the test whether there are any child elements now correctly evaluates to false if the node set is empty.
Diffstat (limited to 'util')
-rw-r--r--util/tagfile-to-devhelp2.xsl32
1 files changed, 12 insertions, 20 deletions
diff --git a/util/tagfile-to-devhelp2.xsl b/util/tagfile-to-devhelp2.xsl
index f834051..67b64da 100644
--- a/util/tagfile-to-devhelp2.xsl
+++ b/util/tagfile-to-devhelp2.xsl
@@ -29,36 +29,28 @@
<book title="{$book_title}" name="{$book_name}" base="{$book_base}"
link="index.html" version="2" language="c++">
<chapters>
- <xsl:variable name="modules">
- <xsl:apply-templates select="tagfile/compound[@kind='group']" mode="module">
- <xsl:sort lang="en" select="title"/>
- </xsl:apply-templates>
- </xsl:variable>
+ <xsl:variable name="modules" select="tagfile/compound[@kind='group']"/>
<xsl:if test="$modules">
<sub name="Modules" link="modules.html">
- <xsl:copy-of select="$modules"/>
+ <xsl:apply-templates select="$modules" mode="module">
+ <xsl:sort lang="en" select="title"/>
+ </xsl:apply-templates>
</sub>
</xsl:if>
-
- <xsl:variable name="namespaces">
- <xsl:apply-templates select="tagfile/compound[@kind='namespace']" mode="sub">
- <xsl:sort lang="en" case-order="upper-first" select="name"/>
- </xsl:apply-templates>
- </xsl:variable>
+ <xsl:variable name="namespaces" select="tagfile/compound[@kind='namespace']"/>
<xsl:if test="$namespaces">
<sub name="Namespaces" link="namespaces.html">
- <xsl:copy-of select="$namespaces"/>
+ <xsl:apply-templates select="$namespaces" mode="sub">
+ <xsl:sort lang="en" case-order="upper-first" select="name"/>
+ </xsl:apply-templates>
</sub>
</xsl:if>
-
- <xsl:variable name="classes">
- <xsl:apply-templates select="tagfile/compound[@kind='class' or @kind='struct']" mode="sub">
- <xsl:sort lang="en" case-order="upper-first" select="name"/>
- </xsl:apply-templates>
- </xsl:variable>
+ <xsl:variable name="classes" select="tagfile/compound[@kind='class' or @kind='struct']"/>
<xsl:if test="$classes">
<sub name="Classes" link="classes.html">
- <xsl:copy-of select="$classes"/>
+ <xsl:apply-templates select="$classes" mode="sub">
+ <xsl:sort lang="en" case-order="upper-first" select="name"/>
+ </xsl:apply-templates>
</sub>
</xsl:if>
</chapters>