summaryrefslogtreecommitdiff
path: root/introspect.xsl
blob: 9a61ec87cb2fa4a0525ee96878af49d76264a147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="ISO-8859-15"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:str="http://xsltsl.org/string" >

<!-- 
 Copyright (C) 2005 Lennart Poettering.

 Licensed under the Academic Free License version 2.1

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->

<!-- $Id: introspect.xsl,v 1.1 2005/08/18 04:04:57 johnp Exp $ -->

<!-- xsl:import href="http://xsltsl.sourceforge.net/modules/stdlib.xsl"/ -->
<xsl:import href="xsltsl-1.2.1/stdlib.xsl"/>

<xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" />

<xsl:template match="/">
  <html>
    <head>
      <title>DBUS Introspection data</title>
      <style type="text/css">
      body { color: black; background-color: white } 
      h1,th,h3 { font-family: serif; background-color: #CCF; border: 1px solid #999; }
      th,h3 { font-size: 125%; }
      tr.sub th { font-size: 1em; padding: 5px; }
      td ul { list-style-type: none; margin: 0px;  }
      .keyword { font-style: normal }
      .type { font-weight: bold }
      .symbol { font-style: italic }
      .interface, .package { margin: 10px; padding: 10px; }
      table, td { border: 1px solid #999; }
      table { border-collapse: collapse; width: 80%; }
      td { padding: 10px; }
      </style>
    </head>
    <body>
    <h1>DBUS Introspection Data</h1>
    <h2><span class="keyword">object</span> <span class="symbol"><xsl:value-of select="node/@name" /></span></h2>
    <table class="package">
       <tr><th colspan="3">Interfaces</th></tr>
        <xsl:for-each select="node/interface">
          <tr><td><a href="#{@name}">
          <xsl:call-template name="str:substring-after-last">
             <xsl:with-param name="text" select="@name" />  
             <xsl:with-param name="chars">.</xsl:with-param>  
          </xsl:call-template>
          </a></td><td><xsl:call-template name="str:substring-before-last">
             <xsl:with-param name="text" select="@name" />  
             <xsl:with-param name="chars">.</xsl:with-param>  
          </xsl:call-template>
          </td><td>
          <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
          </td></tr>  
         </xsl:for-each>
    </table>
          
    <table class="package">
       <tr><th colspan="3">Signals</th></tr>
        <xsl:for-each select="node/interface">
           <xsl:variable name="iface_name" select="@name"/>
           <xsl:for-each select="signal">
             <tr><td>
                <a href="#{$iface_name}.{@name}"><xsl:value-of select="@name"/></a>
             </td><td>
                <xsl:value-of select="$iface_name"/> 
             </td><td>
                <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
            </td></tr> 
            </xsl:for-each>
         </xsl:for-each>
    </table>
    
      <xsl:for-each select="node/interface">
        <div class="interface">
          <h2 id="{@name}">
            <span class="keyword">interface</span><xsl:text> </xsl:text>
            <span class="symbol"><xsl:value-of select="@name"/></span>
          </h2>   

          <p>
             <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
          </p>
          
           <ul>
             <xsl:apply-templates select="annotation[@name!='org.freedesktop.DBus.Description']"/> 
           </ul>

          <xsl:variable name="iface_name" select="@name"/>

         <xsl:if test="property">
         <table class="package">
            <tr><th colspan="4">Properties</th></tr>
            <xsl:for-each select="property">
            <tr>
            <td id="{$iface_name}.{@name}">
               <span class="keyword">property</span><xsl:text
               disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span
                class="symbol"><xsl:value-of select="@name"/></span>
            </td>
            <td><span class="type"><xsl:value-of select="@type"/></span></td>
            <td><span class="keyword"><xsl:value-of select="@access"/></span></td>
            <td>
             <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
            </td>
            </tr>
            <xsl:apply-templates select="annotation[@name!='org.freedesktop.DBus.Description']"/> 
            </xsl:for-each>
         </table>
        </xsl:if>

         <xsl:if test="method">
            <table class="package">
            <tr><th colspan="4">Methods</th></tr>
            <tr class="sub"><th>Name</th><th>In</th><th>Out</th><th>Description</th></tr>
            <xsl:for-each select="method">
            <tr>
            <td id="{$iface_name}.{@name}"><span class="keyword">method</span><xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span class="symbol"><xsl:value-of select="@name"/></span></td>
            <td>
               <ul>
                  <xsl:for-each select="arg[@direction='in']">
                  <li><span class="type"><xsl:value-of select="@type"/></span><xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span class="symbol"><xsl:value-of select="@name"/></span> </li>
                  </xsl:for-each>
               </ul>
            </td>
            <td>
               <ul>
                  <xsl:for-each select="arg[@direction='out']">
                  <li><span class="type"><xsl:value-of select="@type"/></span><xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span class="symbol"><xsl:value-of select="@name"/></span> </li>
                  </xsl:for-each>
               </ul>
            </td>
            <td>
             <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
            </td>
            </tr>
            <xsl:apply-templates select="annotation[@name!='org.freedesktop.DBus.Description']"/> 
            </xsl:for-each>
         </table>
        </xsl:if>

         <xsl:if test="signal">
         <table class="package">
            <tr><th colspan="3">Signals</th></tr>
            <tr class="sub"><th>Name</th><th>Out</th><th>Description</th></tr>
            <xsl:for-each select="signal">
            <tr>
            <td id="{$iface_name}.{@name}"><span class="keyword">signal</span><xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span class="symbol"><xsl:value-of select="@name"/></span></td>
            <td>
               <ul>
                  <xsl:for-each select="arg">
                  <li><span class="type"><xsl:value-of select="@type"/></span><xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;<span class="symbol"><xsl:value-of select="@name"/></span> </li>
                  </xsl:for-each>
               </ul>
            </td>
            <td>
             <xsl:value-of select="annotation[@name='org.freedesktop.DBus.Description']/@value" />
            </td>
            </tr>
            <xsl:apply-templates select="annotation[@name!='org.freedesktop.DBus.Description']"/> 
            </xsl:for-each>
         </table>
        </xsl:if>

        </div>
      </xsl:for-each>
    </body>
  </html>
</xsl:template>

<xsl:template match="interface/annotation"> 
  <li>
    <span class="keyword">annotation</span>
    <xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;
    <code><xsl:value-of select="@name"/></code><xsl:text> = </xsl:text>
    <code><xsl:value-of select="@value"/></code>
  </li>
</xsl:template>

<xsl:template match="method/annotation|property/annotation"> 
  <tr><td colspan="4">
    <span class="keyword">annotation</span>
    <xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;
    <code><xsl:value-of select="@name"/></code><xsl:text> = </xsl:text>
    <code><xsl:value-of select="@value"/></code>
  </td></tr>
</xsl:template>

<xsl:template match="signal/annotation"> 
  <tr><td colspan="3">
    <span class="keyword">annotation</span>
    <xsl:text disable-output-escaping='yes'>&amp;</xsl:text>nbsp;
    <code><xsl:value-of select="@name"/></code><xsl:text> = </xsl:text>
    <code><xsl:value-of select="@value"/></code>
  </td></tr>
</xsl:template>

</xsl:stylesheet>