2009-08-07 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mcs / tools / monodoc / Resources / mdoc-html-utils.xsl
1 <?xml version="1.0"?>
2
3 <!--
4         mdoc-html-utils.xsl: ECMA-style docs to HTML stylesheet transformation utils
5
6         Author: Joshua Tauberer (tauberer@for.net)
7         Author: Jonathan Pryor (jpryor@novell.com)
8
9         This file requires that including files define the following callable
10         templates:
11                 - CreateCodeBlock (language, content)
12                 - CreateEnumerationTable (content)
13                 - CreateHeader (content)
14                 - CreateListTable (header, content)
15                 - CreateMembersTable (content)
16                 - CreateSignature (content)
17                 - CreateTypeDocumentationTable (content)
18                 - GetLinkTarget (type, cref)
19                 - CreateEditLink (e)
20
21 -->
22
23 <xsl:stylesheet
24         version="1.0"
25         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26         >
27         
28         <!-- TEMPLATE PARAMETERS -->
29         <xsl:param name="language" select="'C#'"/>
30         <xsl:param name="index" />
31         
32         <xsl:variable name="ThisType" select="/Type"/>
33
34         <!-- The namespace that the current type belongs to. -->
35         <xsl:variable name="TypeNamespace" select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)"/>            
36
37         <!-- THE MAIN RENDERING TEMPLATE -->
38
39         <!-- TYPE OVERVIEW -->
40                 
41         <xsl:template name="CreateTypeOverview">
42                 <xsl:param name="implemented" />
43                 <xsl:param name="show-members-link" />
44
45                 <xsl:attribute name="id">
46                         <xsl:text>T:</xsl:text>
47                         <xsl:call-template name="GetEscapedTypeName">
48                                 <xsl:with-param name="typename" select="@FullName" />
49                         </xsl:call-template>
50                         <xsl:text>:Summary</xsl:text>
51                 </xsl:attribute>
52                 <!-- summary -->
53                 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
54                 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
55
56                 <xsl:if test="$implemented">
57                         <p><b>Mono Implementation Note: </b></p>
58                         <blockquote>
59                                 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
60                         </blockquote>
61                 </xsl:if>
62
63                 <xsl:if test="$show-members-link and not(Base/BaseTypeName='System.Enum' or Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.MulticastDelegate') and count(Members)">
64                         <p>
65                                 See Also:
66                                 <a>
67                                         <xsl:attribute name="href">
68                                                 <xsl:text>T</xsl:text>
69                                                 <xsl:call-template name="GetLinkId">
70                                                         <xsl:with-param name="type" select="." />
71                                                         <xsl:with-param name="member" select="." />
72                                                 </xsl:call-template>
73                                                 <xsl:text>/*</xsl:text>
74                                         </xsl:attribute>
75                                         <xsl:value-of select="translate(@Name, '+', '.')"/>
76                                         <xsl:value-of select="' '" />
77                                         <xsl:text>Members</xsl:text>
78                                 </a>
79                         </p>
80                 </xsl:if>
81                 
82                 <!--
83                 Inheritance tree, but only for non-standard classes and not for interfaces
84                 -->
85                 <xsl:if test="not(Base/BaseTypeName='System.Enum' or Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.ValueType' or Base/BaseTypeName='System.Object' or Base/BaseTypeName='System.MulticatDelegate' or count(Base/ParentType)=0)">
86                         <p>
87                         <xsl:for-each select="Base/ParentType">
88                                 <xsl:sort select="@Order" order="descending"/>
89                                 <xsl:variable name="p" select="position()" />
90                                 <xsl:for-each select="parent::Base/ParentType[position() &lt; $p]">
91                                         <xsl:value-of select="'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'" disable-output-escaping="yes"/>
92                                 </xsl:for-each>
93                                 <a>
94                                         <xsl:attribute name="href">
95                                                 <xsl:call-template name="GetLinkTarget">
96                                                         <xsl:with-param name="type" select="@Type" />
97                                                         <xsl:with-param name="cref">
98                                                                 <xsl:text>T:</xsl:text>
99                                                                 <xsl:call-template name="GetEscapedTypeName">
100                                                                         <xsl:with-param name="typename" select="@Type" />
101                                                                 </xsl:call-template>
102                                                         </xsl:with-param>
103                                                 </xsl:call-template>
104                                         </xsl:attribute>
105                                         <xsl:value-of select="@Type"/>
106                                 </a>
107                                 <br/>
108                         </xsl:for-each>
109
110                         <xsl:for-each select="Base/ParentType">
111                                 <xsl:value-of select="'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'" disable-output-escaping="yes"/>
112                         </xsl:for-each>
113                         <xsl:value-of select="@FullName"/>
114                         </p>
115                 </xsl:if>
116                 <!--
117                 <xsl:if test="Base/BaseTypeName='System.Enum'">
118                         <br/>
119                         The type of the values in this enumeration is 
120                         <xsl:apply-templates select="Members/Member[@MemberName='value__']/ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>.
121                 </xsl:if>
122                 -->
123         </xsl:template>
124
125         <xsl:template name="CreateTypeSignature">
126                         <xsl:attribute name="id">
127                                 <xsl:text>T:</xsl:text>
128                                 <xsl:call-template name="GetEscapedTypeName">
129                                         <xsl:with-param name="typename" select="@FullName" />
130                                 </xsl:call-template>
131                                 <xsl:text>:Signature</xsl:text>
132                         </xsl:attribute>
133                         <!-- signature -->
134                         <xsl:call-template name="CreateSignature">
135                                 <xsl:with-param name="content">
136                                         <xsl:choose>
137                                         <xsl:when test="$language='C#'">
138
139                                                 <xsl:for-each select="Attributes/Attribute">
140                                                         <xsl:text>[</xsl:text>
141                                                         <xsl:value-of select="AttributeName"/>
142                                                         <xsl:text>]</xsl:text>
143                                                         <br/>
144                                                 </xsl:for-each>
145
146                                                 <xsl:for-each select="ReturnValue/Attributes/Attribute">
147                                                         <xsl:text>[return:</xsl:text>
148                                                         <xsl:value-of select="AttributeName"/>
149                                                         <xsl:text>]</xsl:text>
150                                                         <br/>
151                                                 </xsl:for-each> 
152         
153                                                 <xsl:choose>
154
155                                                 <xsl:when test="Base/BaseTypeName='System.Enum'">
156                                                         <xsl:call-template name="getmodifiers">
157                                                                 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
158                                                         </xsl:call-template>
159
160                                                         <xsl:text>enum </xsl:text>
161         
162                                                         <!-- member name, argument list -->
163                                                         <b>
164                                                         <xsl:value-of select="translate (@Name, '+', '.')"/>
165                                                         </b>
166                                                 </xsl:when>
167         
168                                                 <xsl:when test="Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.MulticastDelegate'">
169                                                         <xsl:choose>
170
171                                                         <xsl:when test="count(Parameters) &gt; 0 and count(ReturnValue) &gt; 0">
172                                                         <!-- Only recreate the delegate signature if the appropriate information
173                                                                 is present in the XML file. -->
174
175                                                         <xsl:call-template name="getmodifiers">
176                                                                 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
177                                                         </xsl:call-template>
178
179                                                         <xsl:text>delegate </xsl:text>
180         
181                                                         <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
182         
183                                                         <!-- hard space -->
184                                                         <xsl:value-of select="' '"/>
185         
186                                                         <!-- member name, argument list -->
187                                                         <b>
188                                                                 <xsl:call-template name="GetDefinitionName">
189                                                                         <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
190                                                                         <xsl:with-param name="TypeParameters" select="TypeParameters" />
191                                                                 </xsl:call-template>
192                                                         </b>
193
194                                                         <!-- hard space -->
195                                                         <xsl:value-of select="' '"/>
196
197                                                         <xsl:value-of select="'('"/> <!-- prevents whitespace issues -->
198                                                         
199                                                         <xsl:for-each select="Parameters/Parameter">
200                                                                 <xsl:call-template name="ShowParameter">
201                                                                         <xsl:with-param name="Param" select="."/>
202                                                                         <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
203                                                                 </xsl:call-template>
204
205                                                                 <xsl:if test="not(position()=last())">, </xsl:if>
206                                                         </xsl:for-each>
207                                                         
208                                                         <xsl:value-of select="')'"/>
209
210                                                         </xsl:when>
211                                                         
212                                                         <xsl:otherwise>
213                                                                 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>       
214                                                         </xsl:otherwise>
215
216                                                         </xsl:choose>
217
218                                                         
219                                                 </xsl:when>
220
221                                                 <xsl:otherwise>
222                                                         <xsl:call-template name="getmodifiers">
223                                                                 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
224                                                                 <xsl:with-param name="typetype" select="true()"/>
225                                                         </xsl:call-template>
226                 
227                                                         <xsl:value-of select="' '"/>
228                 
229                                                         <b>
230                                                                 <xsl:call-template name="GetDefinitionName">
231                                                                         <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
232                                                                         <xsl:with-param name="TypeParameters" select="TypeParameters" />
233                                                                 </xsl:call-template>
234                                                         </b>
235                 
236                                                         <xsl:variable name="HasStandardBaseType" select="Base/BaseTypeName='System.Object' or Base/BaseTypeName='System.ValueType'"/>
237                                                         <xsl:variable name="HasBaseType" select="count(Base/BaseTypeName)>0"/>
238                                                         <xsl:if test="(($HasBaseType) and not($HasStandardBaseType)) or not(count(Interfaces/Interface)=0)">
239                                                                 <xsl:text> : </xsl:text>
240                 
241                                                                 <xsl:if test="$HasBaseType and not($HasStandardBaseType)">
242                                                                         <xsl:apply-templates select="Base/BaseTypeName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
243                                                                         <xsl:if test="not(count(Interfaces/Interface)=0)">,     </xsl:if>
244                                                                 </xsl:if>
245                 
246                                                                 <xsl:for-each select="Interfaces/Interface">
247                                                                         <xsl:if test="not(position()=1)">, </xsl:if>
248                                                                         <xsl:apply-templates select="InterfaceName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
249                                                                 </xsl:for-each>
250                                                         
251                                                         </xsl:if>
252                                                 </xsl:otherwise>
253
254                                                 </xsl:choose>
255
256                                                 <xsl:call-template name="CreateGenericConstraints">
257                                                         <xsl:with-param name="TypeParameters" select="TypeParameters" />
258                                                 </xsl:call-template>
259
260                                         </xsl:when>
261
262                                         <xsl:otherwise>
263                                                 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>
264                                         </xsl:otherwise>
265                                         
266                                         </xsl:choose>
267                                 </xsl:with-param>
268                         </xsl:call-template>
269         </xsl:template>
270
271         <xsl:template name="GetDefinitionName">
272                 <xsl:param name="name" />
273                 <xsl:param name="TypeParameters" />
274
275                 <xsl:choose>
276                         <!-- do NOT process explicitly implemented generic interface members
277                              unless they're actually generic methods. -->
278                         <xsl:when test="contains ($name, '&gt;') and
279                                         '&gt;' = substring ($name, string-length ($name), 1)">
280                                 <xsl:value-of select="substring-before ($name, '&lt;')" />
281                                 <xsl:text>&lt;</xsl:text>
282                                 <xsl:for-each select="$TypeParameters/TypeParameter">
283                                         <xsl:for-each select="Attributes/Attribute">
284                                                 <xsl:text>[</xsl:text>
285                                                 <xsl:value-of select="AttributeName"/>
286                                                 <xsl:text>] </xsl:text>
287                                         </xsl:for-each>
288                                         <xsl:choose>
289                                                 <xsl:when test="@Name">
290                                                         <xsl:value-of select="@Name" />
291                                                 </xsl:when>
292                                                 <xsl:otherwise>
293                                                         <xsl:value-of select="." />
294                                                 </xsl:otherwise>
295                                         </xsl:choose>
296                                         <xsl:if test="not(position()=last())">, </xsl:if>
297                                 </xsl:for-each>
298                                 <xsl:text>&gt;</xsl:text>
299                         </xsl:when>
300                         <xsl:otherwise>
301                                 <xsl:value-of select="$name" />
302                         </xsl:otherwise>
303                 </xsl:choose>
304         </xsl:template>
305
306         <xsl:template name="CreateGenericConstraints">
307                 <xsl:param name="TypeParameters" />
308
309                 <xsl:for-each select="$TypeParameters/TypeParameter">
310                         <xsl:if test="count(Constraints/*) > 0">
311                                 <xsl:call-template name="CreateGenericParameterConstraints">
312                                         <xsl:with-param name="constraints" select="Constraints" />
313                                 </xsl:call-template>
314                         </xsl:if>
315                 </xsl:for-each>
316         </xsl:template>
317
318         <xsl:template name="CreateGenericParameterConstraints">
319                 <xsl:param name="constraints" />
320
321                 <br />
322                 <xsl:text> where </xsl:text>
323                 <xsl:value-of select="@Name" />
324                 <xsl:text> : </xsl:text>
325                 <xsl:variable name="kind" 
326                         select="count($constraints[ParameterAttribute='ReferenceTypeConstraint'])+
327                                 count($constraints[ParameterAttribute='NotNullableValueTypeConstraint'])" />
328                 <xsl:variable name="base" select="count($constraints/BaseTypeName)" />
329                 <xsl:variable name="iface" select="count($constraints/InterfaceName)" />
330                 <xsl:variable name="struct" select="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'" />
331                 <xsl:if test="$constraints/ParameterAttribute='ReferenceTypeConstraint'">
332                         <xsl:text>class</xsl:text>
333                 </xsl:if>
334                 <xsl:if test="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'">
335                         <xsl:text>struct</xsl:text>
336                 </xsl:if>
337                 <xsl:if test="$constraints/BaseTypeName and not($struct)">
338                         <xsl:if test="$kind">, </xsl:if>
339                         <xsl:apply-templates select="$constraints/BaseTypeName" mode="typelink" />
340                 </xsl:if>
341                 <xsl:for-each select="$constraints/InterfaceName">
342                         <xsl:if test="position()=1">
343                                 <xsl:if test="$kind or $base">, </xsl:if>
344                         </xsl:if>
345                         <xsl:apply-templates select="." mode="typelink" />
346                         <xsl:if test="not(position()=last())">, </xsl:if>
347                 </xsl:for-each>
348                 <xsl:if test="$constraints/ParameterAttribute='DefaultConstructorConstraint' and not($struct)">
349                         <xsl:if test="$base or $iface">, </xsl:if>
350                         <xsl:text>new()</xsl:text>
351                 </xsl:if>
352         </xsl:template>
353
354         <xsl:template name="CreateMemberOverview">
355                 <xsl:param name="implemented" />
356
357                 <p class="Summary">
358                         <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
359                         <xsl:apply-templates select="Docs/summary" mode="editlink"/>
360                 </p>
361
362                 <xsl:if test="$implemented">
363                         <p><b>Mono Implementation Note: </b></p>
364                         <blockquote>
365                                 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
366                         </blockquote>
367                 </xsl:if>
368
369                 <!-- member value -->
370                 <xsl:if test="MemberValue">
371                 <p><b>Value: </b>
372                         <xsl:value-of select="MemberValue"/>
373                 </p>
374                 </xsl:if>
375
376         </xsl:template>
377
378         <xsl:template name="CreateMemberSignature">
379                 <xsl:param name="linkid" select="''" />
380
381                 <xsl:call-template name="CreateSignature">
382                         <xsl:with-param name="content">
383                         <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
384                                 <p><i>This is the default property for this class.</i></p>
385                         </xsl:if>
386
387                         <!-- recreate the signature -->
388                 
389                         <xsl:for-each select="Attributes/Attribute[AttributeName != 'System.Runtime.CompilerServices.Extension']">
390                                 <xsl:text>[</xsl:text>
391                                 <xsl:value-of select="AttributeName"/>
392                                 <xsl:text>]</xsl:text>
393                                 <br/>
394                         </xsl:for-each> 
395
396                         <xsl:for-each select="ReturnValue/Attributes/Attribute">
397                                 <xsl:text>[return:</xsl:text>
398                                 <xsl:value-of select="AttributeName"/>
399                                 <xsl:text>]</xsl:text>
400                                 <br/>
401                         </xsl:for-each> 
402
403                         <xsl:call-template name="getmodifiers">
404                                 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
405                         </xsl:call-template>
406
407                         <xsl:if test="MemberType = 'Event'">
408                                 <xsl:text>event </xsl:text>
409
410                                 <xsl:if test="ReturnValue/ReturnType=''">
411                                         <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, 'event '), concat(' ', @MemberName))"/>
412                                 </xsl:if>
413                         </xsl:if>
414
415                         <!-- return value (comes out "" where not applicable/available) -->
416                         <xsl:choose>
417                         <xsl:when test="@MemberName='op_Implicit'">
418                                 <xsl:text>implicit operator</xsl:text>
419                         </xsl:when>
420                         <xsl:when test="@MemberName='op_Explicit'">
421                                 <xsl:text>explicit operator</xsl:text>
422                         </xsl:when>
423                         <xsl:otherwise>
424                                 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
425                                         <xsl:with-param name="wrt" select="$TypeNamespace"/>
426                                 </xsl:apply-templates>
427                         </xsl:otherwise>                                        
428                         </xsl:choose>
429
430                         <!-- hard space -->
431                         <xsl:value-of select="' '"/>
432
433                         <!-- member name -->
434                         <xsl:choose>
435                         
436                         <!-- Constructors get the name of the class -->
437                         <xsl:when test="MemberType='Constructor'">
438                                 <b>
439                                         <xsl:call-template name="GetConstructorName">
440                                                 <xsl:with-param name="type" select="../.." />
441                                                 <xsl:with-param name="ctor" select="." />
442                                         </xsl:call-template>
443                                 </b>
444                         </xsl:when>
445                         
446                         <!-- Conversion operators get the return type -->
447                         <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
448                                 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
449                                         <xsl:with-param name="wrt" select="$TypeNamespace"/>
450                                 </xsl:apply-templates>
451                         </xsl:when>
452                         
453                         <!-- Regular operators get their symbol -->
454                         <xsl:when test="@MemberName='op_UnaryPlus'">operator+</xsl:when>
455                         <xsl:when test="@MemberName='op_UnaryNegation'">operator-</xsl:when>
456                         <xsl:when test="@MemberName='op_LogicalNot'">operator!</xsl:when>
457                         <xsl:when test="@MemberName='op_OnesComplement'">operator~</xsl:when>
458                         <xsl:when test="@MemberName='op_Increment'">operator++</xsl:when>
459                         <xsl:when test="@MemberName='op_Decrement'">operator--</xsl:when>
460                         <xsl:when test="@MemberName='op_True'">operator true</xsl:when>
461                         <xsl:when test="@MemberName='op_False'">operator false</xsl:when>
462                         <xsl:when test="@MemberName='op_Addition'">operator+</xsl:when>
463                         <xsl:when test="@MemberName='op_Subtraction'">operator-</xsl:when>
464                         <xsl:when test="@MemberName='op_Multiply'">operator*</xsl:when>
465                         <xsl:when test="@MemberName='op_Division'">operator/</xsl:when>
466                         <xsl:when test="@MemberName='op_Modulus'">operator%</xsl:when>
467                         <xsl:when test="@MemberName='op_BitwiseAnd'">operator&amp;</xsl:when>
468                         <xsl:when test="@MemberName='op_BitwiseOr'">operator|</xsl:when>
469                         <xsl:when test="@MemberName='op_ExclusiveOr'">operator^</xsl:when>
470                         <xsl:when test="@MemberName='op_LeftShift'">operator&lt;&lt;</xsl:when>
471                         <xsl:when test="@MemberName='op_RightShift'">operator&gt;&gt;</xsl:when>
472                         <xsl:when test="@MemberName='op_Equality'">operator==</xsl:when>
473                         <xsl:when test="@MemberName='op_Inequality'">operator!=</xsl:when>
474                         <xsl:when test="@MemberName='op_GreaterThan'">operator&gt;</xsl:when>
475                         <xsl:when test="@MemberName='op_LessThan'">operator&lt;</xsl:when>
476                         <xsl:when test="@MemberName='op_GreaterThanOrEqual'">operator&gt;=</xsl:when>
477                         <xsl:when test="@MemberName='op_LessThanOrEqual'">operator&lt;=</xsl:when>
478
479                         <xsl:when test="MemberType='Property' and count(Parameters/Parameter) &gt; 0">
480                                 <!-- C# only permits indexer properties to have arguments -->
481                                 <xsl:text>this</xsl:text>
482                         </xsl:when>
483                         
484                         <!-- Everything else just gets its name -->
485                         <xsl:when test="contains (@MemberName, '&lt;')">
486                                 <b>
487                                         <xsl:call-template name="GetDefinitionName">
488                                                 <xsl:with-param name="name" select="@MemberName" />
489                                                 <xsl:with-param name="TypeParameters" select="TypeParameters" />
490                                         </xsl:call-template>
491                                 </b>
492                         </xsl:when>
493
494                         <xsl:otherwise>
495                                 <b><xsl:value-of select="@MemberName"/></b>
496                         </xsl:otherwise>
497                         </xsl:choose>
498
499                         <!-- hard space -->
500                         <xsl:value-of select="' '"/>
501
502                         <!-- argument list -->
503                         <xsl:if test="MemberType='Method' or MemberType='Constructor' or (MemberType='Property' and count(Parameters/Parameter))">
504                                 <xsl:if test="not(MemberType='Property')">(</xsl:if>
505                                 <xsl:if test="MemberType='Property'">[</xsl:if>
506
507                                 <xsl:for-each select="Parameters/Parameter">
508                                         <xsl:call-template name="ShowParameter">
509                                                 <xsl:with-param name="Param" select="."/>
510                                                 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
511                                         </xsl:call-template>
512
513                                         <xsl:if test="not(position()=last())">, </xsl:if>
514                                 </xsl:for-each>
515                                 <xsl:if test="not(MemberType='Property')">)</xsl:if>
516                                 <xsl:if test="MemberType='Property'">]</xsl:if>
517                         </xsl:if>
518
519                         <xsl:if test="MemberType='Property'">
520                                 <xsl:value-of select="' '"/>
521                                 <xsl:text>{</xsl:text>
522                                 <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, '{'), '}')"/>
523                                 <xsl:text>}</xsl:text>
524                         </xsl:if>
525                         <xsl:call-template name="CreateGenericConstraints">
526                                 <xsl:with-param name="TypeParameters" select="TypeParameters" />
527                         </xsl:call-template>
528                         </xsl:with-param>
529                 </xsl:call-template>
530                 
531         </xsl:template>
532
533         <xsl:template name="GetConstructorName">
534                 <xsl:param name="type" />
535                 <xsl:param name="ctor" />
536
537                 <xsl:choose>
538                         <xsl:when test="contains($type/@Name, '&lt;')">
539                                 <xsl:value-of select="translate (substring-before ($type/@Name, '&lt;'), '+', '.')" />
540                         </xsl:when>
541                         <xsl:otherwise>
542                                 <xsl:value-of select="translate ($type/@Name, '+', '.')" />
543                         </xsl:otherwise>
544                 </xsl:choose>
545         </xsl:template>
546
547         <xsl:template name="ShowParameter">
548                 <xsl:param name="Param"/>
549                 <xsl:param name="TypeNamespace"/>
550                 <xsl:param name="prototype" select="false()"/>
551
552                 <xsl:if test="not($prototype)">
553                         <xsl:for-each select="$Param/Attributes/Attribute[not(Exclude='1') and not(AttributeName='ParamArrayAttribute' or AttributeName='System.ParamArray')]">
554                                 <xsl:text>[</xsl:text>
555                                 <xsl:value-of select="AttributeName"/>
556                                 <xsl:text>]</xsl:text>
557                                 <xsl:value-of select="' '"/>
558                         </xsl:for-each>
559                 </xsl:if>
560
561                 <xsl:if test="count($Param/Attributes/Attribute/AttributeName[.='ParamArrayAttribute' or .='System.ParamArray'])">
562                         <b>params</b>
563                         <xsl:value-of select="' '"/>
564                 </xsl:if>
565
566                 <xsl:if test="$Param/@RefType">
567                         <i><xsl:value-of select="$Param/@RefType"/></i>
568                         <!-- hard space -->
569                         <xsl:value-of select="' '"/>
570                 </xsl:if>
571
572                 <!-- parameter type link -->
573                 <xsl:apply-templates select="$Param/@Type" mode="typelink">
574                         <xsl:with-param name="wrt" select="$TypeNamespace"/>
575                 </xsl:apply-templates>
576
577                 <xsl:if test="not($prototype)">
578                         <!-- hard space -->
579                         <xsl:value-of select="' '"/>
580         
581                         <!-- parameter name -->
582                         <xsl:value-of select="$Param/@Name"/>
583                 </xsl:if>
584         </xsl:template>
585
586         <xsl:template name="DisplayDocsInformation">
587                 <xsl:param name="linkid" />
588
589                 <!-- The namespace that the current type belongs to. -->
590                 <xsl:variable name="TypeNamespace" select="substring(@FullName, 1, string-length(@FullName) - string-length(@Name) - 1)"/>
591
592                 <!-- alt member: not sure what these are for, actually -->
593
594                 <xsl:if test="count(Docs/altmember)">
595                         <xsl:call-template name="CreateH4Section">
596                                 <xsl:with-param name="name" select="'See Also'"/>
597                                 <xsl:with-param name="child-id" select="concat ($linkid, ':See Also')" />
598                                 <xsl:with-param name="content">
599                                         <xsl:for-each select="Docs/altmember">
600                                                 <div><xsl:apply-templates select="@cref" mode="cref"/></div>
601                                         </xsl:for-each>
602                                 </xsl:with-param>
603                         </xsl:call-template>
604                 </xsl:if>
605
606                 <!-- parameters & return & value -->
607
608                 <xsl:if test="count(Docs/typeparam)">
609                         <xsl:call-template name="CreateH4Section">
610                                 <xsl:with-param name="name" select="'Type Parameters'"/>
611                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Type Parameters')" />
612                                 <xsl:with-param name="content">
613                                         <dl>
614                                         <xsl:for-each select="Docs/typeparam">
615                                                 <dt><i><xsl:value-of select="@name"/></i></dt>
616                                                 <dd>
617                                                         <xsl:apply-templates select="." mode="notoppara"/>
618                                                         <xsl:apply-templates select="." mode="editlink"/>
619                                                 </dd>
620                                         </xsl:for-each>
621                                         </dl>
622                                 </xsl:with-param>
623                         </xsl:call-template>
624                 </xsl:if>
625                 <xsl:if test="count(Docs/param)">
626                         <xsl:call-template name="CreateH4Section">
627                                 <xsl:with-param name="name" select="'Parameters'"/>
628                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Parameters')" />
629                                 <xsl:with-param name="content">
630                                         <dl>
631                                         <xsl:for-each select="Docs/param">
632                                                 <dt><i><xsl:value-of select="@name"/></i></dt>
633                                                 <dd>
634                                                         <xsl:apply-templates select="." mode="notoppara"/>
635                                                         <xsl:apply-templates select="." mode="editlink"/>
636                                                 </dd>
637                                         </xsl:for-each>
638                                         </dl>
639                                 </xsl:with-param>
640                         </xsl:call-template>
641                 </xsl:if>
642                 <xsl:if test="count(Docs/returns)">
643                         <xsl:call-template name="CreateH4Section">
644                                 <xsl:with-param name="name" select="'Returns'"/>
645                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Returns')" />
646                                 <xsl:with-param name="content">
647                                         <xsl:apply-templates select="Docs/returns" mode="notoppara"/>
648                                         <xsl:apply-templates select="Docs/returns" mode="editlink"/>
649                                 </xsl:with-param>
650                         </xsl:call-template>
651                 </xsl:if>
652                 <xsl:if test="count(Docs/value)">
653                         <xsl:call-template name="CreateH4Section">
654                                 <xsl:with-param name="name" select="'Value'"/>
655                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Value')" />
656                                 <xsl:with-param name="content">
657                                         <xsl:apply-templates select="Docs/value" mode="notoppara"/>
658                                         <xsl:apply-templates select="Docs/value" mode="editlink"/>
659                                 </xsl:with-param>
660                         </xsl:call-template>
661                 </xsl:if>
662
663                 <!-- thread safety -->
664
665                 <xsl:if test="count(ThreadingSafetyStatement)">
666                         <xsl:call-template name="CreateH4Section">
667                                 <xsl:with-param name="name" select="'Thread Safety'"/>
668                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Thread Safety')" />
669                                 <xsl:with-param name="content">
670                                         <xsl:apply-templates select="ThreadingSafetyStatement" mode="notoppara"/>
671                                 </xsl:with-param>
672                         </xsl:call-template>
673                 </xsl:if>
674
675
676                 <!-- permissions -->
677
678                 <xsl:if test="count(Docs/permission)">
679                         <xsl:call-template name="CreateH4Section">
680                                 <xsl:with-param name="name" select="'Permissions'"/>
681                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Permissions')" />
682                                 <xsl:with-param name="content">
683                                         <xsl:call-template name="CreateTypeDocumentationTable">
684                                         <xsl:with-param name="content">
685                                         <xsl:for-each select="Docs/permission">
686                                                 <tr valign="top">
687                                                 <td>
688                                                         <xsl:apply-templates select="@cref" mode="typelink">
689                                                                 <xsl:with-param name="wrt" select="$TypeNamespace"/>
690                                                         </xsl:apply-templates>
691                                                         <xsl:apply-templates select="." mode="editlink"/>
692                                                 </td>
693                                                 <td>
694                                                         <xsl:apply-templates select="." mode="notoppara"/>
695                                                 </td>
696                                                 </tr>
697                                         </xsl:for-each>
698                                         </xsl:with-param>
699                                         </xsl:call-template>
700                                 </xsl:with-param>
701                         </xsl:call-template>
702                 </xsl:if>
703
704                 <!-- method/property/constructor exceptions -->
705
706                 <xsl:if test="count(Docs/exception)">
707                         <xsl:call-template name="CreateH4Section">
708                                 <xsl:with-param name="name" select="'Exceptions'"/>
709                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Exceptions')" />
710                                 <xsl:with-param name="content">
711                                         <xsl:call-template name="CreateTypeDocumentationTable">
712                                         <xsl:with-param name="content">
713                                         <xsl:for-each select="Docs/exception">
714                                                 <tr valign="top">
715                                                 <td>
716                                                         <xsl:apply-templates select="@cref" mode="typelink">
717                                                                 <xsl:with-param name="wrt" select="$TypeNamespace"/>
718                                                         </xsl:apply-templates>
719                                                 </td>
720                                                 <td>
721                                                         <xsl:apply-templates select="." mode="notoppara"/>
722                                                         <xsl:apply-templates select="." mode="editlink"/>
723                                                 </td>
724                                                 </tr>
725                                         </xsl:for-each>
726                                         </xsl:with-param>
727                                         </xsl:call-template>
728                                 </xsl:with-param>
729                         </xsl:call-template>
730                 </xsl:if>
731
732                 <!-- remarks -->
733
734                 <xsl:if test="count(Docs/remarks)">
735                         <xsl:call-template name="CreateH4Section">
736                                 <xsl:with-param name="name" select="'Remarks'"/>
737                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Remarks')" />
738                                 <xsl:with-param name="content">
739                                         <xsl:apply-templates select="Docs/remarks" mode="notoppara"/>
740                                         <xsl:apply-templates select="Docs/remarks" mode="editlink"/>
741                                 </xsl:with-param>
742                         </xsl:call-template>
743                 </xsl:if>
744
745                 <!-- enumeration values -->
746
747                 <xsl:if test="Base/BaseTypeName = 'System.Enum'">
748                         <xsl:call-template name="CreateH4Section">
749                                 <xsl:with-param name="name" select="'Members'"/>
750                                 <xsl:with-param name="child-id" select="concat ($linkid, ':Members')" />
751                                 <xsl:with-param name="content">
752                                         <xsl:call-template name="CreateEnumerationTable">
753                                         <xsl:with-param name="content">
754
755                                                 <xsl:for-each select="Members/Member[MemberType='Field']">
756                                                         <xsl:if test="not(@MemberName='value__')">
757                                                                 <tr valign="top"><td>
758                                                                         <xsl:attribute name="id">
759                                                                                 <xsl:text>F:</xsl:text>
760                                                                                 <xsl:value-of select="translate (/Type/@FullName, '+', '.')" />
761                                                                                 <xsl:text>.</xsl:text>
762                                                                                 <xsl:value-of select="@MemberName" />
763                                                                         </xsl:attribute>
764                                                                         <b>
765                                                                                 <xsl:value-of select="@MemberName"/>
766                                                                         </b>
767                                                                 </td>
768                                                                 <td>
769                                                                         <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
770                                                                         <xsl:apply-templates select="Docs/summary" mode="editlink"/>
771                                                                 </td>
772                                                                 </tr>
773                                                         </xsl:if>
774                                                 </xsl:for-each>
775                                         </xsl:with-param>
776                                         </xsl:call-template>
777                                 </xsl:with-param>
778                         </xsl:call-template>
779                 </xsl:if>
780
781                 <!-- examples -->
782
783                 <xsl:if test="count(Docs/example)">
784                         <xsl:for-each select="Docs/example">
785                                 <xsl:call-template name="CreateH4Section">
786                                         <xsl:with-param name="name" select="'Example'"/>
787                                         <xsl:with-param name="child-id" select="concat ($linkid, ':Example:', position())" />
788                                         <xsl:with-param name="content">
789                                                 <xsl:apply-templates select="." mode="notoppara"/>
790                                         </xsl:with-param>
791                                 </xsl:call-template>
792                         </xsl:for-each>
793                 </xsl:if>
794
795                 <xsl:call-template name="CreateH4Section">
796                         <xsl:with-param name="name" select="'Requirements'"/>
797                         <xsl:with-param name="child-id" select="concat ($linkid, ':Version Information')" />
798                         <xsl:with-param name="content">
799                                 <b>Namespace: </b><xsl:value-of select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)" />
800                                 <xsl:if test="count(/Type/AssemblyInfo/AssemblyName) &gt; 0">
801                                         <br />
802                                         <b>Assembly: </b>
803                                         <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
804                                         <xsl:text> (in </xsl:text>
805                                         <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
806                                         <xsl:text>.dll)</xsl:text>
807                                 </xsl:if>
808                                 <xsl:if test="count(AssemblyInfo/AssemblyVersion) &gt; 0">
809                                         <br />
810                                         <b>Assembly Versions: </b>
811                                         <xsl:for-each select="AssemblyInfo/AssemblyVersion">
812                                                 <xsl:if test="not(position()=1)">, </xsl:if>
813                                                         <xsl:value-of select="."/>
814                                         </xsl:for-each>
815                                 </xsl:if>
816                                 <xsl:if test="count(Docs/since) &gt; 0">
817                                         <br />
818                                         <b>Since: </b>
819                                         <xsl:for-each select="Docs/since">
820                                                 <xsl:if test="not(position()=1)">; </xsl:if>
821                                                         <xsl:value-of select="@version"/>
822                                         </xsl:for-each>
823                                 </xsl:if>
824                                 <xsl:if test="count(Docs/since)=0 and count(/Type/Docs/since) &gt; 0">
825                                         <br />
826                                         <b>Since: </b>
827                                         <xsl:for-each select="/Type/Docs/since">
828                                                 <xsl:if test="not(position()=1)">; </xsl:if>
829                                                         <xsl:value-of select="@version"/>
830                                         </xsl:for-each>
831                                 </xsl:if>
832                         </xsl:with-param>
833                 </xsl:call-template>
834         </xsl:template>
835
836         
837         <!-- Transforms the contents of the selected node into a hyperlink to the type named by the node.  The node can contain a type name (eg System.Object) or a type link (eg T:System.String). Use wrt parameter to specify the current namespace. -->
838
839         <xsl:template match="*|@*" mode="typelink">
840                 <xsl:param name="wrt" select="'notset'"/>
841                 
842                 <xsl:call-template name="maketypelink">
843                                 <xsl:with-param name="type" select="."/>
844                                 <xsl:with-param name="wrt" select="$wrt"/>
845                 </xsl:call-template>
846         </xsl:template>
847
848         <xsl:template name="maketypelink">
849                 <xsl:param name="type" select="'notset'"/>
850                 <xsl:param name="wrt" select="'notset'"/>
851                 <xsl:param name="nested" select="0"/>
852
853                 <xsl:param name="btype">
854                         <xsl:call-template name="ToBrackets">
855                                 <xsl:with-param name="s" select="$type" />
856                         </xsl:call-template>
857                 </xsl:param>
858
859                 <xsl:variable name="array">
860                         <xsl:call-template name="GetArraySuffix">
861                                 <xsl:with-param name="type" select="$type" />
862                         </xsl:call-template>
863                 </xsl:variable>
864                 
865                 <xsl:choose>
866
867                 <!-- chop off T: -->
868                 <xsl:when test="starts-with($type, 'T:')">
869                         <xsl:call-template name="maketypelink">
870                                 <xsl:with-param name="type" select="substring($type, 3)"/>
871                                 <xsl:with-param name="wrt" select="$wrt"/>
872                         </xsl:call-template>
873                 </xsl:when>
874
875                 <xsl:when test="contains ($type, '&amp;') and 
876                                 '&amp;' = substring ($type, string-length ($type), 1)">
877                         <xsl:call-template name="maketypelink">
878                                 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
879                                 <xsl:with-param name="wrt" select="$wrt"/>
880                         </xsl:call-template>
881                 </xsl:when>
882
883                 <xsl:when test="$array">
884                         <xsl:call-template name="maketypelink">
885                                 <xsl:with-param name="type" select="substring($type, 1, string-length($type) - string-length ($array))"/>
886                                 <xsl:with-param name="wrt" select="$wrt"/>
887                         </xsl:call-template>
888                         <xsl:value-of select="$array"/>
889                 </xsl:when>
890
891                 <xsl:when test="contains ($type, '*') and
892                                 '*' = substring ($type, string-length ($type), 1)">
893                         <xsl:call-template name="maketypelink">
894                                 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
895                                 <xsl:with-param name="wrt" select="$wrt"/>
896                         </xsl:call-template>
897                         <xsl:value-of select="'*'"/>
898                 </xsl:when>
899                 
900                 <!-- if this is a generic type parameter, don't make a link but italicize it and give it a tooltip instead -->
901                 <xsl:when test="count($ThisType/TypeParameters/TypeParameter[@Name=$type] | 
902                                 $ThisType/TypeParameters/TypeParameter[child::text()=$type] |
903                                 ancestor::Member/Docs/typeparam[@name=$type]) = 1">
904                         <!-- note that we check if it is a generic type using /Type/TypeParameters because that will have type parameters declared in an outer class if this is a nested class, but then we get the tooltip text from the type parameters documented in this file -->
905                         <i title="{$ThisType/Docs/typeparam[@name=$type] | ancestor::Member/Docs/typeparam[@name=$type]}"><xsl:value-of select="$type"/></i>
906                 </xsl:when>
907                 
908                 <!-- if this is a generic type parameter of a base type, replace it with the type that it was instantiated with -->
909                 <xsl:when test="count(ancestor::Members/BaseTypeArgument[@TypeParamName=$type]) = 1">
910                         <!-- note that an overridden type parameter may be referenced in a type parameter within $type, but we can't replace that nicely since we can't parse generic type names here -->
911                         <xsl:call-template name="maketypelink">
912                                 <xsl:with-param name="type" select="ancestor::Members/BaseTypeArgument[@TypeParamName=$type]"/>
913                                 <xsl:with-param name="wrt" select="$wrt"/>
914                         </xsl:call-template>
915                 </xsl:when>
916                 
917
918                 <xsl:otherwise>
919                         <xsl:variable name="escaped-type">
920                                 <xsl:call-template name="GetEscapedTypeName">
921                                         <xsl:with-param name="typename" select="$btype" />
922                                 </xsl:call-template>
923                         </xsl:variable>
924                         <a>
925                                 <xsl:attribute name="href">
926                                         <xsl:call-template name="GetLinkTarget">
927                                                 <xsl:with-param name="type" select="$escaped-type" />
928                                                 <xsl:with-param name="cref" select="concat ('T:', $escaped-type)" />
929                                         </xsl:call-template>
930                                 </xsl:attribute>
931         
932                                 <xsl:call-template name="GetTypeDisplayName">
933                                         <xsl:with-param name="T" select="$btype"/>
934                                         <xsl:with-param name="wrt" select="$wrt"/>
935                                 </xsl:call-template>
936                         </a>
937                 </xsl:otherwise>
938                 </xsl:choose>
939         </xsl:template>
940
941         <xsl:template name="GetArraySuffix">
942                 <xsl:param name="type" />
943
944                 <xsl:if test="contains ($type, ']') and 
945                                 ']' = substring ($type, string-length ($type), 1)">
946                         <xsl:variable name="start">
947                                 <xsl:call-template name="GetArraySuffixStart">
948                                         <xsl:with-param name="type" select="$type" />
949                                         <xsl:with-param name="i" select="string-length ($type) - 1" />
950                                 </xsl:call-template>
951                         </xsl:variable>
952                         <xsl:value-of select="substring ($type, $start)" />
953                 </xsl:if>
954         </xsl:template>
955
956         <xsl:template name="GetArraySuffixStart">
957                 <xsl:param name="type" />
958                 <xsl:param name="i" />
959
960                 <xsl:choose>
961                         <xsl:when test="substring ($type, $i, 1) = '['">
962                                 <xsl:value-of select="$i" />
963                         </xsl:when>
964                         <xsl:otherwise>
965                                 <xsl:call-template name="GetArraySuffixStart">
966                                         <xsl:with-param name="type" select="$type" />
967                                         <xsl:with-param name="i" select="$i - 1" />
968                                 </xsl:call-template>
969                         </xsl:otherwise>
970                 </xsl:choose>
971         </xsl:template>
972
973         <xsl:template name="GetTypeDisplayName">
974                 <xsl:param name="T"/>
975                 <xsl:param name="wrt"/>
976
977                                 <!-- use C#-style names -->
978                                 <xsl:choose>
979                                         <xsl:when test="$T='System.Object'">object</xsl:when>
980                                         <xsl:when test="$T='System.Boolean'">bool</xsl:when>
981                                         <xsl:when test="$T='System.Byte'">byte</xsl:when>
982                                         <xsl:when test="$T='System.Char'">char</xsl:when>
983                                         <xsl:when test="$T='System.Decimal'">decimal</xsl:when>
984                                         <xsl:when test="$T='System.Double'">double</xsl:when>
985                                         <xsl:when test="$T='System.Int16'">short</xsl:when>
986                                         <xsl:when test="$T='System.Int32'">int</xsl:when>
987                                         <xsl:when test="$T='System.Int64'">long</xsl:when>
988                                         <xsl:when test="$T='System.SByte'">sbyte</xsl:when>
989                                         <xsl:when test="$T='System.Single'">float</xsl:when>
990                                         <xsl:when test="$T='System.String'">string</xsl:when>
991                                         <xsl:when test="$T='System.UInt16'">ushort</xsl:when>
992                                         <xsl:when test="$T='System.UInt32'">uint</xsl:when>
993                                         <xsl:when test="$T='System.UInt64'">ulong</xsl:when>
994                                         <xsl:when test="$T='System.Void'">void</xsl:when>
995
996                                         <xsl:when test="contains($T, '&lt;')">
997                                                 <xsl:call-template name="GetTypeDisplayName">
998                                                         <xsl:with-param name="T" select="substring-before ($T, '&lt;')" />
999                                                         <xsl:with-param name="wrt" select="$wrt" />
1000                                                 </xsl:call-template>
1001                                                 <xsl:text>&lt;</xsl:text>
1002                                                 <xsl:call-template name="GetMemberArgList">
1003                                                         <xsl:with-param name="arglist" select="substring-after ($T, '&lt;')" />
1004                                                         <xsl:with-param name="wrt" select="$wrt" />
1005                                                 </xsl:call-template>
1006                                                 <!-- don't need to append &gt; as GetMemberArgList (eventually) appends it -->
1007                                         </xsl:when>
1008         
1009                                         <!-- if the type is in the wrt namespace, omit the namespace name -->
1010                                         <xsl:when test="not($wrt='') and starts-with($T, concat($wrt,'.')) and not(contains(substring-after($T,concat($wrt,'.')), '.'))">
1011                                                 <xsl:value-of select="translate (substring-after($T,concat($wrt,'.')), '+', '.')"/>
1012                                         </xsl:when>
1013         
1014                                         <!-- if the type is in the System namespace, omit the namespace name -->
1015                                         <xsl:when test="starts-with($T, 'System.') and not(contains(substring-after($T, 'System.'), '.'))">
1016                                                 <xsl:value-of select="translate (substring-after($T,'System.'), '+', '.')"/>
1017                                         </xsl:when>
1018         
1019                                         <!-- if the type is in the System.Collections namespace, omit the namespace name -->
1020                                         <xsl:when test="starts-with($T, 'System.Collections.') and not(contains(substring-after($T, 'System.Collections.'), '.'))">
1021                                                 <xsl:value-of select="translate (substring-after($T,'System.Collections.'), '+', '.')"/>
1022                                         </xsl:when>
1023
1024                                         <!-- if the type is in the System.Collections.Generic namespace, omit the namespace name -->
1025                                         <xsl:when test="starts-with($T, 'System.Collections.Generic.') and not(contains(substring-after($T, 'System.Collections.Generic.'), '.'))">
1026                                                 <xsl:value-of select="translate (substring-after($T,'System.Collections.Generic.'), '+', '.')"/>
1027                                         </xsl:when>
1028
1029                                         <xsl:otherwise>
1030                                                 <xsl:value-of select="translate ($T, '+', '.')" />
1031                                         </xsl:otherwise>
1032                                 </xsl:choose>
1033         </xsl:template>
1034
1035         <xsl:template name="GetMemberDisplayName">
1036                 <xsl:param name="memberName" />
1037                 <xsl:param name="isproperty" select="false()" />
1038
1039                 <xsl:choose>
1040                         <xsl:when test="contains($memberName, '.')">
1041                                 <xsl:call-template name="GetTypeDisplayName">
1042                                         <xsl:with-param name="T">
1043                                                 <xsl:call-template name="GetTypeName">
1044                                                         <xsl:with-param name="type" select="$memberName"/>
1045                                                 </xsl:call-template>
1046                                         </xsl:with-param>
1047                                         <xsl:with-param name="wrt" select="''" />
1048                                 </xsl:call-template>
1049                                 <xsl:text>.</xsl:text>
1050                                 <xsl:call-template name="GetMemberName">
1051                                         <xsl:with-param name="type" select="$memberName" />
1052                                         <xsl:with-param name="isproperty" select="$isproperty"/>
1053                                 </xsl:call-template>
1054                         </xsl:when>
1055                         <xsl:otherwise>
1056                                 <xsl:value-of select="$memberName" />
1057                         </xsl:otherwise>
1058                 </xsl:choose>
1059         </xsl:template>
1060
1061         <xsl:template name="ToBrackets">
1062                 <xsl:param name="s" />
1063                 <xsl:value-of select="translate (translate ($s, '{', '&lt;'), '}', '&gt;')" />
1064         </xsl:template>
1065
1066         <xsl:template name="ToBraces">
1067                 <xsl:param name="s" />
1068                 <xsl:value-of select="translate (translate ($s, '&lt;', '{'), '&gt;', '}')" />
1069         </xsl:template>
1070         
1071         <xsl:template name="memberlinkprefix">
1072                 <xsl:param name="member" />
1073                 <xsl:choose>
1074                         <xsl:when test="$member/MemberType='Constructor'">C</xsl:when>
1075                         <xsl:when test="$member/MemberType='Method'">M</xsl:when>
1076                         <xsl:when test="$member/MemberType='Property'">P</xsl:when>
1077                         <xsl:when test="$member/MemberType='Field'">F</xsl:when>
1078                         <xsl:when test="$member/MemberType='Event'">E</xsl:when>
1079                 </xsl:choose>
1080         </xsl:template>
1081
1082         <xsl:template name="makememberlink">
1083                 <xsl:param name="cref"/>
1084
1085                 <xsl:variable name="bcref">
1086                         <xsl:call-template name="ToBrackets">
1087                                 <xsl:with-param name="s" select="$cref" />
1088                         </xsl:call-template>
1089                 </xsl:variable>
1090
1091                 <xsl:variable name="fullname">
1092                         <xsl:choose>
1093                                 <xsl:when test="starts-with($bcref, 'C:') or starts-with($bcref, 'T:')">
1094                                         <xsl:choose>
1095                                                 <xsl:when test="contains($bcref, '(')">
1096                                                         <xsl:value-of select="substring (substring-before ($bcref, '('), 3)" />
1097                                                 </xsl:when>
1098                                                 <xsl:otherwise>
1099                                                         <xsl:value-of select="substring($bcref, 3)" />
1100                                                 </xsl:otherwise>
1101                                         </xsl:choose>
1102                                 </xsl:when>
1103                                 <xsl:otherwise>
1104                                         <xsl:call-template name="GetTypeName">
1105                                                 <xsl:with-param name="type" select="substring($bcref, 3)"/>
1106                                         </xsl:call-template>
1107                                 </xsl:otherwise>
1108                         </xsl:choose>
1109                 </xsl:variable>
1110
1111                 <xsl:variable name="memberName">
1112                         <xsl:choose>
1113                                 <xsl:when test="starts-with($bcref, 'T:')" />
1114                                 <xsl:when test="starts-with($bcref, 'C:') and not(contains($bcref, '('))" />
1115                                 <xsl:when test="starts-with($bcref, 'C:') and contains($bcref, '(')">
1116                                         <xsl:text>(</xsl:text>
1117                                         <xsl:call-template name="GetMemberArgList">
1118                                                 <xsl:with-param name="arglist" select="substring-before(substring-after($bcref, '('), ')')" />
1119                                                 <xsl:with-param name="wrt" select="$TypeNamespace" />
1120                                         </xsl:call-template>
1121                                         <xsl:text>)</xsl:text>
1122                                 </xsl:when>
1123                                 <xsl:otherwise>
1124                                         <xsl:text>.</xsl:text>
1125                                         <xsl:call-template name="GetMemberName">
1126                                                 <xsl:with-param name="type" select="substring($bcref, 3)" />
1127                                                 <xsl:with-param name="wrt" select="$fullname"/>
1128                                                 <xsl:with-param name="isproperty" select="starts-with($bcref, 'P:')"/>
1129                                         </xsl:call-template>
1130                                 </xsl:otherwise>
1131                         </xsl:choose>
1132                 </xsl:variable>
1133
1134                 <xsl:variable name="escaped-type">
1135                         <xsl:call-template name="GetEscapedTypeName">
1136                                 <xsl:with-param name="typename">
1137                                         <xsl:call-template name="ToBrackets">
1138                                                 <xsl:with-param name="s" select="$fullname" />
1139                                         </xsl:call-template>
1140                                 </xsl:with-param>
1141                         </xsl:call-template>
1142                 </xsl:variable>
1143                 <xsl:variable name="displayname">
1144                         <xsl:call-template name="GetTypeDisplayName">
1145                                 <xsl:with-param name="T" select="$fullname" />
1146                                 <xsl:with-param name="wrt" select="$TypeNamespace"/>
1147                         </xsl:call-template>
1148                 </xsl:variable>
1149                 <a>
1150                         <xsl:attribute name="href">
1151                                 <xsl:call-template name="GetLinkTarget">
1152                                         <xsl:with-param name="type" select="$escaped-type" />
1153                                         <xsl:with-param name="cref">
1154                                                 <xsl:call-template name="ToBraces">
1155                                                         <xsl:with-param name="s" select="$cref" />
1156                                                 </xsl:call-template>
1157                                         </xsl:with-param>
1158                                 </xsl:call-template>
1159                         </xsl:attribute>
1160                         <xsl:value-of select="translate (concat($displayname, $memberName), '+', '.')" />
1161                 </a>
1162         </xsl:template>
1163
1164         <xsl:template name="GetTypeName">
1165                 <xsl:param name="type" />
1166                 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1167                 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1168                 <xsl:choose>
1169                         <xsl:when test="contains($type, '(')">
1170                                 <xsl:call-template name="GetTypeName">
1171                                         <xsl:with-param name="type" select="substring-before($type, '(')" />
1172                                 </xsl:call-template>
1173                         </xsl:when>
1174                         <xsl:when test="not(contains($suffix, '.'))">
1175                                 <xsl:value-of select="$prefix" />
1176                         </xsl:when>
1177                         <xsl:otherwise>
1178                                 <xsl:value-of select="$prefix" />
1179                                 <xsl:text>.</xsl:text>
1180                                 <xsl:call-template name="GetTypeName">
1181                                         <xsl:with-param name="type" select="$suffix" />
1182                                 </xsl:call-template>
1183                         </xsl:otherwise>
1184                 </xsl:choose>
1185         </xsl:template>
1186
1187         <xsl:template name="GetMemberName">
1188                 <xsl:param name="type" />
1189                 <xsl:param name="isproperty" select="0"/>
1190                 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1191                 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1192                 <xsl:choose>
1193                         <xsl:when test="contains($type, '(')">
1194                                 <xsl:call-template name="GetMemberName">
1195                                         <xsl:with-param name="type" select="substring-before($type, '(')" />
1196                                 </xsl:call-template>
1197                                 <xsl:text>(</xsl:text>
1198                                 <xsl:call-template name="GetMemberArgList">
1199                                         <xsl:with-param name="arglist" select="substring-before(substring-after($type, '('), ')')" />
1200                                         <xsl:with-param name="wrt" select="$TypeNamespace" />
1201                                 </xsl:call-template>
1202                                 <xsl:text>)</xsl:text>
1203                         </xsl:when>
1204                         <xsl:when test="not(contains($suffix, '.'))">
1205                                 <xsl:value-of select="$suffix" />
1206                         </xsl:when>
1207                         <xsl:otherwise>
1208                                 <xsl:call-template name="GetMemberName">
1209                                         <xsl:with-param name="type" select="$suffix" />
1210                                 </xsl:call-template>
1211                         </xsl:otherwise>
1212                 </xsl:choose>
1213         </xsl:template>
1214
1215         <xsl:template name="GetMemberArgList">
1216                 <xsl:param name="arglist" />
1217                 <xsl:param name="wrt" select="''"/>
1218
1219                 <xsl:variable name="_arglist">
1220                         <xsl:choose>
1221                                 <xsl:when test="starts-with ($arglist, ',')">
1222                                         <xsl:value-of select="substring-after ($arglist, ',')" />
1223                                 </xsl:when>
1224                                 <xsl:otherwise>
1225                                         <xsl:value-of select="$arglist" />
1226                                 </xsl:otherwise>
1227                         </xsl:choose>
1228                 </xsl:variable>
1229
1230                 <xsl:if test="starts-with ($arglist, ',')">
1231                         <xsl:text>, </xsl:text>
1232                 </xsl:if>
1233
1234                 <xsl:variable name="c"  select="substring-before ($_arglist, ',')" />
1235                 <xsl:variable name="lt" select="substring-before ($_arglist, '&lt;')" />
1236                 <xsl:variable name="gt" select="substring-before ($_arglist, '&gt;')" />
1237
1238                 <xsl:choose>
1239                         <!-- Need to insert ',' between type arguments -->
1240                         <xsl:when test="
1241                                         ($c != '' and $lt != '' and $gt != '' and 
1242                                          string-length ($c) &lt; string-length ($lt) and 
1243                                          string-length ($c) &lt; string-length ($gt)) or
1244                                         ($c != '' and $lt != '' and $gt = '' and
1245                                          string-length ($c) &lt; string-length ($lt)) or
1246                                         ($c != '' and $lt = '' and $gt != '' and
1247                                          string-length ($c) &lt; string-length ($gt)) or
1248                                         ($c != '' and $lt = '' and $gt = '')">
1249                                 <xsl:call-template name="GetTypeDisplayName">
1250                                         <xsl:with-param name="T" select="$c"/>
1251                                         <xsl:with-param name="wrt" select="$wrt"/>
1252                                 </xsl:call-template>
1253                                 <xsl:text>, </xsl:text>
1254                                 <xsl:call-template name="GetMemberArgList">
1255                                         <xsl:with-param name="arglist" select="substring-after($_arglist, ',')" />
1256                                         <xsl:with-param name="wrt" select="$wrt" />
1257                                 </xsl:call-template>
1258                         </xsl:when>
1259
1260                         <!-- start of nested type argument list < -->
1261                         <xsl:when test="
1262                                         ($c != '' and $lt != '' and $gt != '' and 
1263                                          string-length ($lt) &lt; string-length ($c) and 
1264                                          string-length ($lt) &lt; string-length ($gt)) or
1265                                         ($c != '' and $lt != '' and $gt = '' and
1266                                          string-length ($lt) &lt; string-length ($c)) or
1267                                         ($c = '' and $lt != '' and $gt != '' and
1268                                          string-length ($lt) &lt; string-length ($gt))">
1269                                 <xsl:call-template name="GetTypeDisplayName">
1270                                         <xsl:with-param name="T" select="$lt"/>
1271                                         <xsl:with-param name="wrt" select="$wrt"/>
1272                                 </xsl:call-template>
1273                                 <xsl:text>&lt;</xsl:text>
1274                                 <xsl:call-template name="GetMemberArgList">
1275                                         <xsl:with-param name="arglist" select="substring-after($_arglist, '&lt;')" />
1276                                         <xsl:with-param name="wrt" select="$wrt" />
1277                                 </xsl:call-template>
1278                         </xsl:when>
1279
1280                         <!-- end of (nested?) type argument list > -->
1281                         <xsl:when test="
1282                                         ($c != '' and $lt != '' and $gt != '' and 
1283                                          string-length ($gt) &lt; string-length ($c) and 
1284                                          string-length ($gt) &lt; string-length ($lt)) or
1285                                         ($c != '' and $lt = '' and $gt = '' and
1286                                          string-length ($gt) &lt; string-length ($c)) or
1287                                         ($c = '' and $lt != '' and $gt != '' and
1288                                          string-length ($gt) &lt; string-length ($lt)) or
1289                                         ($c = '' and $lt = '' and $gt != '')">
1290                                 <xsl:call-template name="GetTypeDisplayName">
1291                                         <xsl:with-param name="T" select="$gt"/>
1292                                         <xsl:with-param name="wrt" select="$wrt"/>
1293                                 </xsl:call-template>
1294                                 <xsl:text>&gt;</xsl:text>
1295                                 <xsl:call-template name="GetMemberArgList">
1296                                         <xsl:with-param name="arglist" select="substring-after($_arglist, '&gt;')" />
1297                                         <xsl:with-param name="wrt" select="$wrt" />
1298                                 </xsl:call-template>
1299                         </xsl:when>
1300
1301                         <!-- nothing left to do -->
1302                         <xsl:otherwise>
1303                                 <xsl:call-template name="GetTypeDisplayName">
1304                                         <xsl:with-param name="T" select="$_arglist"/>
1305                                         <xsl:with-param name="wrt" select="$wrt"/>
1306                                 </xsl:call-template>
1307                         </xsl:otherwise>
1308                 </xsl:choose>
1309         </xsl:template>
1310         
1311         <!-- Transforms the contents of the selected node containing a cref into a hyperlink. -->
1312         <xsl:template match="*|@*" mode="cref">
1313                 <xsl:call-template name="makememberlink">
1314                         <xsl:with-param name="cref" select="."/>
1315                 </xsl:call-template>
1316                 <!--
1317                 <a>
1318                         <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
1319                         <xsl:value-of select="substring-after(., ':')"/></a>
1320                         -->
1321         </xsl:template>
1322
1323         <xsl:template name="membertypeplural">
1324                 <xsl:param name="name"/>
1325                 <xsl:choose>
1326                 <xsl:when test="$name='ExtensionMethod'">Extension Methods</xsl:when>
1327                 <xsl:when test="$name='Constructor'">Constructors</xsl:when>
1328                 <xsl:when test="$name='Property'">Properties</xsl:when>
1329                 <xsl:when test="$name='Method'">Methods</xsl:when>
1330                 <xsl:when test="$name='Field'">Fields</xsl:when>
1331                 <xsl:when test="$name='Event'">Events</xsl:when>
1332                 <xsl:when test="$name='Operator'">Operators</xsl:when>
1333                 <xsl:when test="$name='Explicit'">Explicitly Implemented Interface Members</xsl:when>
1334                 </xsl:choose>
1335         </xsl:template>
1336         <xsl:template name="membertypeplurallc">
1337                 <xsl:param name="name"/>
1338                 <xsl:choose>
1339                 <xsl:when test="$name='ExtensionMethod'">extension methods</xsl:when>
1340                 <xsl:when test="$name='Constructor'">constructors</xsl:when>
1341                 <xsl:when test="$name='Property'">properties</xsl:when>
1342                 <xsl:when test="$name='Method'">methods</xsl:when>
1343                 <xsl:when test="$name='Field'">fields</xsl:when>
1344                 <xsl:when test="$name='Event'">events</xsl:when>
1345                 <xsl:when test="$name='Operator'">operators</xsl:when>
1346                 <xsl:when test="$name='Explicit'">explicitly implemented interface members</xsl:when>
1347                 </xsl:choose>
1348         </xsl:template>
1349         <xsl:template name="gettypetype">
1350                 <xsl:variable name="sig" select="concat(' ', TypeSignature[@Language='C#']/@Value, ' ')"/>
1351                 <xsl:choose>
1352                 <xsl:when test="contains($sig,'class')">Class</xsl:when>
1353                 <xsl:when test="contains($sig,'enum')">Enumeration</xsl:when>
1354                 <xsl:when test="contains($sig,'struct')">Structure</xsl:when>
1355                 <xsl:when test="contains($sig,'delegate')">Delegate</xsl:when>
1356                 </xsl:choose>
1357         </xsl:template>
1358
1359         <!-- Ensures that the resuting node is not surrounded by a para tag. -->
1360         <xsl:template match="*|@*" mode="editlink">
1361                 <xsl:call-template name="CreateEditLink">
1362                         <xsl:with-param name="e" select="." />
1363                 </xsl:call-template>
1364         </xsl:template>
1365
1366         <xsl:template match="*" mode="notoppara">
1367                 <xsl:choose>
1368                 <xsl:when test="starts-with (string(.), 'To be added')">
1369                         <span class="NotEntered">Documentation for this section has not yet been entered.</span>
1370                 </xsl:when>
1371                 <xsl:when test="count(*) = 1 and count(para)=1">
1372                         <xsl:apply-templates select="para/node()"/>
1373                 </xsl:when>
1374                 <xsl:otherwise>
1375                         <xsl:apply-templates select="."/>
1376                 </xsl:otherwise>
1377                 </xsl:choose>
1378         </xsl:template>
1379
1380         <xsl:template match="para">
1381                 <p>
1382                         <xsl:apply-templates/>
1383                 </p>
1384         </xsl:template>
1385
1386         <xsl:template match="paramref">
1387                 <i><xsl:value-of select="@name"/>
1388                                 <xsl:apply-templates/>
1389                 </i>
1390         </xsl:template>
1391
1392         <xsl:template match="typeparamref">
1393                 <i><xsl:value-of select="@name"/>
1394                                 <xsl:apply-templates/>
1395                 </i>
1396         </xsl:template>
1397
1398         <xsl:template match="block[@type='note']">
1399                 <div>
1400                 <i>Note: </i>
1401                                 <xsl:apply-templates/>
1402                 </div>
1403         </xsl:template>
1404         <xsl:template match="block[@type='behaviors']">
1405                 <h5 class="Subsection">Operation</h5>
1406                 <xsl:apply-templates/>
1407         </xsl:template>
1408         <xsl:template match="block[@type='overrides']">
1409                 <h5 class="Subsection">Note to Inheritors</h5>
1410                 <xsl:apply-templates/>
1411         </xsl:template>
1412         <xsl:template match="block[@type='usage']">
1413                 <h5 class="Subsection">Usage</h5>
1414                 <xsl:apply-templates/>
1415         </xsl:template>
1416
1417         <xsl:template match="c">
1418                 <tt>
1419                         <xsl:apply-templates/>  
1420                 </tt>
1421         </xsl:template>
1422         <xsl:template match="c//para">
1423                 <xsl:apply-templates/><br/>     
1424         </xsl:template>
1425         
1426         <xsl:template match="code">
1427                 <xsl:call-template name="CreateCodeBlock">
1428                         <xsl:with-param name="language" select="@lang" />
1429                         <xsl:with-param name="content" select="string(descendant-or-self::text())" />
1430                 </xsl:call-template>
1431         </xsl:template>
1432
1433         <xsl:template match="onequarter">
1434                 1/4
1435         </xsl:template>
1436         <xsl:template match="pi">pi</xsl:template>
1437         <xsl:template match="theta">theta</xsl:template>
1438         <xsl:template match="subscript">
1439                 <sub><xsl:value-of select="@term"/></sub>
1440         </xsl:template>
1441         <xsl:template match="superscript">
1442                 <sup><xsl:value-of select="@term"/></sup>
1443         </xsl:template>
1444
1445         <!-- tabular data
1446                 example:
1447
1448                         <list type="table">
1449                                 <listheader>
1450                                         <term>First Col Header</term>
1451                                         <description>Second Col Header</description>
1452                                         <description>Third Col Header</description>
1453                                 </listheader>
1454                                 <item>
1455                                         <term>First Row First Col</term>
1456                                         <description>First Row Second Col</description>
1457                                         <description>First Row Third Col</description>
1458                                 </item>
1459                                 <item>
1460                                         <term>Second Row First Col</term>
1461                                         <description>Second Row Second Col</description>
1462                                         <description>Second Row Third Col</description>
1463                                 </item>
1464                         </list>
1465         -->
1466
1467         <xsl:template match="list[@type='table']">
1468                 <xsl:call-template name="CreateListTable">
1469                 <xsl:with-param name="header">
1470                         <th><xsl:apply-templates select="listheader/term" mode="notoppara"/></th>
1471                         <xsl:for-each select="listheader/description">
1472                                 <th><xsl:apply-templates mode="notoppara"/></th>
1473                         </xsl:for-each>
1474                 </xsl:with-param>
1475
1476                 <xsl:with-param name="content">
1477                 <xsl:for-each select="item">
1478                         <tr valign="top">
1479                         <td>
1480                                 <xsl:apply-templates select="term" mode="notoppara"/>
1481                         </td>
1482                         <xsl:for-each select="description">
1483                                 <td>
1484                                         <xsl:apply-templates mode="notoppara"/>
1485                                 </td>
1486                         </xsl:for-each>
1487                         </tr>
1488                 </xsl:for-each>
1489                 </xsl:with-param>
1490                 </xsl:call-template>
1491         </xsl:template>
1492
1493         <xsl:template match="list[@type='bullet']">
1494                 <ul>
1495                         <xsl:for-each select="item">
1496                                 <li>
1497                                         <xsl:apply-templates select="term" mode="notoppara"/>
1498                                 </li>
1499                         </xsl:for-each>
1500                 </ul>
1501         </xsl:template>
1502         <xsl:template match="list[@type='number']">
1503                 <ol>
1504                         <xsl:for-each select="item">
1505                                 <li>
1506                                         <xsl:apply-templates select="term" mode="notoppara"/>
1507                                 </li>
1508                         </xsl:for-each>
1509                 </ol>
1510         </xsl:template>
1511
1512         <xsl:template match="list">
1513                 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1514                 
1515                 <xsl:message>
1516                 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1517                 </xsl:message>
1518         </xsl:template>
1519
1520         <xsl:template match="see[@cref]">
1521                 <xsl:choose>
1522                 <xsl:when test="not(substring-after(@cref, 'T:')='')">
1523                         <xsl:call-template name="maketypelink">
1524                                 <xsl:with-param name="type" select="normalize-space (@cref)"/>
1525                         </xsl:call-template>
1526                 </xsl:when>
1527                 <xsl:otherwise>
1528                         <xsl:call-template name="makememberlink">
1529                                 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1530                         </xsl:call-template>
1531                 </xsl:otherwise>
1532                 </xsl:choose>
1533         </xsl:template>
1534
1535         <xsl:template match="see[@langword]">
1536                 <tt><xsl:value-of select="@langword"/></tt>
1537         </xsl:template>
1538         
1539         <xsl:template name="GetInheritedMembers">
1540                 <xsl:param name="declaringtype"/>
1541                 <xsl:param name="generictypereplacements"/>
1542                 <xsl:param name="listmembertype"/>
1543                 <xsl:param name="showprotected"/>
1544                 <xsl:param name="overloads-mode" select="false()" />
1545                 <xsl:param name="showstatic" select='1'/>
1546
1547                 <xsl:choose>
1548                 <xsl:when test="$listmembertype='ExtensionMethod' and $showprotected=false()">
1549                         <xsl:for-each select="$declaringtype/Members/Member[MemberType=$listmembertype]">
1550                                 <Members Name="Link/@Type" FullName="Link/@Type">
1551                                         <Member MemberName="{@MemberName}">
1552                                                 <xsl:attribute name="ExplicitMemberName">
1553                                                         <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1554                                                                 <xsl:with-param name="m" select="@MemberName" />
1555                                                         </xsl:call-template>
1556                                                 </xsl:attribute>
1557                                                 <xsl:attribute name="TypeParameters">
1558                                                         <xsl:call-template name="GetTypeParameterNames">
1559                                                                 <xsl:with-param name="member" select="." />
1560                                                         </xsl:call-template>
1561                                                 </xsl:attribute>
1562                                                 <xsl:attribute name="Parameters">
1563                                                         <xsl:call-template name="GetParameterTypes">
1564                                                                 <xsl:with-param name="member" select="." />
1565                                                         </xsl:call-template>
1566                                                 </xsl:attribute>
1567                                                 <xsl:copy-of select="./*" />
1568                                         </Member>
1569                                 </Members>
1570                         </xsl:for-each>
1571                 </xsl:when>
1572                 <xsl:otherwise>
1573                 <Members Name="{$declaringtype/@Name}" FullName="{$declaringtype/@FullName}">
1574                 
1575                 <xsl:copy-of select="$generictypereplacements"/>
1576
1577                 <!-- Get all members in this type that are of listmembertype and are either
1578                         protected or not protected according to showprotected. -->
1579                 <xsl:choose>
1580                         <xsl:when test="$listmembertype = 'Explicit'">
1581                                 <xsl:for-each select="$declaringtype/Members/Member
1582                                                 [MemberType != 'Constructor']
1583                                                 [contains (@MemberName, '.')]">
1584                                         <Member MemberName="{@MemberName}">
1585                                                 <xsl:attribute name="ExplicitMemberName">
1586                                                         <xsl:call-template name="GetMemberName">
1587                                                                 <xsl:with-param name="type" select="@MemberName" />
1588                                                                 <xsl:with-param name="isproperty" select="$listmembertype = 'Property'"/>
1589                                                         </xsl:call-template>
1590                                                 </xsl:attribute>
1591                                                 <xsl:attribute name="TypeParameters">
1592                                                         <xsl:call-template name="GetTypeParameterNames">
1593                                                                 <xsl:with-param name="member" select="." />
1594                                                         </xsl:call-template>
1595                                                 </xsl:attribute>
1596                                                 <xsl:attribute name="Parameters">
1597                                                         <xsl:call-template name="GetParameterTypes">
1598                                                                 <xsl:with-param name="member" select="." />
1599                                                         </xsl:call-template>
1600                                                 </xsl:attribute>
1601                                                 <xsl:copy-of select="./*" />
1602                                         </Member>
1603                                 </xsl:for-each>
1604                         </xsl:when>
1605                         <xsl:otherwise>
1606                                 <xsl:for-each select="$declaringtype/Members/Member
1607                                         [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1608                                         [(not($overloads-mode) or @MemberName=$index or 
1609                                                 ($index='Conversion' and (@MemberName='op_Implicit' or @MemberName='op_Explicit'))) ]
1610                                         [$showprotected=starts-with(MemberSignature[@Language='C#']/@Value, 'protected ')]
1611                                         [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1612                                                 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1613                                                 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1614                                         [$showstatic or not(contains(MemberSignature[@Language='C#']/@Value,' static '))]
1615                                         [$listmembertype = 'Constructor' or not(contains(@MemberName, '.'))]
1616                                         ">
1617                                         <Member MemberName="{@MemberName}">
1618                                                 <xsl:attribute name="ExplicitMemberName">
1619                                                         <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1620                                                                 <xsl:with-param name="m" select="@MemberName" />
1621                                                         </xsl:call-template>
1622                                                 </xsl:attribute>
1623                                                 <xsl:attribute name="TypeParameters">
1624                                                         <xsl:call-template name="GetTypeParameterNames">
1625                                                                 <xsl:with-param name="member" select="." />
1626                                                         </xsl:call-template>
1627                                                 </xsl:attribute>
1628                                                 <xsl:attribute name="Parameters">
1629                                                         <xsl:call-template name="GetParameterTypes">
1630                                                                 <xsl:with-param name="member" select="." />
1631                                                         </xsl:call-template>
1632                                                 </xsl:attribute>
1633                                                 <xsl:copy-of select="./*" />
1634                                         </Member>
1635                                 </xsl:for-each>
1636                         </xsl:otherwise>
1637                 </xsl:choose>
1638
1639                 <Docs>
1640                         <xsl:copy-of select="$declaringtype/Docs/typeparam" />
1641                 </Docs>
1642                         
1643                 </Members>
1644                 </xsl:otherwise>
1645                 </xsl:choose>
1646
1647                 <xsl:if test="not($listmembertype='Constructor') and count($declaringtype/Base/BaseTypeName)=1">
1648                         <xsl:variable name="basedocsfile">
1649                                 <xsl:call-template name="GetLinkTarget">
1650                                         <xsl:with-param name="type">
1651                                                 <xsl:call-template name="GetEscapedTypeName">
1652                                                         <xsl:with-param name="typename" select="$declaringtype/Base/BaseTypeName" />
1653                                                 </xsl:call-template>
1654                                         </xsl:with-param>
1655                                         <xsl:with-param name="cref">
1656                                         </xsl:with-param>
1657                                         <xsl:with-param name="local-suffix" />
1658                                         <xsl:with-param name="remote"/>
1659                                         <xsl:with-param name="xmltarget" select='1'/>
1660                                 </xsl:call-template>
1661                         </xsl:variable>
1662
1663                         <xsl:if test="not($basedocsfile='--not-available--')">
1664                                 <xsl:call-template name="GetInheritedMembers">
1665                                         <xsl:with-param name="listmembertype" select="$listmembertype"/>
1666                                         <xsl:with-param name="showprotected" select="$showprotected"/>
1667                                         <xsl:with-param name="declaringtype" select="document($basedocsfile,.)/Type"/>
1668                                         <xsl:with-param name="generictypereplacements" select="$declaringtype/Base/BaseTypeArguments/*"/>
1669                                         <xsl:with-param name="showstatic" select='0'/>
1670                                 </xsl:call-template>
1671                         </xsl:if>
1672                 </xsl:if>
1673         </xsl:template>
1674
1675         <xsl:template name="GetMemberNameWithoutGenericTypes">
1676                 <xsl:param name="m" />
1677                 <xsl:choose>
1678                         <xsl:when test="contains ($m, '&lt;')">
1679                                 <xsl:value-of select="substring-before ($m, '&lt;')" />
1680                         </xsl:when>
1681                         <xsl:otherwise>
1682                                 <xsl:value-of select="$m" />
1683                         </xsl:otherwise>
1684                 </xsl:choose>
1685         </xsl:template>
1686         
1687         <xsl:template name="GetTypeParameterNames">
1688                 <xsl:param name="member" />
1689
1690                 <xsl:for-each select="$member/TypeParameters/TypeParameter">
1691                         <xsl:if test="not(position()=1)">, </xsl:if>
1692                         <xsl:value-of select="@Name" />
1693                 </xsl:for-each>
1694         </xsl:template>
1695         
1696         <xsl:template name="GetParameterTypes">
1697                 <xsl:param name="member" />
1698
1699                 <xsl:for-each select="$member/Parameters/Parameter">
1700                         <xsl:if test="not(position()=1)">, </xsl:if>
1701                         <xsl:value-of select="@Type" />
1702                 </xsl:for-each>
1703         </xsl:template>
1704         
1705         <xsl:template name="ListAllMembers">
1706                 <xsl:param name="html-anchor" select="false()" />
1707
1708                 <xsl:call-template name="ListMembers">
1709                         <xsl:with-param name="listmembertype" select="'Constructor'"/>
1710                         <xsl:with-param name="showprotected" select="false()"/>
1711                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1712                 </xsl:call-template>
1713
1714                 <xsl:call-template name="ListMembers">
1715                         <xsl:with-param name="listmembertype" select="'Constructor'"/>
1716                         <xsl:with-param name="showprotected" select="true()"/>
1717                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1718                 </xsl:call-template>
1719
1720                 <xsl:call-template name="ListMembers">
1721                         <xsl:with-param name="listmembertype" select="'Field'"/>
1722                         <xsl:with-param name="showprotected" select="false()"/>
1723                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1724                 </xsl:call-template>
1725
1726                 <xsl:call-template name="ListMembers">
1727                         <xsl:with-param name="listmembertype" select="'Field'"/>
1728                         <xsl:with-param name="showprotected" select="true()"/>
1729                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1730                 </xsl:call-template>
1731
1732                 <xsl:call-template name="ListMembers">
1733                         <xsl:with-param name="listmembertype" select="'Property'"/>
1734                         <xsl:with-param name="showprotected" select="false()"/>
1735                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1736                 </xsl:call-template>
1737
1738                 <xsl:call-template name="ListMembers">
1739                         <xsl:with-param name="listmembertype" select="'Property'"/>
1740                         <xsl:with-param name="showprotected" select="true()"/>
1741                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1742                 </xsl:call-template>
1743
1744                 <xsl:call-template name="ListMembers">
1745                         <xsl:with-param name="listmembertype" select="'Method'"/>
1746                         <xsl:with-param name="showprotected" select="false()"/>
1747                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1748                 </xsl:call-template>
1749
1750                 <xsl:call-template name="ListMembers">
1751                         <xsl:with-param name="listmembertype" select="'Method'"/>
1752                         <xsl:with-param name="showprotected" select="true()"/>
1753                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1754                 </xsl:call-template>
1755
1756                 <xsl:call-template name="ListMembers">
1757                         <xsl:with-param name="listmembertype" select="'Event'"/>
1758                         <xsl:with-param name="showprotected" select="false()"/>
1759                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1760                 </xsl:call-template>
1761
1762                 <xsl:call-template name="ListMembers">
1763                         <xsl:with-param name="listmembertype" select="'Event'"/>
1764                         <xsl:with-param name="showprotected" select="true()"/>
1765                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1766                 </xsl:call-template>
1767
1768                 <xsl:call-template name="ListMembers">
1769                         <xsl:with-param name="listmembertype" select="'Operator'"/>
1770                         <xsl:with-param name="showprotected" select="false()"/>
1771                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1772                 </xsl:call-template>
1773
1774                 <xsl:call-template name="ListMembers">
1775                         <xsl:with-param name="listmembertype" select="'Explicit'"/>
1776                         <xsl:with-param name="showprotected" select="true()"/>
1777                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1778                 </xsl:call-template>
1779
1780                 <xsl:call-template name="ListMembers">
1781                         <xsl:with-param name="listmembertype" select="'ExtensionMethod'"/>
1782                         <xsl:with-param name="showprotected" select="false()"/>
1783                         <xsl:with-param name="html-anchor" select="$html-anchor" />
1784                 </xsl:call-template>
1785         </xsl:template>
1786
1787         <!-- Lists the members in the current Type node.
1788                  Only lists members of type listmembertype.
1789                  Displays the signature in siglanguage.
1790                  showprotected = true() or false()
1791         -->
1792         <xsl:template name="ListMembers">
1793                 <xsl:param name="listmembertype"/>
1794                 <xsl:param name="showprotected"/>
1795                 <xsl:param name="overloads-mode" select="false()" />
1796                 <xsl:param name="html-anchor" select="false()" />
1797
1798                 <!-- get name and namespace of current type -->
1799                 <xsl:variable name="TypeFullName" select="@FullName"/>
1800                 <xsl:variable name="TypeName" select="@Name"/>          
1801                 <xsl:variable name="TypeNamespace" select="substring-before(@FullName, concat('.',@Name))"/>
1802                 
1803                 <xsl:variable name="MEMBERS">
1804                         <xsl:call-template name="GetInheritedMembers">
1805                                 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1806                                 <xsl:with-param name="showprotected" select="$showprotected"/>
1807                                 <xsl:with-param name="declaringtype" select="."/>
1808                                 <xsl:with-param name="overloads-mode" select="$overloads-mode" />
1809                         </xsl:call-template>
1810                 </xsl:variable>
1811                 
1812                 <!--
1813                 <xsl:variable name="MEMBERS" select="
1814                         $ALLMEMBERS/Member
1815                         [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1816                         [$showprotected=contains(MemberSignature[@Language='C#']/@Value,'protected')]
1817                         [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1818                                 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1819                                 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1820                         "/>
1821                 -->
1822                 
1823                 <!-- if there aren't any, skip this -->
1824                 <xsl:if test="count($MEMBERS/Member)">
1825
1826                 <xsl:variable name="SectionName">
1827                         <xsl:if test="$listmembertype != 'Explicit' and $listmembertype != 'ExtensionMethod'">
1828                                 <xsl:if test="$showprotected">Protected </xsl:if>
1829                                 <xsl:if test="not($showprotected)">Public </xsl:if>
1830                         </xsl:if>
1831                         <xsl:call-template name="membertypeplural"><xsl:with-param name="name" select="$listmembertype"/></xsl:call-template>
1832                 </xsl:variable>
1833
1834                 <!-- header -->
1835                 <xsl:call-template name="CreateH3Section">
1836                         <xsl:with-param name="name" select="$SectionName" />
1837                         <xsl:with-param name="child-id" select="$SectionName" />
1838                         <xsl:with-param name="content">
1839                                 <div class="SubsectionBox">
1840                                 <xsl:call-template name="CreateMembersTable">
1841                                 <xsl:with-param name="content">
1842
1843                                 <xsl:for-each select="$MEMBERS/Member">
1844                                         <!--<xsl:sort select="contains(MemberSignature[@Language='C#']/@Value,' static ')" data-type="text"/>-->
1845                                         <xsl:sort select="@MemberName = 'op_Implicit' or @MemberName = 'op_Explicit'"/>
1846                                         <xsl:sort select="@ExplicitMemberName" data-type="text"/>
1847                                         <xsl:sort select="count(TypeParameters/TypeParameter)"/>
1848                                         <xsl:sort select="@TypeParameters"/>
1849                                         <xsl:sort select="count(Parameters/Parameter)"/>
1850                                         <xsl:sort select="@Parameters"/>
1851                                         
1852                                         <xsl:variable name="local-id">
1853                                                 <xsl:choose>
1854                                                         <xsl:when test="count(Link) = 1">
1855                                                                 <xsl:value-of select="Link/@Member" />
1856                                                         </xsl:when>
1857                                                         <xsl:otherwise>
1858                                                                 <xsl:call-template name="GetLinkId" >
1859                                                                         <xsl:with-param name="type" select="parent::Members" />
1860                                                                         <xsl:with-param name="member" select="." />
1861                                                                 </xsl:call-template>
1862                                                         </xsl:otherwise>
1863                                                 </xsl:choose>
1864                                         </xsl:variable>
1865
1866                                         <xsl:variable name="linkid">
1867                                                 <xsl:if test="not(parent::Members/@FullName = $TypeFullName)">
1868                                                         <xsl:call-template name="GetLinkTarget">
1869                                                                 <xsl:with-param name="type">
1870                                                                         <xsl:choose>
1871                                                                                 <xsl:when test="count(Link) = 1">
1872                                                                                         <xsl:value-of select="Link/@Type"/>
1873                                                                                 </xsl:when>
1874                                                                                 <xsl:otherwise>
1875                                                                                         <xsl:call-template name="GetEscapedTypeName">
1876                                                                                                 <xsl:with-param name="typename" select="parent::Members/@FullName" />
1877                                                                                         </xsl:call-template>
1878                                                                                 </xsl:otherwise>
1879                                                                         </xsl:choose>
1880                                                                 </xsl:with-param>
1881                                                                 <xsl:with-param name="cref" />
1882                                                         </xsl:call-template>
1883                                                 </xsl:if>
1884                                                 <xsl:if test="$html-anchor">
1885                                                         <xsl:text>#</xsl:text>
1886                                                 </xsl:if>
1887                                                 <xsl:value-of select="$local-id" />
1888                                         </xsl:variable>
1889                                         
1890                                         <xsl:variable name="isinherited">
1891                                                 <xsl:if test="$listmembertype != 'ExtensionMethod' and not(parent::Members/@FullName = $TypeFullName)">
1892                                                         <xsl:text> (</xsl:text>
1893                                                         <i>
1894                                                         <xsl:text>Inherited from </xsl:text>
1895                                                         <xsl:call-template name="maketypelink">
1896                                                                 <xsl:with-param name="type" select="parent::Members/@FullName"/>
1897                                                                 <xsl:with-param name="wrt" select="$TypeNamespace"/>
1898                                                         </xsl:call-template>
1899                                                         <xsl:text>.</xsl:text>
1900                                                         </i>
1901                                                         <xsl:text>)</xsl:text>
1902                                                 </xsl:if>
1903                                         </xsl:variable>
1904
1905                                         <tr valign="top">
1906                                                 <td>
1907                                                         <!-- random info -->
1908
1909                                                         <!-- check if it has get and set accessors -->
1910                                                         <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'set;'))">
1911                                                                 <xsl:text>[read-only]</xsl:text>
1912                                                         </xsl:if>
1913                                                         <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'get;'))">
1914                                                                 <xsl:text>[write-only]</xsl:text>
1915                                                         </xsl:if>
1916
1917                                                         <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
1918                                                                 <div><i>default property</i></div>
1919                                                         </xsl:if>
1920
1921                                                         <div>
1922                                                         <xsl:call-template name="getmodifiers">
1923                                                                 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
1924                                                                 <xsl:with-param name="protection" select="false()"/>
1925                                                                 <xsl:with-param name="inheritance" select="true()"/>
1926                                                                 <xsl:with-param name="extra" select="false()"/>
1927                                                         </xsl:call-template>
1928                                                         </div>
1929                                                 </td>
1930
1931                                         <xsl:choose>
1932                                                 <!-- constructor listing -->
1933                                                 <xsl:when test="MemberType='Constructor'">
1934                                                         <!-- link to constructor page -->
1935                                                         <td>
1936                                                         <div>
1937                                                         <b>
1938                                                         <a href="{$linkid}">
1939                                                                 <xsl:call-template name="GetConstructorName">
1940                                                                         <xsl:with-param name="type" select="parent::Members" />
1941                                                                         <xsl:with-param name="ctor" select="." />
1942                                                                 </xsl:call-template>
1943                                                         </a>
1944                                                         </b>
1945
1946                                                         <!-- argument list -->
1947                                                         <xsl:value-of select="'('"/>
1948                                                                 <xsl:for-each select="Parameters/Parameter">
1949                                                                         <xsl:if test="not(position()=1)">, </xsl:if>
1950                                                                         
1951                                                                         <xsl:call-template name="ShowParameter">
1952                                                                                 <xsl:with-param name="Param" select="."/>
1953                                                                                 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
1954                                                                                 <xsl:with-param name="prototype" select="true()"/>
1955                                                                         </xsl:call-template>
1956                                                                 </xsl:for-each>
1957                                                         <xsl:value-of select="')'"/>
1958                                                         </div>
1959
1960                                                         <!-- TODO: $implemented? -->
1961
1962                                                         </td>
1963                                                 </xsl:when>
1964
1965                                                 <xsl:when test="$listmembertype = 'Explicit'">
1966                                                         <td>
1967                                                                 <a href="{$linkid}">
1968                                                                         <b>
1969                                                                                 <xsl:call-template name="GetMemberDisplayName">
1970                                                                                         <xsl:with-param name="memberName" select="@MemberName" />
1971                                                                                         <xsl:with-param name="isproperty" select="MemberType='Property'" />
1972                                                                                 </xsl:call-template>
1973                                                                         </b>
1974                                                                 </a>
1975                                                         </td>
1976                                                 </xsl:when>
1977
1978                                                 <!-- field, property and event listing -->
1979                                                 <xsl:when test="MemberType='Field' or MemberType='Property' or MemberType='Event'">
1980                                                         <td>
1981
1982                                                         <!-- link to member page -->
1983                                                         <b>
1984                                                         <a href="{$linkid}">
1985                                                                 <xsl:call-template name="GetMemberDisplayName">
1986                                                                         <xsl:with-param name="memberName" select="@MemberName" />
1987                                                                         <xsl:with-param name="isproperty" select="MemberType='Property'" />
1988                                                                 </xsl:call-template>
1989                                                         </a>
1990                                                         </b>
1991
1992                                                         <!-- argument list for accessors -->
1993                                                         <xsl:if test="Parameters/Parameter">
1994                                                         <xsl:value-of select="'('"/>
1995                                                                 <xsl:for-each select="Parameters/Parameter">
1996                                                                         <xsl:if test="not(position()=1)">, </xsl:if>
1997                                                                         
1998                                                                         <xsl:call-template name="ShowParameter">
1999                                                                                 <xsl:with-param name="Param" select="."/>
2000                                                                                 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2001                                                                                 <xsl:with-param name="prototype" select="true()"/>
2002                                                                         </xsl:call-template>
2003
2004                                                                 </xsl:for-each>
2005                                                         <xsl:value-of select="')'"/>
2006                                                         </xsl:if>
2007
2008                                                         </td>
2009                                                 </xsl:when>
2010
2011                                                 <!-- method listing -->
2012                                                 <xsl:when test="$listmembertype='Method' or $listmembertype = 'ExtensionMethod'">
2013                                                         <td colspan="2">
2014
2015                                                         <!-- link to method page -->
2016                                                         <b>
2017                                                         <a href="{$linkid}">
2018                                                                 <xsl:call-template name="GetMemberDisplayName">
2019                                                                         <xsl:with-param name="memberName" select="@MemberName" />
2020                                                                         <xsl:with-param name="isproperty" select="MemberType='Property'" />
2021                                                                 </xsl:call-template>
2022                                                         </a>
2023                                                         </b>
2024
2025                                                         <!-- argument list -->
2026                                                         <xsl:value-of select="'('"/>
2027                                                                 <xsl:for-each select="Parameters/Parameter">
2028                                                                         <xsl:if test="not(position()=1)">, </xsl:if>
2029                                                                         
2030                                                                         <xsl:call-template name="ShowParameter">
2031                                                                                 <xsl:with-param name="Param" select="."/>
2032                                                                                 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2033                                                                                 <xsl:with-param name="prototype" select="true()"/>
2034                                                                         </xsl:call-template>
2035
2036                                                                 </xsl:for-each>
2037                                                         <xsl:value-of select="')'"/>
2038
2039                                                         <!-- return type -->
2040                                                         <xsl:if test="not(ReturnValue/ReturnType='System.Void')">
2041                                                                 <nobr>
2042                                                                 <xsl:text> : </xsl:text>
2043                                                                 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
2044                                                                 </nobr>
2045                                                         </xsl:if>
2046
2047                                                         <blockquote>
2048                                                                 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2049                                                                 <xsl:copy-of select="$isinherited"/>
2050                                                         </blockquote>
2051                                                         </td>
2052                                                 </xsl:when>
2053
2054                                                 <xsl:when test="$listmembertype='Operator'">
2055                                                         <td>
2056
2057                                                         <!-- link to operator page -->
2058                                                         <xsl:choose>
2059                                                         <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
2060                                                                 <b>
2061                                                                 <a href="{$linkid}">
2062                                                                         <xsl:text>Conversion</xsl:text>
2063                                                                         <xsl:choose>
2064                                                                         <xsl:when test="ReturnValue/ReturnType = //Type/@FullName">
2065                                                                                 <xsl:text> From </xsl:text>
2066                                                                                 <xsl:value-of select="Parameters/Parameter/@Type"/>
2067                                                                         </xsl:when>
2068                                                                         <xsl:otherwise>
2069                                                                                 <xsl:text> to </xsl:text>
2070                                                                                 <xsl:value-of select="ReturnValue/ReturnType"/>
2071                                                                         </xsl:otherwise>
2072                                                                         </xsl:choose>
2073                                                                 </a>
2074                                                                 </b>                                            
2075
2076                                                                 <xsl:choose>
2077                                                                 <xsl:when test="@MemberName='op_Implicit'">
2078                                                                         <xsl:text>(Implicit)</xsl:text>
2079                                                                 </xsl:when>
2080                                                                 <xsl:otherwise>
2081                                                                         <xsl:text>(Explicit)</xsl:text>
2082                                                                 </xsl:otherwise>
2083                                                                 </xsl:choose>
2084                                                         </xsl:when>
2085                                                         <xsl:when test="count(Parameters/Parameter)=1">
2086                                                                 <b>
2087                                                                 <a href="{$linkid}">
2088                                                                         <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2089                                                                 </a>
2090                                                                 </b>
2091                                                         </xsl:when>
2092                                                         <xsl:otherwise>
2093                                                                 <b>
2094                                                                 <a href="{$linkid}">
2095                                                                         <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2096                                                                 </a>
2097                                                                 </b>
2098                                                                 <xsl:value-of select="'('"/>
2099                                                                         <xsl:for-each select="Parameters/Parameter">
2100                                                                                 <xsl:if test="not(position()=1)">, </xsl:if>
2101                                                                                 
2102                                                                                 <xsl:call-template name="ShowParameter">
2103                                                                                         <xsl:with-param name="Param" select="."/>
2104                                                                                         <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2105                                                                                         <xsl:with-param name="prototype" select="true()"/>
2106                                                                                 </xsl:call-template>
2107                         
2108                                                                         </xsl:for-each>
2109                                                                 <xsl:value-of select="')'"/>
2110                                                         </xsl:otherwise>
2111                                                         </xsl:choose>
2112                                                         </td>
2113                                                 </xsl:when>
2114                                                 
2115                                                 <xsl:otherwise>
2116                                                         <!-- Other types: just provide a link -->
2117                                                         <td>
2118                                                         <a href="{$linkid}">
2119                                                                 <xsl:call-template name="GetMemberDisplayName">
2120                                                                         <xsl:with-param name="memberName" select="@MemberName" />
2121                                                                         <xsl:with-param name="isproperty" select="MemberType='Property'" />
2122                                                                 </xsl:call-template>
2123                                                         </a>
2124                                                         </td>
2125                                                 </xsl:otherwise>
2126                                         </xsl:choose>
2127
2128                                         <xsl:if test="$listmembertype != 'Method' and $listmembertype != 'ExtensionMethod'">
2129                                                 <td>
2130                                                         <!-- description -->
2131                                                         <xsl:if test="MemberType='Field' or MemberType = 'Property'">
2132                                                                 <i><xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates></i>
2133                                                                 <xsl:if test="MemberValue"> (<xsl:value-of select="MemberValue"/>)</xsl:if>
2134                                                                 <xsl:text>. </xsl:text>
2135                                                         </xsl:if>
2136
2137                                                         <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2138                                                         <xsl:copy-of select="$isinherited"/>
2139                                                 </td>
2140                                         </xsl:if>
2141                                         
2142                                         </tr>
2143                                 </xsl:for-each>
2144
2145                                 </xsl:with-param>
2146                                 </xsl:call-template>
2147                                 </div>
2148                         </xsl:with-param>
2149                 </xsl:call-template>
2150
2151                 </xsl:if>
2152
2153         </xsl:template>
2154
2155         <xsl:template name="GetLinkName">
2156                 <xsl:param name="type"/>
2157                 <xsl:param name="member"/>
2158                 <xsl:call-template name="memberlinkprefix">
2159                         <xsl:with-param name="member" select="$member"/>
2160                 </xsl:call-template>
2161                 <xsl:text>:</xsl:text>
2162                 <xsl:call-template name="GetEscapedTypeName">
2163                         <xsl:with-param name="typename" select="$type/@FullName" />
2164                 </xsl:call-template>
2165                 <xsl:if test="$member/MemberType != 'Constructor'">
2166                         <xsl:text>.</xsl:text>
2167                         <xsl:variable name="memberName">
2168                                 <xsl:call-template name="GetGenericName">
2169                                         <xsl:with-param name="membername" select="$member/@MemberName" />
2170                                         <xsl:with-param name="member" select="$member" />
2171                                 </xsl:call-template>
2172                         </xsl:variable>
2173                         <xsl:call-template name="Replace">
2174                                 <xsl:with-param name="s">
2175                                         <xsl:call-template name="ToBraces">
2176                                                 <xsl:with-param name="s" select="$memberName" />
2177                                         </xsl:call-template>
2178                                 </xsl:with-param>
2179                                 <xsl:with-param name="from">.</xsl:with-param>
2180                                 <xsl:with-param name="to">#</xsl:with-param>
2181                         </xsl:call-template>
2182                 </xsl:if>
2183         </xsl:template>
2184
2185         <xsl:template name="GetGenericName">
2186                 <xsl:param name="membername" />
2187                 <xsl:param name="member" />
2188                 <xsl:variable name="numgenargs" select="count($member/Docs/typeparam)" />
2189                 <xsl:choose>
2190                         <xsl:when test="$numgenargs = 0">
2191                                 <xsl:value-of select="$membername" />
2192                         </xsl:when>
2193                         <xsl:otherwise>
2194                                 <xsl:if test="contains($membername, '&lt;')">
2195                                         <xsl:value-of select="substring-before ($membername, '&lt;')" />
2196                                 </xsl:if>
2197                                 <xsl:text>``</xsl:text>
2198                                 <xsl:value-of select="$numgenargs" />
2199                         </xsl:otherwise>
2200                 </xsl:choose>
2201         </xsl:template>
2202
2203         <xsl:template name="GetEscapedTypeName">
2204                 <xsl:param name="typename" />
2205                 <xsl:variable name="base" select="substring-before ($typename, '&lt;')" />
2206
2207                 <xsl:choose>
2208                         <xsl:when test="$base != ''">
2209                                 <xsl:value-of select="translate ($base, '+', '.')" />
2210                                 <xsl:text>`</xsl:text>
2211                                 <xsl:call-template name="GetGenericArgumentCount">
2212                                         <xsl:with-param name="arglist" select="substring-after ($typename, '&lt;')" />
2213                                         <xsl:with-param name="count">1</xsl:with-param>
2214                                 </xsl:call-template>
2215                         </xsl:when>
2216                         <xsl:otherwise><xsl:value-of select="translate ($typename, '+', '.')" /></xsl:otherwise>
2217                 </xsl:choose>
2218         </xsl:template>
2219
2220         <xsl:template name="GetGenericArgumentCount">
2221                 <xsl:param name="arglist" />
2222                 <xsl:param name="count" />
2223
2224                 <xsl:variable name="rest">
2225                         <xsl:call-template name="SkipTypeArgument">
2226                                 <xsl:with-param name="s" select="$arglist" />
2227                         </xsl:call-template>
2228                 </xsl:variable>
2229
2230                 <xsl:choose>
2231                         <xsl:when test="$arglist != '' and $rest = ''">
2232                                 <xsl:value-of select="$count" />
2233                         </xsl:when>
2234                         <xsl:when test="$arglist = '' and $rest = ''">
2235                                 <xsl:message terminate="yes">
2236 !WTF? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2237                                 </xsl:message>
2238                         </xsl:when>
2239                         <xsl:when test="starts-with ($rest, '>')">
2240                                 <xsl:value-of select="$count" />
2241                                 <xsl:call-template name="GetEscapedTypeName">
2242                                         <xsl:with-param name="typename" select="substring-after ($rest, '>')" />
2243                                 </xsl:call-template>
2244                         </xsl:when>
2245                         <xsl:when test="starts-with ($rest, ',')">
2246                                 <xsl:call-template name="GetGenericArgumentCount">
2247                                         <xsl:with-param name="arglist" select="substring-after ($rest, ',')" />
2248                                         <xsl:with-param name="count" select="$count+1" />
2249                                 </xsl:call-template>
2250                         </xsl:when>
2251                         <xsl:otherwise>
2252                                 <xsl:message terminate="yes">
2253 !WTF 2? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2254                                 </xsl:message>
2255                         </xsl:otherwise>
2256                 </xsl:choose>
2257         </xsl:template>
2258
2259         <xsl:template name="SkipTypeArgument">
2260                 <xsl:param name="s" />
2261
2262                 <xsl:variable name="p">
2263                         <xsl:call-template name="GetCLtGtPositions">
2264                                 <xsl:with-param name="s" select="$s" />
2265                         </xsl:call-template>
2266                 </xsl:variable>
2267
2268                 <xsl:choose>
2269                         <!--
2270                         Have to select between three `s' patterns:
2271                         A,B>: need to return ",B>"
2272                         Foo<A,B>>: Need to forward to SkipGenericArgument to eventually return ">"
2273                         Foo<A,B>+C>: Need to forward to SkipGenericArgument to eventually return ">"
2274                         -->
2275                         <xsl:when test="starts-with ($s, '>')">
2276                                 <xsl:message terminate="yes">
2277 SkipTypeArgument: invalid type substring '<xsl:value-of select="$s" />'
2278                                 </xsl:message>
2279                         </xsl:when>
2280                         <xsl:when test="$p/Comma/@Length > 0 and 
2281                                         ($p/Lt/@Length = 0 or $p/Comma/@Length &lt; $p/Lt/@Length) and 
2282                                         ($p/Gt/@Length > 0 and $p/Comma/@Length &lt; $p/Gt/@Length)">
2283                                 <xsl:text>,</xsl:text>
2284                                 <xsl:value-of select="substring-after ($s, ',')" />
2285                         </xsl:when>
2286                         <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length &lt; $p/Gt/@Length">
2287                                 <xsl:variable name="r">
2288                                         <xsl:call-template name="SkipGenericArgument">
2289                                                 <xsl:with-param name="s" select="substring-after ($s, '&lt;')" />
2290                                         </xsl:call-template>
2291                                 </xsl:variable>
2292                                 <xsl:value-of select="substring-after ($r, '&gt;')" />
2293                         </xsl:when>
2294                         <xsl:when test="$p/Gt/@Length > 0">
2295                                 <xsl:text>&gt;</xsl:text>
2296                                 <xsl:value-of select="substring-after ($s, '&gt;')" />
2297                         </xsl:when>
2298                         <xsl:otherwise><xsl:value-of select="$s" /></xsl:otherwise>
2299                 </xsl:choose>
2300         </xsl:template>
2301
2302         <xsl:template name="GetCLtGtPositions">
2303                 <xsl:param name="s" />
2304
2305                 <xsl:variable name="c"  select="substring-before ($s, ',')" />
2306                 <xsl:variable name="lt" select="substring-before ($s, '&lt;')" />
2307                 <xsl:variable name="gt" select="substring-before ($s, '&gt;')" />
2308
2309                 <Positions>
2310                         <Comma String="{$c}" Length="{string-length ($c)}" />
2311                         <Lt String="{$lt}" Length="{string-length ($lt)}" />
2312                         <Gt String="{$gt}" Length="{string-length ($gt)}" />
2313                 </Positions>
2314         </xsl:template>
2315
2316         <!--
2317         when given 'Foo<A,Bar<Baz<C,D,E>>>>', returns '>'
2318         when given 'Bar<C>+Nested>', returns '>'
2319         when given 'Foo<A,Bar<Baz<C,D,E>>>,', returns ','
2320         (basically, it matches '<' to '>' and "skips" the intermediate type-name contents.
2321           -->
2322         <xsl:template name="SkipGenericArgument">
2323                 <xsl:param name="s" />
2324
2325                 <xsl:variable name="p">
2326                         <xsl:call-template name="GetCLtGtPositions">
2327                                 <xsl:with-param name="s" select="$s" />
2328                         </xsl:call-template>
2329                 </xsl:variable>
2330
2331                 <xsl:choose>
2332                         <xsl:when test="starts-with ($s, '>')">
2333                                 <xsl:message terminate="yes">
2334 SkipGenericArgument: invalid type substring '<xsl:value-of select="$s" />'
2335                                 </xsl:message>
2336                         </xsl:when>
2337                         <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length &lt; $p/Gt/@Length">
2338                                 <!-- within 'Foo<A...'; look for matching '>' -->
2339                                 <xsl:variable name="r">
2340                                         <xsl:call-template name="SkipGenericArgument">
2341                                                 <xsl:with-param name="s" select="substring-after ($s, '&lt;')" />
2342                                         </xsl:call-template>
2343                                 </xsl:variable>
2344                                 <xsl:value-of select="substring-after ($r, '&gt;')" />
2345                         </xsl:when>
2346                         <xsl:when test="$p/Gt/@Length > 0">
2347                                 <!--<xsl:value-of select="substring ($s, string-length ($gt)+1)" />-->
2348                                 <xsl:value-of select="substring-after ($s, '&gt;')" />
2349                         </xsl:when>
2350                         <xsl:otherwise>
2351                                 <xsl:value-of select="$s" />
2352                         </xsl:otherwise>
2353                 </xsl:choose>
2354         </xsl:template>
2355
2356         <xsl:template name="GetEscapedParameter">
2357                 <xsl:param name="orig-parameter-type" />
2358                 <xsl:param name="parameter-type" />
2359                 <xsl:param name="parameter-types" />
2360                 <xsl:param name="escape" />
2361                 <xsl:param name="index" />
2362
2363                 <xsl:choose>
2364                         <xsl:when test="$index &gt; count($parameter-types)">
2365                                 <xsl:if test="$parameter-type != $orig-parameter-type">
2366                                         <xsl:value-of select="$parameter-type" />
2367                                 </xsl:if>
2368                                 <!-- ignore -->
2369                         </xsl:when>
2370                         <xsl:when test="$parameter-types[position() = $index]/@name = $parameter-type">
2371                                 <xsl:value-of select="concat ($escape, $index - 1)" />
2372                         </xsl:when>
2373                         <xsl:otherwise>
2374                                 <xsl:variable name="typeparam" select="$parameter-types[position() = $index]/@name" />
2375                                 <xsl:call-template name="GetEscapedParameter">
2376                                         <xsl:with-param name="orig-parameter-type" select="$orig-parameter-type" />
2377                                         <xsl:with-param name="parameter-type">
2378                                                 <xsl:call-template name="Replace">
2379                                                         <xsl:with-param name="s">
2380                                                                 <xsl:call-template name="Replace">
2381                                                                         <xsl:with-param name="s">
2382                                                                                 <xsl:call-template name="Replace">
2383                                                                                         <xsl:with-param name="s">
2384                                                                                                 <xsl:call-template name="Replace">
2385                                                                                                         <xsl:with-param name="s" select="$parameter-type"/>
2386                                                                                                         <xsl:with-param name="from" select="concat('&lt;', $typeparam, '&gt;')" />
2387                                                                                                         <xsl:with-param name="to" select="concat('&lt;', $escape, $index - 1, '&gt;')" />
2388                                                                                                 </xsl:call-template>
2389                                                                                         </xsl:with-param>
2390                                                                                         <xsl:with-param name="from" select="concat('&lt;', $typeparam, ',')" />
2391                                                                                         <xsl:with-param name="to" select="concat('&lt;', $escape, $index - 1, ',')" />
2392                                                                                 </xsl:call-template>
2393                                                                         </xsl:with-param>
2394                                                                         <xsl:with-param name="from" select="concat (',', $typeparam, '&gt;')" />
2395                                                                         <xsl:with-param name="to" select="concat(',', $escape, $index - 1, '&gt;')" />
2396                                                                 </xsl:call-template>
2397                                                         </xsl:with-param>
2398                                                         <xsl:with-param name="from" select="concat (',', $typeparam, ',')" />
2399                                                         <xsl:with-param name="to" select="concat(',', $escape, $index - 1, ',')" />
2400                                                 </xsl:call-template>
2401                                         </xsl:with-param>
2402                                         <xsl:with-param name="parameter-types" select="$parameter-types" />
2403                                         <xsl:with-param name="typeparam" select="$typeparam" />
2404                                         <xsl:with-param name="escape" select="$escape" />
2405                                         <xsl:with-param name="index" select="$index + 1" />
2406                                 </xsl:call-template>
2407                         </xsl:otherwise>
2408                 </xsl:choose>
2409         </xsl:template>
2410
2411         <xsl:template name="GetLinkId">
2412                 <xsl:param name="type"/>
2413                 <xsl:param name="member"/>
2414                 <xsl:call-template name="GetLinkName">
2415                         <xsl:with-param name="type" select="$type" />
2416                         <xsl:with-param name="member" select="$member" />
2417                 </xsl:call-template>
2418                 <xsl:if test="count($member/Parameters/Parameter) &gt; 0">
2419                         <xsl:text>(</xsl:text>
2420                         <xsl:for-each select="Parameters/Parameter">
2421                                 <xsl:if test="not(position()=1)">,</xsl:if>
2422                                 <xsl:call-template name="GetParameterType">
2423                                         <xsl:with-param name="type" select="$type" />
2424                                         <xsl:with-param name="member" select="$member" />
2425                                         <xsl:with-param name="parameter" select="." />
2426                                 </xsl:call-template>
2427                         </xsl:for-each>
2428                         <xsl:text>)</xsl:text>
2429                 </xsl:if>
2430                 <xsl:if test="$member/@MemberName='op_Implicit' or $member/@MemberName='op_Explicit'">
2431                         <xsl:text>~</xsl:text>
2432                         <xsl:call-template name="GetParameterType">
2433                                 <xsl:with-param name="type" select="$type" />
2434                                 <xsl:with-param name="member" select="$member" />
2435                                 <xsl:with-param name="parameter">
2436                                         <Parameter Type="{$member/ReturnValue/ReturnType}" />
2437                                 </xsl:with-param>
2438                         </xsl:call-template>
2439                 </xsl:if>
2440         </xsl:template>
2441
2442         <!-- 
2443           - what should be <xsl:value-of select="@Type" /> becomes a nightmare once
2444                 - generics enter the picture, since a parameter type could come from the
2445                 - type itelf (becoming `N) or from the method (becoming ``N).
2446           -->
2447         <xsl:template name="GetParameterType">
2448                 <xsl:param name="type" />
2449                 <xsl:param name="member" />
2450                 <xsl:param name="parameter" />
2451
2452                 <!-- the actual parameter type -->
2453                 <xsl:variable name="ptype">
2454                         <xsl:choose>
2455                                 <xsl:when test="contains($parameter/@Type, '[')">
2456                                         <xsl:value-of select="substring-before ($parameter/@Type, '[')" />
2457                                 </xsl:when>
2458                                 <xsl:when test="contains($parameter/@Type, '&amp;')">
2459                                         <xsl:value-of select="substring-before ($parameter/@Type, '&amp;')" />
2460                                 </xsl:when>
2461                                 <xsl:when test="contains($parameter/@Type, '*')">
2462                                         <xsl:value-of select="substring-before ($parameter/@Type, '*')" />
2463                                 </xsl:when>
2464                                 <xsl:otherwise>
2465                                         <xsl:value-of select="$parameter/@Type" />
2466                                 </xsl:otherwise>
2467                         </xsl:choose>
2468                 </xsl:variable>
2469
2470                 <!-- parameter modifiers -->
2471                 <xsl:variable name="pmodifier">
2472                         <xsl:call-template name="Replace">
2473                                 <xsl:with-param name="s" select="substring-after ($parameter/@Type, $ptype)" />
2474                                 <xsl:with-param name="from">&amp;</xsl:with-param>
2475                                 <xsl:with-param name="to">@</xsl:with-param>
2476                         </xsl:call-template>
2477                 </xsl:variable>
2478
2479                 <xsl:variable name="gen-type">
2480                         <xsl:call-template name="GetEscapedParameter">
2481                                 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2482                                 <xsl:with-param name="parameter-type">
2483                                         <xsl:variable name="nested">
2484                                                 <xsl:call-template name="GetEscapedParameter">
2485                                                         <xsl:with-param name="orig-parameter-type" select="$ptype" />
2486                                                         <xsl:with-param name="parameter-type" select="$ptype" />
2487                                                         <xsl:with-param name="parameter-types" select="$type/Docs/typeparam" />
2488                                                         <xsl:with-param name="escape" select="'`'" />
2489                                                         <xsl:with-param name="index" select="1" />
2490                                                 </xsl:call-template>
2491                                         </xsl:variable>
2492                                         <xsl:choose>
2493                                                 <xsl:when test="$nested != ''">
2494                                                         <xsl:value-of select="$nested" />
2495                                                 </xsl:when>
2496                                                 <xsl:otherwise>
2497                                                         <xsl:value-of select="$ptype" />
2498                                                 </xsl:otherwise>
2499                                         </xsl:choose>
2500                                 </xsl:with-param>
2501                                 <xsl:with-param name="parameter-types" select="$member/Docs/typeparam" />
2502                                 <xsl:with-param name="escape" select="'``'" />
2503                                 <xsl:with-param name="index" select="1" />
2504                         </xsl:call-template>
2505                 </xsl:variable>
2506
2507                 <!-- the actual parameter type -->
2508                 <xsl:variable name="parameter-type">
2509                         <xsl:choose>
2510                                 <xsl:when test="$gen-type != ''">
2511                                         <xsl:value-of select="$gen-type" />
2512                                         <xsl:value-of select="$pmodifier" />
2513                                 </xsl:when>
2514                                 <xsl:otherwise>
2515                                         <xsl:value-of select="concat($ptype, $pmodifier)" />
2516                                 </xsl:otherwise>
2517                         </xsl:choose>
2518                 </xsl:variable>
2519
2520                 <!-- s/</{/g; s/>/}/g; so that less escaping is needed. -->
2521                 <xsl:call-template name="Replace">
2522                         <xsl:with-param name="s">
2523                                 <xsl:call-template name="Replace">
2524                                         <xsl:with-param name="s" select="translate ($parameter-type, '+', '.')" />
2525                                         <xsl:with-param name="from">&gt;</xsl:with-param>
2526                                         <xsl:with-param name="to">}</xsl:with-param>
2527                                 </xsl:call-template>
2528                         </xsl:with-param>
2529                         <xsl:with-param name="from">&lt;</xsl:with-param>
2530                         <xsl:with-param name="to">{</xsl:with-param>
2531                 </xsl:call-template>
2532         </xsl:template>
2533
2534         <xsl:template name="Replace">
2535                 <xsl:param name="s" />
2536                 <xsl:param name="from" />
2537                 <xsl:param name="to" />
2538                 <xsl:choose>
2539                         <xsl:when test="not(contains($s, $from))">
2540                                 <xsl:value-of select="$s" />
2541                         </xsl:when>
2542                         <xsl:otherwise>
2543                                 <xsl:variable name="prefix" select="substring-before($s, $from)"/>
2544                                 <xsl:variable name="suffix" select="substring-after($s, $from)" />
2545                                 <xsl:value-of select="$prefix" />
2546                                 <xsl:value-of select="$to" />
2547                                 <xsl:call-template name="Replace">
2548                                         <xsl:with-param name="s" select="$suffix" />
2549                                         <xsl:with-param name="from" select="$from" />
2550                                         <xsl:with-param name="to" select="$to" />
2551                                 </xsl:call-template>
2552                         </xsl:otherwise>
2553                 </xsl:choose>
2554         </xsl:template>
2555
2556         <xsl:template name="getmodifiers">
2557                 <xsl:param name="sig"/>
2558                 <xsl:param name="protection" select="true()"/>
2559                 <xsl:param name="inheritance" select="true()"/>
2560                 <xsl:param name="extra" select="true()"/>
2561                 <xsl:param name="typetype" select="false()"/>
2562
2563                 <xsl:variable name="Sig">
2564                         <xsl:text> </xsl:text>
2565                         <xsl:choose>
2566                                 <xsl:when test="contains($sig, '{')">
2567                                         <xsl:value-of select="substring-before ($sig, '{')" />
2568                                 </xsl:when>
2569                                 <xsl:otherwise>
2570                                         <xsl:value-of select="$sig" />
2571                                 </xsl:otherwise>
2572                         </xsl:choose>
2573                         <xsl:text> </xsl:text>
2574                 </xsl:variable>
2575
2576                 <xsl:if test="$protection">
2577                         <xsl:if test="contains($Sig, ' public ')">public </xsl:if>
2578                         <xsl:if test="contains($Sig, ' private ')">private </xsl:if>
2579                         <xsl:if test="contains($Sig, ' protected ')">protected </xsl:if>
2580                         <xsl:if test="contains($Sig, ' internal ')">internal </xsl:if>
2581                 </xsl:if>
2582
2583                 <xsl:if test="contains($Sig, ' static ')">static </xsl:if>
2584                 <xsl:if test="contains($Sig, ' abstract ')">abstract </xsl:if>
2585                 <xsl:if test="contains($Sig, ' operator ')">operator </xsl:if>
2586
2587                 <xsl:if test="contains($Sig, ' const ')">const </xsl:if>
2588                 <xsl:if test="contains($Sig, ' readonly ')">readonly </xsl:if>
2589
2590                 <xsl:if test="$inheritance">
2591                         <xsl:if test="contains($Sig, ' override ')">override </xsl:if>
2592                         <xsl:if test="contains($Sig, ' new ')">new </xsl:if>
2593                 </xsl:if>
2594
2595                 <xsl:if test="$extra">
2596                         <xsl:if test="contains($Sig, ' sealed ')">sealed </xsl:if>
2597                         <xsl:if test="contains($Sig, ' virtual ')">virtual </xsl:if>
2598
2599                         <xsl:if test="contains($Sig, ' extern ')">extern </xsl:if>
2600                         <xsl:if test="contains($Sig, ' checked ')">checked </xsl:if>
2601                         <xsl:if test="contains($Sig, ' unsafe ')">unsafe </xsl:if>
2602                         <xsl:if test="contains($Sig, ' volatile ')">volatile </xsl:if>
2603                         <xsl:if test="contains($Sig, ' explicit ')">explicit </xsl:if>
2604                         <xsl:if test="contains($Sig, ' implicit ')">implicit </xsl:if>
2605                 </xsl:if>
2606
2607                 <xsl:if test="$typetype">
2608                         <xsl:if test="contains($Sig, ' class ')">class </xsl:if>
2609                         <xsl:if test="contains($Sig, ' interface ')">interface </xsl:if>
2610                         <xsl:if test="contains($Sig, ' struct ')">struct </xsl:if>
2611                         <xsl:if test="contains($Sig, ' delegate ')">delegate </xsl:if>
2612                         <xsl:if test="contains($Sig, ' enum ')">enum </xsl:if>
2613                 </xsl:if>
2614         </xsl:template>
2615
2616         <xsl:template name="GetTypeDescription">
2617                 <xsl:variable name="sig" select="TypeSignature[@Language='C#']/@Value"/>
2618                 <xsl:choose>
2619                         <xsl:when test="contains($sig, ' class ')">Class</xsl:when>
2620                         <xsl:when test="contains($sig, ' interface ')">Interface</xsl:when>
2621                         <xsl:when test="contains($sig, ' struct ')">Struct</xsl:when>
2622                         <xsl:when test="contains($sig, ' delegate ')">Delegate</xsl:when>
2623                         <xsl:when test="contains($sig, ' enum ')">Enum</xsl:when>
2624                 </xsl:choose>
2625         </xsl:template>
2626         
2627         <xsl:template match="since">
2628                 <p>
2629                         <i>Note: This namespace, class, or member is supported only in version <xsl:value-of select="@version" />
2630                         and later.</i>
2631                 </p>
2632         </xsl:template>
2633
2634 </xsl:stylesheet>