• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
4
5   Distributed under the Boost Software License, Version 1.0.
6   (See accompanying file LICENSE_1_0.txt or copy at
7   http://www.boost.org/LICENSE_1_0.txt)
8  -->
9<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10                version="1.0">
11  <!-- Indent the current line-->
12  <xsl:template name="indent">
13    <xsl:param name="indentation"/>
14    <xsl:if test="$indentation > 0">
15      <xsl:text> </xsl:text>
16      <xsl:call-template name="indent">
17        <xsl:with-param name="indentation" select="$indentation - 1"/>
18      </xsl:call-template>
19    </xsl:if>
20  </xsl:template>
21
22  <!--   get name of first ancestor-or-self which is a class, struct or union -->
23  <xsl:template name="object-name">
24    <xsl:variable name="ancestors" select="ancestor-or-self::class |
25      ancestor-or-self::class-specialization |
26      ancestor-or-self::struct |
27      ancestor-or-self::struct-specialization |
28      ancestor-or-self::union |
29      ancestor-or-self::union-specialization"/>
30    <xsl:value-of select="$ancestors[last()]/@name"/>
31  </xsl:template>
32
33  <!--   get name of access specification that we are inside -->
34  <xsl:template name="access-name">
35    <xsl:variable name="ancestors" select="ancestor-or-self::access |
36      ancestor-or-self::class |
37      ancestor-or-self::class-specialization |
38      ancestor-or-self::struct |
39      ancestor-or-self::struct-specialization |
40      ancestor-or-self::union |
41      ancestor-or-self::union-specialization"/>
42    <xsl:choose>
43      <xsl:when test="name($ancestors[last()])='access'">
44        <xsl:value-of select="$ancestors[last()]/@name"/>
45      </xsl:when>
46      <xsl:otherwise>
47        public
48      </xsl:otherwise>
49    </xsl:choose>
50  </xsl:template>
51
52</xsl:stylesheet>
53