[mm-common] Reduce duplicate logic in the Devhelp transform



commit 7debeccce8333148dd8845e7241c3a365dc640e6
Author: Daniel Elstner <danielk openismus com>
Date:   Wed Sep 2 15:57:35 2009 +0200

    Reduce duplicate logic in the Devhelp transform
    
    * util/tagfile-to-devhelp2.xsl (functions): Apply the templates to all
    <compound> elements, and add a catch-all template to filter anything
    which did not match.

 util/tagfile-to-devhelp2.xsl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/util/tagfile-to-devhelp2.xsl b/util/tagfile-to-devhelp2.xsl
index f9cf129..f534074 100644
--- a/util/tagfile-to-devhelp2.xsl
+++ b/util/tagfile-to-devhelp2.xsl
@@ -46,8 +46,8 @@
         </sub>
       </chapters>
       <functions>
-        <xsl:apply-templates select="tagfile/compound[ kind='namespace' or @kind='class' or @kind='struct']" mode="compound">
-          <xsl:sort lang="en" select="name"/>
+        <xsl:apply-templates select="tagfile/compound" mode="compound">
+          <xsl:sort lang="en" case-order="upper-first" select="name"/>
         </xsl:apply-templates>
       </functions>
     </book>
@@ -63,15 +63,17 @@
 
   <xsl:template match="compound[ kind='namespace']" mode="compound">
     <xsl:apply-templates select="member" mode="keyword">
-      <xsl:sort lang="en" select="name"/>
+      <xsl:sort lang="en" case-order="upper-first" select="name"/>
     </xsl:apply-templates>
   </xsl:template>
   <xsl:template match="compound[ kind='class' or @kind='struct']" mode="compound">
     <keyword type="struct" name="{name}" link="{filename}"/>
     <xsl:apply-templates select="member" mode="keyword">
-      <xsl:sort lang="en" select="name"/>
+      <xsl:sort lang="en" case-order="upper-first" select="name"/>
     </xsl:apply-templates>
   </xsl:template>
+  <!-- Ignore compounds of unknown type -->
+  <xsl:template match="*" mode="compound"/>
 
   <xsl:template match="member[ kind='function' or @kind='typedef']" mode="keyword">
     <keyword type="{ kind}" xsl:use-attribute-sets="keyword-member"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]