… | |
… | |
10 | <xsl:apply-templates select="child::node()[2][name() = 'p']"/> |
10 | <xsl:apply-templates select="child::node()[2][name() = 'p']"/> |
11 | </p> |
11 | </p> |
12 | <table border="1" width="100%"> |
12 | <table border="1" width="100%"> |
13 | <tr> |
13 | <tr> |
14 | <th width="10%">NAME</th> |
14 | <th width="10%">NAME</th> |
15 | <th width="10%">TYPE</th> |
15 | <th width="8%">TYPE</th> |
16 | <th width="15%">DEFAULT</th> |
16 | <th width="4%">VALUE</th> |
17 | <th>DESCRIPTION</th> |
17 | <th>DESCRIPTION</th> |
18 | <th width="15%">DEC-GUARD</th> |
18 | <th width="10%">GUARD</th> |
19 | </tr> |
19 | </tr> |
20 | <xsl:apply-templates select="child::member"/> |
20 | <xsl:apply-templates select="child::member"/> |
21 | </table> |
21 | </table> |
22 | </xsl:template> |
22 | </xsl:template> |
23 | |
23 | |
24 | <xsl:template match="member"> |
24 | <xsl:template match="member"> |
25 | <tr> |
25 | <tr> |
26 | <td><xsl:value-of select="@name"/></td> |
26 | <td><xsl:value-of select="@name"/></td> |
27 | <td><xsl:value-of select="@type"/></td> |
27 | <td><xsl:value-of select="@type"/></td> |
28 | <td><xsl:value-of select="@default"/> </td> |
28 | <td><xsl:value-of select="@value"/> </td> |
29 | <td> |
29 | <td> |
30 | <!-- horrible hack --> |
30 | <!-- horrible hack --> |
31 | <xsl:apply-templates select="following-sibling::node()[1][name() != 'member']"/> |
31 | <xsl:apply-templates select="following-sibling::node()[1][name() != 'member']"/> |
32 | <xsl:apply-templates select="child::node()[2][name() = 'p']"/> |
32 | <xsl:apply-templates select="child::node()[2][name() = 'p']"/> |
33 |   |
33 |   |
… | |
… | |
44 | <h4>TYPE <xsl:value-of select="@name"/></h4> |
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"/> |
45 | BASE TYPE <xsl:value-of select="@type"/>, LENGTH <xsl:value-of select="@length"/>, MULTIPLIER <xsl:value-of select="@multiplier"/> |
46 | <br/> |
46 | <br/> |
47 | </xsl:template> |
47 | </xsl:template> |
48 | |
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 | |
49 | <xsl:template match="struct"> |
54 | <xsl:template match="struct"> |
50 | <h4>STRUCTURE <xsl:value-of select="@name"/></h4> |
55 | <h4>STRUCTURE <xsl:value-of select="@name"/></h4> |
51 | <xsl:if test="@class"> |
56 | <xsl:if test="@class"> |
52 | CLASS: <xsl:value-of select="@class"/><br/> |
57 | CLASS: <xsl:value-of select="@class"/><br/> |
53 | </xsl:if> |
58 | </xsl:if> |
54 | <xsl:call-template name="mbody"/> |
59 | <xsl:call-template name="mbody"/> |
55 | </xsl:template> |
60 | </xsl:template> |
56 | |
61 | |
57 | <xsl:template match="message"> |
62 | <xsl:template match="message"> |
58 | <!-- formatting documentation without tags is just dumb, |
|
|
59 | but my toolset ("vi") is too limited ;) --> |
|
|
60 | <h4> |
63 | <h4> |
61 | <xsl:if test="@send='yes'"><a name="{concat('S', @type)}"/>SEND</xsl:if> |
|
|
62 | <xsl:if test="@recv='yes'"><a name="{concat('R', @type)}"/>RECV</xsl:if> |
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> |
63 | MESSAGE <xsl:value-of select="@name"/> |
66 | MESSAGE: <xsl:value-of select="@name"/> |
64 | </h4> |
67 | </h4> |
65 | NUMERIC TYPE (hex): <xsl:value-of select="@type"/> |
68 | NUMERIC TYPE (hex): <xsl:value-of select="@type"/> |
66 | <xsl:if test="@recv='yes'"> |
69 | <xsl:if test="@src='server'"> |
67 | <xsl:variable name="ref" select="@name"/> |
70 | <xsl:variable name="ref" select="@name"/> |
68 | <xsl:for-each select="//message[@send='yes' and descendant::ref[@reply=$ref]]"> |
71 | <xsl:for-each select="//message[@src='client' and descendant::ref[@reply=$ref]]"> |
69 | (possibly in response to |
72 | (possibly in response to |
70 | <a href="{concat('#S', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a> |
73 | <a href="{concat('#C', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a> |
71 | ) |
74 | ) |
72 | </xsl:for-each> |
75 | </xsl:for-each> |
73 | </xsl:if> |
76 | </xsl:if> |
74 | <xsl:call-template name="mbody"/> |
77 | <xsl:call-template name="mbody"/> |
75 | </xsl:template> |
78 | </xsl:template> |
76 | |
79 | |
77 | <xsl:template match="ref"> |
80 | <xsl:template match="ref"> |
78 | <xsl:variable name="ref" select="concat(@ref, @reply)"/> |
81 | <xsl:variable name="ref" select="concat(@ref, @reply)"/> |
79 | <xsl:for-each select="//message[@recv='yes' and @name=$ref]"> |
82 | <xsl:for-each select="//message[@src='server' and @name=$ref]"> |
80 | <a href="{concat('#R', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a> |
83 | <a href="{concat('#S', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a> |
81 | </xsl:for-each> |
84 | </xsl:for-each> |
82 | </xsl:template> |
85 | </xsl:template> |
83 | |
86 | |
84 | <xsl:template match="@*|node()"> |
87 | <xsl:template match="@*|node()"> |
85 | <xsl:copy> |
88 | <xsl:copy> |