Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / tools / monkeydoc / Resources / ecmaspec-html-css.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet 
3         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4         version="1.0"
5         xmlns:monodoc="monodoc:///extensions"
6         exclude-result-prefixes="monodoc"
7         >
8 <xsl:output omit-xml-declaration="yes" />
9
10 <xsl:template match="/clause">
11         <div class="header" id="ecmaspec">
12                 <div class="subtitle">ECMA-334 C# Language Specification</div> 
13                 <div class="title"><xsl:value-of select="@number"/>: <xsl:value-of select="@title"/>
14                 <xsl:if test="@informative"> (informative) </xsl:if></div>
15         </div>
16         <xsl:apply-templates />
17 </xsl:template>
18
19 <xsl:template match="paragraph">
20         <p>
21                 <xsl:apply-templates />
22         </p>
23 </xsl:template>
24
25 <xsl:template match="keyword">
26         <span class="keyword"> <xsl:apply-templates/></span> <xsl:text> </xsl:text>
27 </xsl:template>
28
29 <xsl:template match="hyperlink">
30         <a href="ecmaspec:{.}">
31                 <xsl:value-of select="." />
32         </a>
33 </xsl:template>
34
35 <xsl:template match="list">
36         <ul>
37                 <xsl:for-each select="list_item|list">
38                         <li><xsl:apply-templates /></li>
39                 </xsl:for-each>
40         </ul>
41 </xsl:template>
42
43 <xsl:template match="code_example">
44         <div class="code_example">
45            <div class="code_ex_title">Code example</div>
46            <span class="code">
47                   <xsl:value-of select="monodoc:Colorize(string(descendant-or-self::text()), string('csharp'))" disable-output-escaping="yes" />
48            </span>
49         </div>
50 </xsl:template>
51
52 <xsl:template match="symbol">
53         <span class="symbol">
54                 <xsl:apply-templates />
55         </span>
56 </xsl:template>
57
58 <xsl:template match="grammar_production">
59         <dl class="nt_{name/non_terminal/.}">
60                 <dt><xsl:value-of select="name/non_terminal/." /></dt>
61                 
62                 <xsl:for-each select="rhs">
63                 <dd>
64                         <xsl:apply-templates select="node()" />
65                 </dd>
66                 </xsl:for-each>
67         </dl>
68 </xsl:template>
69
70 <xsl:template match="non_terminal">
71         <span class="non_terminal"><xsl:text> </xsl:text><xsl:value-of select="." /></span>
72 </xsl:template>
73
74 <xsl:template match="terminal">
75         <span class="terminal"><xsl:text> </xsl:text><xsl:value-of select="." /></span>
76 </xsl:template>
77
78 <xsl:template match="opt">
79         <xsl:text> (</xsl:text><span class="opt">optional</span><xsl:text>) </xsl:text>
80 </xsl:template>
81
82 <xsl:template match="note|example">
83         <div class="note">
84                 <xsl:apply-templates />
85         </div>
86 </xsl:template>
87
88 <xsl:template match="table_line">
89     <xsl:apply-templates /><br />
90 </xsl:template>
91
92 <xsl:template match="@*|node()">
93         <xsl:copy>
94                 <xsl:apply-templates select="@*|node()"/>
95         </xsl:copy>
96 </xsl:template>
97
98 </xsl:stylesheet>