Blame docs/tagfile-to-devhelp2.xsl

Packit 908522
Packit 908522
Packit 908522
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Packit 908522
  
Packit 908522
  Copyright (c) 2009  Daniel Elstner <daniel.kitta@gmail.com>
Packit 908522
Packit 908522
  XSL transformation from a Doxygen tag file to DevHelp 2 format.
Packit 908522
Packit 908522
  This script is free software: you can redistribute it and/or modify
Packit 908522
  it under the terms of the GNU General Public License as published
Packit 908522
  by the Free Software Foundation, either version 2 of the License,
Packit 908522
  or (at your option) any later version.
Packit 908522
Packit 908522
  This script is distributed in the hope that it will be useful,
Packit 908522
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 908522
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 908522
  GNU General Public License for more details.
Packit 908522
Packit 908522
  You should have received a copy of the GNU General Public License
Packit 908522
  along with this script.  If not, see <http://www.gnu.org/licenses/>.
Packit 908522
  -->
Packit 908522
  <xsl:strip-space elements="*"/>
Packit 908522
  <xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8"/>
Packit 908522
Packit 908522
  <xsl:param name="book_title"/>
Packit 908522
  <xsl:param name="book_name"/>
Packit 908522
  <xsl:param name="book_base"/>
Packit 908522
Packit 908522
  
Packit 908522
  <xsl:key name="nested-group" match="compound[@kind='group']" use="subgroup"/>
Packit 908522
  <xsl:key name="nested-scope" match="compound[@kind='namespace']" use="namespace|class"/>
Packit 908522
  
Packit 908522
           use="class"/>
Packit 908522
Packit 908522
  <xsl:template match="/">
Packit 908522
    
Packit 908522
          link="index.html" version="2" language="c++">
Packit 908522
      <chapters>
Packit 908522
        <xsl:variable name="modules" select="tagfile/compound[@kind='group']"/>
Packit 908522
        <xsl:if test="$modules">
Packit 908522
          <sub name="Modules" link="modules.html">
Packit 908522
            
Packit 908522
            
Packit 908522
                                 mode="module-list">
Packit 908522
              <xsl:sort lang="en" select="title"/>
Packit 908522
            </xsl:apply-templates>
Packit 908522
          </sub>
Packit 908522
        </xsl:if>
Packit 908522
        <xsl:variable name="namespaces" select="tagfile/compound[@kind='namespace']"/>
Packit 908522
        <xsl:if test="$namespaces">
Packit 908522
          <sub name="Namespaces" link="namespaces.html">
Packit 908522
            
Packit 908522
            <xsl:for-each select="$namespaces">
Packit 908522
              <xsl:sort lang="en" case-order="upper-first" select="name"/>
Packit 908522
              <sub name="{name}" link="{filename}"/>
Packit 908522
            </xsl:for-each>
Packit 908522
          </sub>
Packit 908522
        </xsl:if>
Packit 908522
        <xsl:if test="tagfile/compound[@kind='class' or @kind='struct' or @kind='union']">
Packit 908522
          <sub name="Classes" link="classes.html">
Packit 908522
            
Packit 908522
            
Packit 908522
                                 mode="class-list">
Packit 908522
              <xsl:sort lang="en" case-order="upper-first" select="name"/>
Packit 908522
            </xsl:apply-templates>
Packit 908522
          </sub>
Packit 908522
        </xsl:if>
Packit 908522
      </chapters>
Packit 908522
      <functions>
Packit 908522
        <xsl:apply-templates select="tagfile/compound" mode="keyword-list"/>
Packit 908522
      </functions>
Packit 908522
    </book>
Packit 908522
  </xsl:template>
Packit 908522
Packit 908522
  <xsl:template match="compound" mode="module-list">
Packit 908522
    <xsl:variable name="children" select="subgroup"/>
Packit 908522
    <sub name="{title}" link="{filename}">
Packit 908522
      
Packit 908522
      
Packit 908522
                           mode="module-list">
Packit 908522
        <xsl:sort lang="en" select="title"/>
Packit 908522
      </xsl:apply-templates>
Packit 908522
    </sub>
Packit 908522
  </xsl:template>
Packit 908522
Packit 908522
  
Packit 908522
                mode="class-list">
Packit 908522
    
Packit 908522
    <xsl:param name="scope"/>
Packit 908522
    <xsl:variable name="fullname" select="name"/>
Packit 908522
    <xsl:variable name="children" select="namespace|class"/>
Packit 908522
    <sub name="{substring-after($fullname, $scope)}" link="{filename}">
Packit 908522
      
Packit 908522
      <xsl:apply-templates select="../compound[name=$children]" mode="class-list">
Packit 908522
        <xsl:sort lang="en" case-order="upper-first" select="name"/>
Packit 908522
        <xsl:with-param name="scope" select="concat($fullname, '::')"/>
Packit 908522
      </xsl:apply-templates>
Packit 908522
    </sub>
Packit 908522
  </xsl:template>
Packit 908522
  
Packit 908522
  <xsl:template match="*" mode="class-list"/>
Packit 908522
Packit 908522
  <xsl:template match="compound[@kind='namespace']" mode="keyword-list">
Packit 908522
    
Packit 908522
    <xsl:apply-templates select="member" mode="keyword-list"/>
Packit 908522
  </xsl:template>
Packit 908522
  
Packit 908522
                mode="keyword-list">
Packit 908522
    
Packit 908522
    <keyword type="struct" name="{name}" link="{filename}"/>
Packit 908522
    <xsl:apply-templates select="member" mode="keyword-list"/>
Packit 908522
  </xsl:template>
Packit 908522
  
Packit 908522
  <xsl:template match="member[@kind='typedef']" mode="keyword-list">
Packit 908522
    <keyword type="typedef" xsl:use-attribute-sets="keyword-member"/>
Packit 908522
  </xsl:template>
Packit 908522
  <xsl:template match="member[@kind='function' or @kind='friend']" mode="keyword-list">
Packit 908522
    <keyword type="function" xsl:use-attribute-sets="keyword-member"/>
Packit 908522
  </xsl:template>
Packit 908522
  <xsl:template match="member[@kind='enumeration']" mode="keyword-list">
Packit 908522
    <keyword type="enum" xsl:use-attribute-sets="keyword-member"/>
Packit 908522
  </xsl:template>
Packit 908522
  <xsl:template match="member[@kind='enumvalue' or @kind='define']" mode="keyword-list">
Packit 908522
    <keyword type="macro" xsl:use-attribute-sets="keyword-member"/>
Packit 908522
  </xsl:template>
Packit 908522
  
Packit 908522
  <xsl:template match="*" mode="keyword-list"/>
Packit 908522
Packit 908522
  
Packit 908522
  <xsl:attribute-set name="keyword-member">
Packit 908522
    <xsl:attribute name="name">
Packit 908522
      <xsl:value-of select="concat(../name, '::', name)"/>
Packit 908522
    </xsl:attribute>
Packit 908522
    <xsl:attribute name="link">
Packit 908522
      <xsl:value-of select="concat(anchorfile, '#', anchor)"/>
Packit 908522
    </xsl:attribute>
Packit 908522
  </xsl:attribute-set>
Packit 908522
Packit 908522
</xsl:stylesheet>