ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/doc/doc2html.xsl
Revision: 1.9
Committed: Mon Aug 4 02:14:44 2003 UTC (20 years, 9 months ago) by pcg
Content type: application/xml
Branch: MAIN
CVS Tags: stable
Changes since 1.8: +9 -4 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 <!DOCTYPE xsl:stylesheet>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4 <xsl:output method="xhtml" omit-xml-declaration='yes' media-type="text/html" encoding="utf-8"/>
5
6 <xsl:template name="mbody">
7 <p>
8 <!-- horrible hack -->
9 <xsl:apply-templates select="child::node()[1][name() != 'member']"/>
10 <xsl:apply-templates select="child::node()[2][name() = 'p']"/>
11 </p>
12 <table border="1" width="100%">
13 <tr>
14 <th width="10%">NAME</th>
15 <th width="8%">TYPE</th>
16 <th width="4%">VALUE</th>
17 <th>DESCRIPTION</th>
18 <th width="10%">GUARD</th>
19 </tr>
20 <xsl:apply-templates select="child::member"/>
21 </table>
22 </xsl:template>
23
24 <xsl:template match="member">
25 <tr>
26 <td><xsl:value-of select="@name"/></td>
27 <td><xsl:value-of select="@type"/></td>
28 <td><xsl:value-of select="@value"/>&#160;</td>
29 <td>
30 <!-- horrible hack -->
31 <xsl:apply-templates select="following-sibling::node()[1][name() != 'member']"/>
32 <xsl:apply-templates select="child::node()[2][name() = 'p']"/>
33 &#160;
34 </td>
35 <td>
36 <b><xsl:value-of select="@guard-member"/></b>
37 <xsl:text> </xsl:text><xsl:value-of select="@guard-cond"/>
38 &#160;
39 </td>
40 </tr>
41 </xsl:template>
42
43 <xsl:template match="type">
44 <h4>TYPE <xsl:value-of select="@name"/></h4>
45 BASE TYPE <xsl:value-of select="@type"/>, LENGTH <xsl:value-of select="@length"/>, MULTIPLIER <xsl:value-of select="@multiplier"/>
46 <br/>
47 </xsl:template>
48
49 <xsl:template match="enum|set">
50 <h4><xsl:value-of select="name()"/>: <xsl:value-of select="@name"/></h4>
51 <xsl:call-template name="mbody"/>
52 </xsl:template>
53
54 <xsl:template match="struct">
55 <h4>STRUCTURE <xsl:value-of select="@name"/></h4>
56 <xsl:if test="@class">
57 CLASS: <xsl:value-of select="@class"/><br/>
58 </xsl:if>
59 <xsl:call-template name="mbody"/>
60 </xsl:template>
61
62 <xsl:template match="message">
63 <h4>
64 <xsl:if test="@src='server'"><a name="{concat('S', @type)}"/>ORIGIN: SERVER;</xsl:if>
65 <xsl:if test="@src='client'"><a name="{concat('C', @type)}"/>ORIGIN: CLIENT;</xsl:if>
66 MESSAGE: <xsl:value-of select="@name"/>
67 </h4>
68 NUMERIC TYPE (hex): <xsl:value-of select="@type"/>
69 <xsl:if test="@src='server'">
70 <xsl:variable name="ref" select="@name"/>
71 <xsl:for-each select="//message[@src='client' and descendant::ref[@reply=$ref]]">
72 (possibly in response to
73 <a href="{concat('#C', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a>
74 )
75 </xsl:for-each>
76 </xsl:if>
77 <xsl:call-template name="mbody"/>
78 </xsl:template>
79
80 <xsl:template match="ref">
81 <xsl:variable name="ref" select="concat(@ref, @reply)"/>
82 <xsl:for-each select="//message[@src='server' and @name=$ref]">
83 <a href="{concat('#S', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a>
84 </xsl:for-each>
85 </xsl:template>
86
87 <xsl:template match="@*|node()">
88 <xsl:copy>
89 <xsl:apply-templates select="@*|node()"/>
90 </xsl:copy>
91 </xsl:template>
92
93 </xsl:stylesheet>
94