ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/doc/doc2html.xsl
(Generate patch)

Comparing kgsueme/doc/doc2html.xsl (file contents):
Revision 1.4 by pcg, Thu Jun 5 10:28:35 2003 UTC vs.
Revision 1.5 by pcg, Sat Jun 14 09:19:28 2003 UTC

2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 3
4<xsl:output method="xhtml" omit-xml-declaration='yes' media-type="text/html" encoding="utf-8"/> 4<xsl:output method="xhtml" omit-xml-declaration='yes' media-type="text/html" encoding="utf-8"/>
5 5
6<xsl:template name="mbody"> 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>
7 <table border="1"> 12 <table border="1" width="100%">
8 <tr> 13 <tr>
9 <th>NAME</th><th>TYPE</th><th>DEFAULT</th><th>DEC-GUARD</th> 14 <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>
10 </tr> 19 </tr>
11 <xsl:apply-templates select="node()" mode="mbody"/> 20 <xsl:apply-templates select="child::member"/>
12 </table> 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="@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>
13</xsl:template> 41</xsl:template>
14 42
15<xsl:template match="type"> 43<xsl:template match="type">
16 <h4>TYPE <xsl:value-of select="@name"/></h4> 44 <h4>TYPE <xsl:value-of select="@name"/></h4>
17 BASE TYPE: <xsl:value-of select="@type"/><br/> 45 BASE TYPE <xsl:value-of select="@type"/>, LENGTH <xsl:value-of select="@length"/>, MULTIPLIER <xsl:value-of select="@multiplier"/>
18 LENGTH: <xsl:value-of select="@length"/><br/> 46 <br/>
19 MULTIPLIER: <xsl:value-of select="@multiplier"/><br/>
20</xsl:template> 47</xsl:template>
21 48
22<xsl:template match="struct"> 49<xsl:template match="struct">
23 <h4>STRUCTURE <xsl:value-of select="@name"/></h4> 50 <h4>STRUCTURE <xsl:value-of select="@name"/></h4>
24 <xsl:if test="@class"> 51 <xsl:if test="@class">
27 <xsl:call-template name="mbody"/> 54 <xsl:call-template name="mbody"/>
28</xsl:template> 55</xsl:template>
29 56
30<xsl:template match="message"> 57<xsl:template match="message">
31 <!-- formatting documentation without tags is just dumb, 58 <!-- formatting documentation without tags is just dumb,
32 but my toolset ("vi") is too limited. --> 59 but my toolset ("vi") is too limited ;) -->
60 <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>
33 <h4>MESSAGE <xsl:value-of select="@name"/></h4> 63 MESSAGE <xsl:value-of select="@name"/>
64 </h4>
34 NUMERIC TYPE (hex): <xsl:value-of select="@type"/> 65 NUMERIC TYPE (hex): <xsl:value-of select="@type"/>
35 <xsl:if test="@send='yes'"> SEND</xsl:if>
36 <xsl:if test="@recv='yes'"> RECV</xsl:if> 66 <xsl:if test="@recv='yes'">
67 <xsl:variable name="ref" select="@name"/>
68 <xsl:for-each select="//message[@send='yes' and descendant::ref[@reply=$ref]]">
69 (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>
37 <xsl:call-template name="mbody"/> 74 <xsl:call-template name="mbody"/>
38</xsl:template> 75</xsl:template>
39 76
40<xsl:template match="member" mode="mbody"> 77<xsl:template match="ref">
41 <tr> 78 <xsl:variable name="ref" select="concat(@ref, @reply)"/>
42 <td><xsl:value-of select="@name"/></td> 79 <xsl:for-each select="//message[@recv='yes' and @name=$ref]">
43 <td><xsl:value-of select="@type"/></td> 80 <a href="{concat('#R', @type)}"><xsl:value-of select="concat(@name, '(', @type, ')')"/></a>
44 <td><xsl:value-of select="@default"/></td> 81 </xsl:for-each>
45 <td><b><xsl:value-of select="@guard-member"/></b>
46 <xsl:text> </xsl:text><xsl:value-of select="@guard-cond"/>
47 </td>
48 </tr>
49</xsl:template>
50
51<xsl:template match="text()" mode="mbody">
52 <!-- hack -->
53 <tr><td colspan="4">
54 <xsl:copy/>
55 </td></tr>
56</xsl:template> 82</xsl:template>
57 83
58<xsl:template match="@*|node()"> 84<xsl:template match="@*|node()">
59 <xsl:copy> 85 <xsl:copy>
60 <xsl:apply-templates select="@*|node()"/> 86 <xsl:apply-templates select="@*|node()"/>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines