ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/doc/doc2html.xsl
Revision: 1.7
Committed: Mon Jul 21 13:39:03 2003 UTC (20 years, 10 months ago) by pcg
Content type: application/xml
Branch: MAIN
Changes since 1.6: +5 -5 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.2 <!DOCTYPE xsl:stylesheet>
2 pcg 1.1 <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 pcg 1.5 <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 pcg 1.1 <tr>
14 pcg 1.5 <th width="10%">NAME</th>
15     <th width="10%">TYPE</th>
16     <th width="15%">DEFAULT</th>
17     <th>DESCRIPTION</th>
18     <th width="15%">DEC-GUARD</th>
19 pcg 1.1 </tr>
20 pcg 1.5 <xsl:apply-templates select="child::member"/>
21 pcg 1.1 </table>
22     </xsl:template>
23    
24 pcg 1.5 <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="@default"/>&#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 pcg 1.4 <xsl:template match="type">
44     <h4>TYPE <xsl:value-of select="@name"/></h4>
45 pcg 1.5 BASE TYPE <xsl:value-of select="@type"/>, LENGTH <xsl:value-of select="@length"/>, MULTIPLIER <xsl:value-of select="@multiplier"/>
46     <br/>
47 pcg 1.4 </xsl:template>
48    
49 pcg 1.3 <xsl:template match="struct">
50     <h4>STRUCTURE <xsl:value-of select="@name"/></h4>
51     <xsl:if test="@class">
52     CLASS: <xsl:value-of select="@class"/><br/>
53     </xsl:if>
54 pcg 1.1 <xsl:call-template name="mbody"/>
55     </xsl:template>
56    
57     <xsl:template match="message">
58     <!-- formatting documentation without tags is just dumb,
59 pcg 1.5 but my toolset ("vi") is too limited ;) -->
60     <h4>
61 pcg 1.7 <xsl:if test="@src='server'"><a name="{concat('R', @type)}"/>ORIGIN: SERVER</xsl:if>
62     <xsl:if test="@src='client'"><a name="{concat('S', @type)}"/>ORIGIN: CLIENT</xsl:if>
63 pcg 1.5 MESSAGE <xsl:value-of select="@name"/>
64     </h4>
65 pcg 1.1 NUMERIC TYPE (hex): <xsl:value-of select="@type"/>
66 pcg 1.7 <xsl:if test="@src='server'">
67 pcg 1.5 <xsl:variable name="ref" select="@name"/>
68 pcg 1.7 <xsl:for-each select="//message[@src='client' and descendant::ref[@reply=$ref]]">
69 pcg 1.5 (possibly in response to
70     <a href="{concat('#S', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a>
71     )
72     </xsl:for-each>
73     </xsl:if>
74 pcg 1.1 <xsl:call-template name="mbody"/>
75     </xsl:template>
76    
77 pcg 1.5 <xsl:template match="ref">
78     <xsl:variable name="ref" select="concat(@ref, @reply)"/>
79 pcg 1.7 <xsl:for-each select="//message[@src='server' and @name=$ref]">
80 pcg 1.5 <a href="{concat('#R', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a>
81     </xsl:for-each>
82 pcg 1.1 </xsl:template>
83    
84     <xsl:template match="@*|node()">
85     <xsl:copy>
86     <xsl:apply-templates select="@*|node()"/>
87     </xsl:copy>
88     </xsl:template>
89    
90     </xsl:stylesheet>
91