File: overview.xsl

package info (click to toggle)
mono 6.12.0.199%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,296,836 kB
  • sloc: cs: 11,181,803; xml: 2,850,076; ansic: 699,709; cpp: 123,344; perl: 59,361; javascript: 30,841; asm: 21,853; makefile: 20,405; sh: 15,009; python: 4,839; pascal: 925; sql: 859; sed: 16; php: 1
file content (198 lines) | stat: -rw-r--r-- 5,797 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0"?>

<!--
	Based on Mono's /monodoc/browser/mono-ecma.xsl file.
-->

<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
	exclude-result-prefixes="msxsl"
	>
	
	<xsl:output omit-xml-declaration="yes" />
	
	<xsl:include href="stylesheet.xsl"/>
	
	<xsl:param name="namespace" select="''"/>

	<xsl:variable name="max-types">50</xsl:variable>

	<xsl:template match="Overview">
		<Page>

			<Title>
				<xsl:value-of select="Title"/>
				<xsl:if test="not($namespace='' or $namespace='all' or count(Types/Namespace)=1)">
					<xsl:value-of select="': '"/>
					<xsl:value-of select="$namespace"/>
				</xsl:if>
			</Title>

			<CollectionTitle>
				<xsl:if test="not($namespace='' or $namespace='all')">
					<a href="../index.{$ext}"><xsl:value-of select="Title"/></a>
				</xsl:if>			
			</CollectionTitle>
			
			<PageTitle>
				<xsl:choose>
				<xsl:when test="not($namespace='' or $namespace='all')">
					<xsl:call-template name="GetNamespaceName">
						<xsl:with-param name="ns" select="$namespace" />
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="Title"/>
				</xsl:otherwise>
				</xsl:choose>
			</PageTitle>

			<!--
			<SideBar>
			<xsl:if test="not($namespace='')">
				<p style="font-weight: bold; border-bottom: thin solid black"><a href="../index.{$ext}"><xsl:value-of select="Assembly"/></a></p>
				<xsl:for-each select="Types/Namespace">
					<xsl:sort select="@Name"/>
					<div>
						<a href="../{@Name}/index.{$ext}">
							<xsl:value-of select="@Name"/>
						</a>
					</div>
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="$namespace=''">
					<div class="AssemblyRemarks" style="margin-top: 1em; margin-bottom: 1em">
						<xsl:apply-templates select="Remarks" mode="notoppara"/>
					</div>
			</xsl:if>
			</SideBar>
			-->
			
			<Summary>
				<xsl:if test="$namespace=''">
					<div class="AssemblyRemarks" style="margin-top: 1em; margin-bottom: 1em">
						<xsl:apply-templates select="Remarks" mode="notoppara"/>
					</div>
				</xsl:if>
			</Summary>
			
			<Signature>
			</Signature>
			
			<Remarks>			
				<xsl:choose>
					<xsl:when test="Types/Namespace[@Name=$namespace][count(Type)>0] and $namespace != ''">
						<!-- show all types within namespace -->
						<h2 class="Section"><xsl:call-template name="GetNamespaceName" /></h2>
						<xsl:call-template name="CreateNamespaceDetails">
							<xsl:with-param name="ns" select="Types/Namespace[@Name=$namespace]" />
						</xsl:call-template>
					</xsl:when>
					<xsl:when test="count(Types//Type) &lt; $max-types">
						<!-- index; show all types -->
						<xsl:for-each select="Types/Namespace">
							<xsl:sort select="@Name"/>
							<h2 class="Section"><xsl:call-template name="CreateNamespaceLink" /></h2>
							<xsl:call-template name="CreateNamespaceDetails">
								<xsl:with-param name="ns" select="." />
							</xsl:call-template>
						</xsl:for-each>
					</xsl:when>
					<xsl:otherwise>
						<!-- index; show only namespaces -->
						<xsl:for-each select="Types/Namespace">
							<xsl:sort select="@Name"/>
							<h2 class="Section"><xsl:call-template name="CreateNamespaceLink" /></h2>
							<p><xsl:apply-templates select="document(concat('ns-',@Name,'.xml'), .)/Namespace/Docs/summary" mode="notoppara"/></p>
						</xsl:for-each>
					</xsl:otherwise>
				</xsl:choose>

			</Remarks>
				
			<Members>
			</Members>
			
			<xsl:copy-of select="Copyright"/>
			
		</Page>

	</xsl:template>
	<xsl:template name="CreateNamespaceDetails">
		<xsl:param name="ns" />
					<p><xsl:apply-templates select="document(concat('ns-',$ns/@Name,'.xml'), .)/Namespace/Docs/remarks" mode="notoppara"/></p>

					<table class="TypesListing" style="margin-top: 1em">
			
					<tr>
						<th>Type</th>
						<th>Description</th>
					</tr>				
						
					<xsl:for-each select="$ns/Type">
						<xsl:sort select="@Name"/>
						<tr valign="top">
							<td>
								<xsl:variable name="path">
									<xsl:choose>
									<xsl:when test="$namespace=parent::Namespace/@Name">.</xsl:when>
									<xsl:otherwise><xsl:value-of select="parent::Namespace/@Name"/></xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
							
								<a href="{$path}/{@Name}.{$ext}">
									<xsl:choose>
										<xsl:when test="@DisplayName != ''">
											<xsl:value-of select="translate (@DisplayName, '+', '.')"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="translate (@Name, '+', '.')"/>
										</xsl:otherwise>
									</xsl:choose>
								</a>
							</td>
							<td>
								<xsl:variable name="docdir">
									<xsl:choose>
										<xsl:when test="parent::Namespace/@Name = ''">.</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="parent::Namespace/@Name" />
										</xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
								<xsl:apply-templates select="document(concat($docdir, '/', @Name, '.xml'), .)/Type/Docs/summary" mode="notoppara"/>
							</td>
						</tr>
					</xsl:for-each>
						
					</table>
	</xsl:template>

	<xsl:template name="GetNamespaceName">
		<xsl:param name="ns" select="@Name" />
		<xsl:choose>
			<xsl:when test="$ns = ''">
				<xsl:text>Root</xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$ns" />
			</xsl:otherwise>
		</xsl:choose>
		<xsl:text> Namespace</xsl:text>
	</xsl:template>

	<xsl:template name="CreateNamespaceLink">
		<xsl:choose>
			<xsl:when test="@Name =''">
				<xsl:call-template name="GetNamespaceName" />
			</xsl:when>
			<xsl:otherwise>
				<a href="{@Name}/index.{$ext}"><xsl:call-template name="GetNamespaceName" /></a>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
</xsl:stylesheet>