4 mdoc-html-utils.xsl: ECMA-style docs to HTML stylesheet transformation utils
6 Author: Joshua Tauberer (tauberer@for.net)
7 Author: Jonathan Pryor (jpryor@novell.com)
9 This file requires that including files define the following callable
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)
25 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
27 exclude-result-prefixes="msxsl"
29 <xsl:import href="mdoc-html-format.xsl" />
31 <!-- TEMPLATE PARAMETERS -->
32 <xsl:param name="language" select="'C#'"/>
33 <xsl:param name="index" />
34 <xsl:param name="source-id"/>
36 <xsl:variable name="ThisType" select="/Type"/>
38 <!-- The namespace that the current type belongs to. -->
39 <xsl:variable name="TypeNamespace" select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)"/>
41 <!-- THE MAIN RENDERING TEMPLATE -->
43 <!-- TYPE OVERVIEW -->
45 <xsl:template name="CreateTypeOverview">
46 <xsl:param name="implemented" />
47 <xsl:param name="show-members-link" />
49 <xsl:attribute name="id">
50 <xsl:text>T:</xsl:text>
51 <xsl:call-template name="GetEscapedTypeName">
52 <xsl:with-param name="typename" select="@FullName" />
54 <xsl:text>:Summary</xsl:text>
57 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
58 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
60 <xsl:if test="$implemented">
61 <p><b>Mono Implementation Note: </b></p>
63 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
67 <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)">
71 <xsl:attribute name="href">
72 <xsl:text>T</xsl:text>
73 <xsl:call-template name="GetLinkId">
74 <xsl:with-param name="type" select="." />
75 <xsl:with-param name="member" select="." />
77 <xsl:text>/*</xsl:text>
79 <xsl:value-of select="translate(@Name, '+', '.')"/>
80 <xsl:value-of select="' '" />
81 <xsl:text>Members</xsl:text>
87 Inheritance tree, but only for non-standard classes and not for interfaces
89 <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)">
91 <xsl:for-each select="Base/ParentType">
92 <xsl:sort select="@Order" order="descending"/>
93 <xsl:variable name="p" select="position()" />
94 <xsl:for-each select="parent::Base/ParentType[position() < $p]">
95 <xsl:value-of select="'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'" disable-output-escaping="yes"/>
98 <xsl:attribute name="href">
99 <xsl:call-template name="GetLinkTargetHtml">
100 <xsl:with-param name="type" select="@Type" />
101 <xsl:with-param name="cref">
102 <xsl:text>T:</xsl:text>
103 <xsl:call-template name="GetEscapedTypeName">
104 <xsl:with-param name="typename" select="@Type" />
109 <xsl:value-of select="@Type"/>
114 <xsl:for-each select="Base/ParentType">
115 <xsl:value-of select="'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'" disable-output-escaping="yes"/>
117 <xsl:value-of select="@FullName"/>
121 <xsl:if test="Base/BaseTypeName='System.Enum'">
123 The type of the values in this enumeration is
124 <xsl:apply-templates select="Members/Member[@MemberName='value__']/ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>.
129 <xsl:template name="CreateTypeSignature">
130 <xsl:attribute name="id">
131 <xsl:text>T:</xsl:text>
132 <xsl:call-template name="GetEscapedTypeName">
133 <xsl:with-param name="typename" select="@FullName" />
135 <xsl:text>:Signature</xsl:text>
138 <xsl:call-template name="CreateSignature">
139 <xsl:with-param name="content">
141 <xsl:when test="$language='C#'">
143 <xsl:for-each select="Attributes/Attribute">
144 <xsl:text>[</xsl:text>
145 <xsl:value-of select="AttributeName"/>
146 <xsl:text>]</xsl:text>
150 <xsl:for-each select="ReturnValue/Attributes/Attribute">
151 <xsl:text>[return:</xsl:text>
152 <xsl:value-of select="AttributeName"/>
153 <xsl:text>]</xsl:text>
159 <xsl:when test="Base/BaseTypeName='System.Enum'">
160 <xsl:call-template name="getmodifiers">
161 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
164 <xsl:text>enum </xsl:text>
166 <!-- member name, argument list -->
168 <xsl:value-of select="translate (@Name, '+', '.')"/>
172 <xsl:when test="Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.MulticastDelegate'">
175 <xsl:when test="count(Parameters) > 0 and count(ReturnValue) > 0">
176 <!-- Only recreate the delegate signature if the appropriate information
177 is present in the XML file. -->
179 <xsl:call-template name="getmodifiers">
180 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
183 <xsl:text>delegate </xsl:text>
185 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
188 <xsl:value-of select="' '"/>
190 <!-- member name, argument list -->
192 <xsl:call-template name="GetDefinitionName">
193 <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
194 <xsl:with-param name="TypeParameters" select="TypeParameters" />
199 <xsl:value-of select="' '"/>
201 <xsl:value-of select="'('"/> <!-- prevents whitespace issues -->
203 <xsl:for-each select="Parameters/Parameter">
204 <xsl:call-template name="ShowParameter">
205 <xsl:with-param name="Param" select="."/>
206 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
209 <xsl:if test="not(position()=last())">, </xsl:if>
212 <xsl:value-of select="')'"/>
217 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>
226 <xsl:call-template name="getmodifiers">
227 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
228 <xsl:with-param name="typetype" select="true()"/>
231 <xsl:value-of select="' '"/>
234 <xsl:call-template name="GetDefinitionName">
235 <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
236 <xsl:with-param name="TypeParameters" select="TypeParameters" />
240 <xsl:variable name="HasStandardBaseType" select="Base/BaseTypeName='System.Object' or Base/BaseTypeName='System.ValueType'"/>
241 <xsl:variable name="HasBaseType" select="count(Base/BaseTypeName)>0"/>
242 <xsl:if test="(($HasBaseType) and not($HasStandardBaseType)) or not(count(Interfaces/Interface)=0)">
243 <xsl:text> : </xsl:text>
245 <xsl:if test="$HasBaseType and not($HasStandardBaseType)">
246 <xsl:apply-templates select="Base/BaseTypeName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
247 <xsl:if test="not(count(Interfaces/Interface)=0)">, </xsl:if>
250 <xsl:for-each select="Interfaces/Interface">
251 <xsl:if test="not(position()=1)">, </xsl:if>
252 <xsl:apply-templates select="InterfaceName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
260 <xsl:call-template name="CreateGenericConstraints">
261 <xsl:with-param name="TypeParameters" select="TypeParameters" />
267 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>
275 <xsl:template name="GetDefinitionName">
276 <xsl:param name="name" />
277 <xsl:param name="TypeParameters" />
280 <!-- do NOT process explicitly implemented generic interface members
281 unless they're actually generic methods. -->
282 <xsl:when test="contains ($name, '>') and
283 '>' = substring ($name, string-length ($name), 1)">
284 <xsl:value-of select="substring-before ($name, '<')" />
285 <xsl:text><</xsl:text>
286 <xsl:for-each select="$TypeParameters/TypeParameter">
287 <xsl:for-each select="Attributes/Attribute">
288 <xsl:text>[</xsl:text>
289 <xsl:value-of select="AttributeName"/>
290 <xsl:text>] </xsl:text>
293 <xsl:when test="@Name">
294 <xsl:value-of select="@Name" />
297 <xsl:value-of select="." />
300 <xsl:if test="not(position()=last())">, </xsl:if>
302 <xsl:text>></xsl:text>
305 <xsl:value-of select="$name" />
310 <xsl:template name="CreateGenericConstraints">
311 <xsl:param name="TypeParameters" />
313 <xsl:for-each select="$TypeParameters/TypeParameter">
314 <xsl:variable name="constraintsCount" select="count(Constraints/*)" />
315 <xsl:if test="$constraintsCount > 0 and count(Constraints/*[.='Contravariant' or .='Covariant']) != $constraintsCount">
316 <xsl:call-template name="CreateGenericParameterConstraints">
317 <xsl:with-param name="constraints" select="Constraints" />
323 <xsl:template name="CreateGenericParameterConstraints">
324 <xsl:param name="constraints" />
327 <xsl:text> where </xsl:text>
328 <xsl:value-of select="@Name" />
329 <xsl:text> : </xsl:text>
330 <xsl:variable name="kind"
331 select="count($constraints[ParameterAttribute='ReferenceTypeConstraint'])+
332 count($constraints[ParameterAttribute='NotNullableValueTypeConstraint'])" />
333 <xsl:variable name="base" select="count($constraints/BaseTypeName)" />
334 <xsl:variable name="iface" select="count($constraints/InterfaceName)" />
335 <xsl:variable name="struct" select="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'" />
336 <xsl:if test="$constraints/ParameterAttribute='ReferenceTypeConstraint'">
337 <xsl:text>class</xsl:text>
339 <xsl:if test="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'">
340 <xsl:text>struct</xsl:text>
342 <xsl:if test="$constraints/BaseTypeName and not($struct)">
343 <xsl:if test="$kind">, </xsl:if>
344 <xsl:apply-templates select="$constraints/BaseTypeName" mode="typelink" />
346 <xsl:for-each select="$constraints/InterfaceName">
347 <xsl:if test="position()=1">
348 <xsl:if test="$kind or $base">, </xsl:if>
350 <xsl:apply-templates select="." mode="typelink" />
351 <xsl:if test="not(position()=last())">, </xsl:if>
353 <xsl:if test="$constraints/ParameterAttribute='DefaultConstructorConstraint' and not($struct)">
354 <xsl:if test="$base or $iface">, </xsl:if>
355 <xsl:text>new()</xsl:text>
359 <xsl:template name="CreateMemberOverview">
360 <xsl:param name="implemented" />
363 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
364 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
367 <xsl:if test="$implemented">
368 <p><b>Mono Implementation Note: </b></p>
370 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
374 <!-- member value -->
375 <xsl:if test="MemberValue">
377 <xsl:value-of select="MemberValue"/>
383 <xsl:template name="CreateRelatedSection">
384 <xsl:param name="section" />
385 <xsl:param name="type" />
386 <xsl:if test="count(Docs/related[@type=$type])">
387 <h3 class="{$type}"><xsl:value-of select="$section" /></h3>
389 <xsl:for-each select="Docs/related[@type=$type]">
390 <li><a href="{@href}"><xsl:value-of select="." /></a></li>
396 <xsl:template name="CreatePlatformRequirements">
397 <!-- For now we only have that information in MonoTouch so only process that -->
398 <xsl:if test="starts-with(/Type/@FullName, 'MonoTouch')">
400 <!-- We first check if we have a [Since] at the member level -->
401 <xsl:when test="count(Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')])">
402 <b>Minimum iOS version: </b>
403 <xsl:value-of select="translate(substring-before (substring-after (Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')], 'MonoTouch.ObjCRuntime.Since('), ')'), ', ', '.')" />
406 <!-- If not, we then check at the type level -->
407 <xsl:when test="count(/Type/Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')])">
408 <b>Minimum iOS version: </b>
409 <xsl:value-of select="translate(substring-before (substring-after (/Type/Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')], 'MonoTouch.ObjCRuntime.Since('), ')'), ', ', '.')" />
416 <xsl:template name="CreateMemberSignature">
417 <xsl:param name="linkid" select="''" />
419 <xsl:call-template name="CreateSignature">
420 <xsl:with-param name="content">
421 <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
422 <p><i>This is the default property for this class.</i></p>
425 <!-- recreate the signature -->
427 <xsl:for-each select="Attributes/Attribute[AttributeName != 'System.Runtime.CompilerServices.Extension']">
428 <xsl:text>[</xsl:text>
429 <xsl:value-of select="AttributeName"/>
430 <xsl:text>]</xsl:text>
434 <xsl:for-each select="ReturnValue/Attributes/Attribute">
435 <xsl:text>[return:</xsl:text>
436 <xsl:value-of select="AttributeName"/>
437 <xsl:text>]</xsl:text>
441 <xsl:call-template name="getmodifiers">
442 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
445 <xsl:if test="MemberType = 'Event'">
446 <xsl:text>event </xsl:text>
448 <xsl:if test="ReturnValue/ReturnType=''">
449 <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, 'event '), concat(' ', @MemberName))"/>
453 <!-- return value (comes out "" where not applicable/available) -->
455 <xsl:when test="@MemberName='op_Implicit'">
456 <xsl:text>implicit operator</xsl:text>
458 <xsl:when test="@MemberName='op_Explicit'">
459 <xsl:text>explicit operator</xsl:text>
462 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
463 <xsl:with-param name="wrt" select="$TypeNamespace"/>
464 </xsl:apply-templates>
469 <xsl:value-of select="' '"/>
474 <!-- Constructors get the name of the class -->
475 <xsl:when test="MemberType='Constructor'">
477 <xsl:call-template name="GetConstructorName">
478 <xsl:with-param name="type" select="../.." />
479 <xsl:with-param name="ctor" select="." />
484 <!-- Conversion operators get the return type -->
485 <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
486 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
487 <xsl:with-param name="wrt" select="$TypeNamespace"/>
488 </xsl:apply-templates>
491 <!-- Regular operators get their symbol -->
492 <xsl:when test="@MemberName='op_UnaryPlus'">operator+</xsl:when>
493 <xsl:when test="@MemberName='op_UnaryNegation'">operator-</xsl:when>
494 <xsl:when test="@MemberName='op_LogicalNot'">operator!</xsl:when>
495 <xsl:when test="@MemberName='op_OnesComplement'">operator~</xsl:when>
496 <xsl:when test="@MemberName='op_Increment'">operator++</xsl:when>
497 <xsl:when test="@MemberName='op_Decrement'">operator--</xsl:when>
498 <xsl:when test="@MemberName='op_True'">operator true</xsl:when>
499 <xsl:when test="@MemberName='op_False'">operator false</xsl:when>
500 <xsl:when test="@MemberName='op_Addition'">operator+</xsl:when>
501 <xsl:when test="@MemberName='op_Subtraction'">operator-</xsl:when>
502 <xsl:when test="@MemberName='op_Multiply'">operator*</xsl:when>
503 <xsl:when test="@MemberName='op_Division'">operator/</xsl:when>
504 <xsl:when test="@MemberName='op_Modulus'">operator%</xsl:when>
505 <xsl:when test="@MemberName='op_BitwiseAnd'">operator&</xsl:when>
506 <xsl:when test="@MemberName='op_BitwiseOr'">operator|</xsl:when>
507 <xsl:when test="@MemberName='op_ExclusiveOr'">operator^</xsl:when>
508 <xsl:when test="@MemberName='op_LeftShift'">operator<<</xsl:when>
509 <xsl:when test="@MemberName='op_RightShift'">operator>></xsl:when>
510 <xsl:when test="@MemberName='op_Equality'">operator==</xsl:when>
511 <xsl:when test="@MemberName='op_Inequality'">operator!=</xsl:when>
512 <xsl:when test="@MemberName='op_GreaterThan'">operator></xsl:when>
513 <xsl:when test="@MemberName='op_LessThan'">operator<</xsl:when>
514 <xsl:when test="@MemberName='op_GreaterThanOrEqual'">operator>=</xsl:when>
515 <xsl:when test="@MemberName='op_LessThanOrEqual'">operator<=</xsl:when>
517 <xsl:when test="MemberType='Property' and count(Parameters/Parameter) > 0">
518 <!-- C# only permits indexer properties to have arguments -->
519 <xsl:text>this</xsl:text>
522 <!-- Everything else just gets its name -->
523 <xsl:when test="contains (@MemberName, '<')">
525 <xsl:call-template name="GetDefinitionName">
526 <xsl:with-param name="name" select="@MemberName" />
527 <xsl:with-param name="TypeParameters" select="TypeParameters" />
533 <b><xsl:value-of select="@MemberName"/></b>
538 <xsl:value-of select="' '"/>
540 <!-- argument list -->
541 <xsl:if test="MemberType='Method' or MemberType='Constructor' or (MemberType='Property' and count(Parameters/Parameter))">
542 <xsl:if test="not(MemberType='Property')">(</xsl:if>
543 <xsl:if test="MemberType='Property'">[</xsl:if>
545 <xsl:for-each select="Parameters/Parameter">
546 <xsl:call-template name="ShowParameter">
547 <xsl:with-param name="Param" select="."/>
548 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
551 <xsl:if test="not(position()=last())">, </xsl:if>
553 <xsl:if test="not(MemberType='Property')">)</xsl:if>
554 <xsl:if test="MemberType='Property'">]</xsl:if>
557 <xsl:if test="MemberType='Property'">
558 <xsl:value-of select="' '"/>
559 <xsl:text>{</xsl:text>
560 <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, '{'), '}')"/>
561 <xsl:text>}</xsl:text>
563 <xsl:call-template name="CreateGenericConstraints">
564 <xsl:with-param name="TypeParameters" select="TypeParameters" />
571 <xsl:template name="GetConstructorName">
572 <xsl:param name="type" />
573 <xsl:param name="ctor" />
576 <xsl:when test="contains($type/@Name, '<')">
577 <xsl:value-of select="translate (substring-before ($type/@Name, '<'), '+', '.')" />
580 <xsl:value-of select="translate ($type/@Name, '+', '.')" />
585 <xsl:template name="ShowParameter">
586 <xsl:param name="Param"/>
587 <xsl:param name="TypeNamespace"/>
588 <xsl:param name="prototype" select="false()"/>
590 <xsl:if test="not($prototype)">
591 <xsl:for-each select="$Param/Attributes/Attribute[not(Exclude='1') and not(AttributeName='ParamArrayAttribute' or AttributeName='System.ParamArray')]">
592 <xsl:text>[</xsl:text>
593 <xsl:value-of select="AttributeName"/>
594 <xsl:text>]</xsl:text>
595 <xsl:value-of select="' '"/>
599 <xsl:if test="count($Param/Attributes/Attribute/AttributeName[.='ParamArrayAttribute' or .='System.ParamArray'])">
601 <xsl:value-of select="' '"/>
604 <xsl:if test="$Param/@RefType">
605 <i><xsl:value-of select="$Param/@RefType"/></i>
607 <xsl:value-of select="' '"/>
610 <!-- parameter type link -->
611 <xsl:apply-templates select="$Param/@Type" mode="typelink">
612 <xsl:with-param name="wrt" select="$TypeNamespace"/>
613 </xsl:apply-templates>
615 <xsl:if test="not($prototype)">
617 <xsl:value-of select="' '"/>
619 <!-- parameter name -->
620 <xsl:value-of select="$Param/@Name"/>
624 <xsl:template name="DisplayDocsInformation">
625 <xsl:param name="linkid" />
627 <!-- The namespace that the current type belongs to. -->
628 <xsl:variable name="TypeNamespace" select="substring(@FullName, 1, string-length(@FullName) - string-length(@Name) - 1)"/>
630 <!-- alt member: not sure what these are for, actually -->
632 <xsl:if test="count(Docs/altmember)">
633 <xsl:call-template name="CreateH4Section">
634 <xsl:with-param name="name" select="'See Also'"/>
635 <xsl:with-param name="child-id" select="concat ($linkid, ':See Also')" />
636 <xsl:with-param name="content">
637 <xsl:for-each select="Docs/altmember">
638 <div><xsl:apply-templates select="@cref" mode="cref"/></div>
644 <!-- parameters & return & value -->
646 <xsl:if test="count(Docs/typeparam)">
647 <xsl:call-template name="CreateH4Section">
648 <xsl:with-param name="name" select="'Type Parameters'"/>
649 <xsl:with-param name="child-id" select="concat ($linkid, ':Type Parameters')" />
650 <xsl:with-param name="content">
652 <xsl:for-each select="Docs/typeparam">
653 <dt><i><xsl:value-of select="@name"/></i></dt>
655 <xsl:apply-templates select="." mode="notoppara"/>
656 <xsl:apply-templates select="." mode="editlink"/>
663 <xsl:if test="count(Docs/param)">
664 <xsl:call-template name="CreateH4Section">
665 <xsl:with-param name="name" select="'Parameters'"/>
666 <xsl:with-param name="child-id" select="concat ($linkid, ':Parameters')" />
667 <xsl:with-param name="content">
669 <xsl:for-each select="Docs/param">
670 <dt><i><xsl:value-of select="@name"/></i></dt>
672 <xsl:apply-templates select="." mode="notoppara"/>
673 <xsl:apply-templates select="." mode="editlink"/>
680 <xsl:if test="count(Docs/returns)">
681 <xsl:call-template name="CreateH4Section">
682 <xsl:with-param name="name" select="'Returns'"/>
683 <xsl:with-param name="child-id" select="concat ($linkid, ':Returns')" />
684 <xsl:with-param name="content">
685 <xsl:apply-templates select="Docs/returns" mode="notoppara"/>
686 <xsl:apply-templates select="Docs/returns" mode="editlink"/>
690 <xsl:if test="count(Docs/value)">
691 <xsl:call-template name="CreateH4Section">
692 <xsl:with-param name="name" select="'Value'"/>
693 <xsl:with-param name="child-id" select="concat ($linkid, ':Value')" />
694 <xsl:with-param name="content">
695 <xsl:apply-templates select="Docs/value" mode="notoppara"/>
696 <xsl:apply-templates select="Docs/value" mode="editlink"/>
701 <!-- method/property/constructor exceptions -->
703 <xsl:if test="count(Docs/exception)">
704 <xsl:call-template name="CreateH4Section">
705 <xsl:with-param name="name" select="'Exceptions'"/>
706 <xsl:with-param name="child-id" select="concat ($linkid, ':Exceptions')" />
707 <xsl:with-param name="content">
708 <xsl:call-template name="CreateTypeDocumentationTable">
709 <xsl:with-param name="content">
710 <xsl:for-each select="Docs/exception">
713 <xsl:apply-templates select="@cref" mode="typelink">
714 <xsl:with-param name="wrt" select="$TypeNamespace"/>
715 </xsl:apply-templates>
718 <xsl:apply-templates select="." mode="notoppara"/>
719 <xsl:apply-templates select="." mode="editlink"/>
731 <xsl:if test="count(Docs/remarks)">
732 <xsl:call-template name="CreateH2Section">
733 <xsl:with-param name="name" select="'Remarks'"/>
734 <xsl:with-param name="child-id" select="concat ($linkid, ':Remarks')" />
735 <xsl:with-param name="content">
736 <xsl:apply-templates select="Docs/remarks" mode="notoppara"/>
737 <xsl:apply-templates select="Docs/remarks" mode="editlink"/>
742 <!-- thread safety -->
744 <xsl:if test="count(ThreadingSafetyStatement)">
745 <xsl:call-template name="CreateH2Section">
746 <xsl:with-param name="name" select="'Thread Safety'"/>
747 <xsl:with-param name="child-id" select="concat ($linkid, ':Thread Safety')" />
748 <xsl:with-param name="content">
749 <xsl:apply-templates select="ThreadingSafetyStatement" mode="notoppara"/>
757 <xsl:if test="count(Docs/permission)">
758 <xsl:call-template name="CreateH2Section">
759 <xsl:with-param name="name" select="'Permissions'"/>
760 <xsl:with-param name="child-id" select="concat ($linkid, ':Permissions')" />
761 <xsl:with-param name="content">
762 <xsl:call-template name="CreateTypeDocumentationTable">
763 <xsl:with-param name="content">
764 <xsl:for-each select="Docs/permission">
767 <xsl:apply-templates select="@cref" mode="typelink">
768 <xsl:with-param name="wrt" select="$TypeNamespace"/>
769 </xsl:apply-templates>
770 <xsl:apply-templates select="." mode="editlink"/>
773 <xsl:apply-templates select="." mode="notoppara"/>
783 <!-- enumeration values -->
785 <xsl:if test="Base/BaseTypeName = 'System.Enum'">
786 <xsl:call-template name="CreateH2Section">
787 <xsl:with-param name="name" select="'Members'"/>
788 <xsl:with-param name="child-id" select="concat ($linkid, ':Members')" />
789 <xsl:with-param name="content">
790 <xsl:call-template name="CreateEnumerationTable">
791 <xsl:with-param name="content">
793 <xsl:for-each select="Members/Member[MemberType='Field']">
794 <xsl:if test="not(@MemberName='value__')">
795 <tr valign="top"><td>
796 <xsl:attribute name="id">
797 <xsl:text>F:</xsl:text>
798 <xsl:value-of select="translate (/Type/@FullName, '+', '.')" />
799 <xsl:text>.</xsl:text>
800 <xsl:value-of select="@MemberName" />
803 <xsl:value-of select="@MemberName"/>
807 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
808 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
821 <xsl:if test="count(Docs/example)">
822 <xsl:for-each select="Docs/example">
823 <xsl:call-template name="CreateH2Section">
824 <xsl:with-param name="name" select="'Example'"/>
825 <xsl:with-param name="child-id" select="concat ($linkid, ':Example:', position())" />
826 <xsl:with-param name="content">
827 <xsl:apply-templates select="." mode="notoppara"/>
833 <!-- related content -->
834 <xsl:if test="count(Docs/related)">
835 <xsl:call-template name="CreateH2Section">
836 <xsl:with-param name="name" select="'Related content'" />
837 <xsl:with-param name="child-id" select="concat ($linkid, ':Related:')" />
838 <xsl:with-param name="content">
839 <div class="related">
840 <xsl:call-template name="CreateRelatedSection">
841 <xsl:with-param name="section" select="'Articles'" />
842 <xsl:with-param name="type" select="'article'" />
844 <xsl:call-template name="CreateRelatedSection">
845 <xsl:with-param name="section" select="'Available Samples'" />
846 <xsl:with-param name="type" select="'sample'" />
848 <xsl:call-template name="CreateRelatedSection">
849 <xsl:with-param name="section" select="'Related specifications'" />
850 <xsl:with-param name="type" select="'specification'" />
852 <xsl:call-template name="CreateRelatedSection">
853 <xsl:with-param name="section" select="'External Documentation'" />
854 <xsl:with-param name="type" select="'externalDocumentation'" />
861 <xsl:call-template name="CreateH2Section">
862 <xsl:with-param name="name" select="'Requirements'"/>
863 <xsl:with-param name="child-id" select="concat ($linkid, ':Version Information')" />
864 <xsl:with-param name="content">
865 <xsl:call-template name="CreatePlatformRequirements" />
866 <b>Namespace: </b><xsl:value-of select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)" />
867 <xsl:if test="count(/Type/AssemblyInfo/AssemblyName) > 0">
870 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
871 <xsl:text> (in </xsl:text>
872 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
873 <xsl:text>.dll)</xsl:text>
875 <xsl:if test="count(AssemblyInfo/AssemblyVersion) > 0">
877 <b>Assembly Versions: </b>
878 <xsl:for-each select="AssemblyInfo/AssemblyVersion">
879 <xsl:if test="not(position()=1)">, </xsl:if>
880 <xsl:value-of select="."/>
883 <xsl:if test="count(Docs/since) > 0">
886 <xsl:for-each select="Docs/since">
887 <xsl:if test="not(position()=1)">; </xsl:if>
888 <xsl:value-of select="@version"/>
891 <xsl:if test="count(Docs/since)=0 and count(/Type/Docs/since) > 0">
894 <xsl:for-each select="/Type/Docs/since">
895 <xsl:if test="not(position()=1)">; </xsl:if>
896 <xsl:value-of select="@version"/>
904 <!-- 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. -->
906 <xsl:template match="*|@*" mode="typelink">
907 <xsl:param name="wrt" select="'notset'"/>
909 <xsl:call-template name="maketypelink">
910 <xsl:with-param name="type" select="."/>
911 <xsl:with-param name="wrt" select="$wrt"/>
915 <xsl:template name="makenamespacelink">
916 <xsl:param name="cref" select="''"/>
919 <xsl:attribute name="href">
920 <xsl:call-template name="GetLinkTargetHtml">
921 <xsl:with-param name="cref" select="$cref" />
925 <xsl:value-of select="substring-after ($cref, 'N:')" />
929 <xsl:template name="maketypelink">
930 <xsl:param name="type" select="'notset'"/>
931 <xsl:param name="wrt" select="'notset'"/>
932 <xsl:param name="nested" select="0"/>
934 <xsl:variable name="btype">
935 <xsl:call-template name="ToBrackets">
936 <xsl:with-param name="s" select="$type" />
940 <xsl:variable name="array">
941 <xsl:call-template name="GetArraySuffix">
942 <xsl:with-param name="type" select="$type" />
949 <xsl:when test="starts-with($type, 'T:')">
950 <xsl:call-template name="maketypelink">
951 <xsl:with-param name="type" select="substring($type, 3)"/>
952 <xsl:with-param name="wrt" select="$wrt"/>
956 <xsl:when test="contains ($type, '&') and
957 '&' = substring ($type, string-length ($type), 1)">
958 <xsl:call-template name="maketypelink">
959 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
960 <xsl:with-param name="wrt" select="$wrt"/>
964 <xsl:when test="string($array)">
965 <xsl:call-template name="maketypelink">
966 <xsl:with-param name="type" select="substring($type, 1, string-length($type) - string-length ($array))"/>
967 <xsl:with-param name="wrt" select="$wrt"/>
969 <xsl:value-of select="$array"/>
972 <xsl:when test="contains ($type, '*') and
973 '*' = substring ($type, string-length ($type), 1)">
974 <xsl:call-template name="maketypelink">
975 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
976 <xsl:with-param name="wrt" select="$wrt"/>
978 <xsl:value-of select="'*'"/>
981 <!-- if this is a generic type parameter, don't make a link but italicize it and give it a tooltip instead -->
982 <xsl:when test="count($ThisType/TypeParameters/TypeParameter[@Name=$type] |
983 $ThisType/TypeParameters/TypeParameter[child::text()=$type] |
984 ancestor::Member/Docs/typeparam[@name=$type]) = 1">
985 <!-- 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 -->
986 <i title="{$ThisType/Docs/typeparam[@name=$type] | ancestor::Member/Docs/typeparam[@name=$type]}"><xsl:value-of select="$type"/></i>
989 <!-- if this is a generic type parameter of a base type, replace it with the type that it was instantiated with -->
990 <xsl:when test="count(ancestor::Members/BaseTypeArgument[@TypeParamName=$type]) = 1">
991 <!-- 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 -->
992 <xsl:call-template name="maketypelink">
993 <xsl:with-param name="type" select="ancestor::Members/BaseTypeArgument[@TypeParamName=$type]"/>
994 <xsl:with-param name="wrt" select="$wrt"/>
1000 <xsl:variable name="escaped-type">
1001 <xsl:call-template name="GetEscapedTypeName">
1002 <xsl:with-param name="typename" select="$btype" />
1003 </xsl:call-template>
1006 <xsl:attribute name="href">
1007 <xsl:call-template name="GetLinkTargetHtml">
1008 <xsl:with-param name="type" select="$escaped-type" />
1009 <xsl:with-param name="cref" select="concat ('T:', $escaped-type)" />
1010 </xsl:call-template>
1013 <xsl:call-template name="GetTypeDisplayName">
1014 <xsl:with-param name="T" select="$btype"/>
1015 <xsl:with-param name="wrt" select="$wrt"/>
1016 </xsl:call-template>
1022 <xsl:template name="GetArraySuffix">
1023 <xsl:param name="type" />
1025 <xsl:if test="contains ($type, ']') and
1026 ']' = substring ($type, string-length ($type), 1)">
1027 <xsl:variable name="start">
1028 <xsl:call-template name="GetArraySuffixStart">
1029 <xsl:with-param name="type" select="$type" />
1030 <xsl:with-param name="i" select="string-length ($type) - 1" />
1031 </xsl:call-template>
1033 <xsl:value-of select="substring ($type, $start)" />
1037 <xsl:template name="GetArraySuffixStart">
1038 <xsl:param name="type" />
1039 <xsl:param name="i" />
1042 <xsl:when test="substring ($type, $i, 1) = '['">
1043 <xsl:value-of select="$i" />
1046 <xsl:call-template name="GetArraySuffixStart">
1047 <xsl:with-param name="type" select="$type" />
1048 <xsl:with-param name="i" select="$i - 1" />
1049 </xsl:call-template>
1054 <xsl:template name="GetTypeDisplayName">
1055 <xsl:param name="T"/>
1056 <xsl:param name="wrt"/>
1058 <!-- use C#-style names -->
1060 <xsl:when test="$T='System.Object'">object</xsl:when>
1061 <xsl:when test="$T='System.Boolean'">bool</xsl:when>
1062 <xsl:when test="$T='System.Byte'">byte</xsl:when>
1063 <xsl:when test="$T='System.Char'">char</xsl:when>
1064 <xsl:when test="$T='System.Decimal'">decimal</xsl:when>
1065 <xsl:when test="$T='System.Double'">double</xsl:when>
1066 <xsl:when test="$T='System.Int16'">short</xsl:when>
1067 <xsl:when test="$T='System.Int32'">int</xsl:when>
1068 <xsl:when test="$T='System.Int64'">long</xsl:when>
1069 <xsl:when test="$T='System.SByte'">sbyte</xsl:when>
1070 <xsl:when test="$T='System.Single'">float</xsl:when>
1071 <xsl:when test="$T='System.String'">string</xsl:when>
1072 <xsl:when test="$T='System.UInt16'">ushort</xsl:when>
1073 <xsl:when test="$T='System.UInt32'">uint</xsl:when>
1074 <xsl:when test="$T='System.UInt64'">ulong</xsl:when>
1075 <xsl:when test="$T='System.Void'">void</xsl:when>
1077 <xsl:when test="contains($T, '<')">
1078 <xsl:call-template name="GetTypeDisplayName">
1079 <xsl:with-param name="T" select="substring-before ($T, '<')" />
1080 <xsl:with-param name="wrt" select="$wrt" />
1081 </xsl:call-template>
1082 <xsl:text><</xsl:text>
1083 <xsl:call-template name="GetMemberArgList">
1084 <xsl:with-param name="arglist" select="substring-after ($T, '<')" />
1085 <xsl:with-param name="wrt" select="$wrt" />
1086 </xsl:call-template>
1087 <!-- don't need to append > as GetMemberArgList (eventually) appends it -->
1090 <!-- if the type is in the wrt namespace, omit the namespace name -->
1091 <xsl:when test="not($wrt='') and starts-with($T, concat($wrt,'.')) and not(contains(substring-after($T,concat($wrt,'.')), '.'))">
1092 <xsl:value-of select="translate (substring-after($T,concat($wrt,'.')), '+', '.')"/>
1095 <!-- if the type is in the System namespace, omit the namespace name -->
1096 <xsl:when test="starts-with($T, 'System.') and not(contains(substring-after($T, 'System.'), '.'))">
1097 <xsl:value-of select="translate (substring-after($T,'System.'), '+', '.')"/>
1100 <!-- if the type is in the System.Collections namespace, omit the namespace name -->
1101 <xsl:when test="starts-with($T, 'System.Collections.') and not(contains(substring-after($T, 'System.Collections.'), '.'))">
1102 <xsl:value-of select="translate (substring-after($T,'System.Collections.'), '+', '.')"/>
1105 <!-- if the type is in the System.Collections.Generic namespace, omit the namespace name -->
1106 <xsl:when test="starts-with($T, 'System.Collections.Generic.') and not(contains(substring-after($T, 'System.Collections.Generic.'), '.'))">
1107 <xsl:value-of select="translate (substring-after($T,'System.Collections.Generic.'), '+', '.')"/>
1111 <xsl:value-of select="translate ($T, '+', '.')" />
1116 <xsl:template name="GetMemberDisplayName">
1117 <xsl:param name="memberName" />
1118 <xsl:param name="isproperty" select="false()" />
1121 <xsl:when test="contains($memberName, '.')">
1122 <xsl:call-template name="GetTypeDisplayName">
1123 <xsl:with-param name="T">
1124 <xsl:call-template name="GetTypeName">
1125 <xsl:with-param name="type" select="$memberName"/>
1126 </xsl:call-template>
1128 <xsl:with-param name="wrt" select="''" />
1129 </xsl:call-template>
1130 <xsl:text>.</xsl:text>
1131 <xsl:call-template name="GetMemberName">
1132 <xsl:with-param name="type" select="$memberName" />
1133 <xsl:with-param name="isproperty" select="$isproperty"/>
1134 </xsl:call-template>
1137 <xsl:value-of select="$memberName" />
1142 <xsl:template name="ToBrackets">
1143 <xsl:param name="s" />
1144 <xsl:value-of select="translate (translate ($s, '{', '<'), '}', '>')" />
1147 <xsl:template name="ToBraces">
1148 <xsl:param name="s" />
1149 <xsl:value-of select="translate (translate ($s, '<', '{'), '>', '}')" />
1152 <xsl:template name="memberlinkprefix">
1153 <xsl:param name="member" />
1155 <xsl:when test="$member/MemberType='Constructor'">C</xsl:when>
1156 <xsl:when test="$member/MemberType='Method'">M</xsl:when>
1157 <xsl:when test="$member/MemberType='Property'">P</xsl:when>
1158 <xsl:when test="$member/MemberType='Field'">F</xsl:when>
1159 <xsl:when test="$member/MemberType='Event'">E</xsl:when>
1163 <xsl:template name="makememberlink">
1164 <xsl:param name="cref"/>
1166 <xsl:variable name="bcref">
1167 <xsl:call-template name="ToBrackets">
1168 <xsl:with-param name="s" select="$cref" />
1169 </xsl:call-template>
1172 <xsl:variable name="fullname">
1174 <xsl:when test="starts-with($bcref, 'C:') or starts-with($bcref, 'T:')">
1176 <xsl:when test="contains($bcref, '(')">
1177 <xsl:value-of select="substring (substring-before ($bcref, '('), 3)" />
1180 <xsl:value-of select="substring($bcref, 3)" />
1185 <xsl:call-template name="GetTypeName">
1186 <xsl:with-param name="type" select="substring($bcref, 3)"/>
1187 </xsl:call-template>
1192 <xsl:variable name="memberName">
1194 <xsl:when test="starts-with($bcref, 'T:')" />
1195 <xsl:when test="starts-with($bcref, 'C:') and not(contains($bcref, '('))" />
1196 <xsl:when test="starts-with($bcref, 'C:') and contains($bcref, '(')">
1197 <xsl:text>(</xsl:text>
1198 <xsl:call-template name="GetMemberArgList">
1199 <xsl:with-param name="arglist" select="substring-before(substring-after($bcref, '('), ')')" />
1200 <xsl:with-param name="wrt" select="$TypeNamespace" />
1201 </xsl:call-template>
1202 <xsl:text>)</xsl:text>
1205 <xsl:text>.</xsl:text>
1206 <xsl:call-template name="GetMemberName">
1207 <xsl:with-param name="type" select="substring($bcref, 3)" />
1208 <xsl:with-param name="wrt" select="$fullname"/>
1209 <xsl:with-param name="isproperty" select="starts-with($bcref, 'P:')"/>
1210 </xsl:call-template>
1215 <xsl:variable name="escaped-type">
1216 <xsl:call-template name="GetEscapedTypeName">
1217 <xsl:with-param name="typename">
1218 <xsl:call-template name="ToBrackets">
1219 <xsl:with-param name="s" select="$fullname" />
1220 </xsl:call-template>
1222 </xsl:call-template>
1224 <xsl:variable name="displayname">
1225 <xsl:call-template name="GetTypeDisplayName">
1226 <xsl:with-param name="T" select="$fullname" />
1227 <xsl:with-param name="wrt" select="$TypeNamespace"/>
1228 </xsl:call-template>
1231 <xsl:attribute name="href">
1232 <xsl:call-template name="GetLinkTargetHtml">
1233 <xsl:with-param name="type" select="$escaped-type" />
1234 <xsl:with-param name="cref">
1235 <xsl:call-template name="ToBraces">
1236 <xsl:with-param name="s" select="$cref" />
1237 </xsl:call-template>
1239 </xsl:call-template>
1241 <xsl:value-of select="translate (concat($displayname, $memberName), '+', '.')" />
1245 <xsl:template name="GetTypeName">
1246 <xsl:param name="type" />
1247 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1248 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1250 <xsl:when test="contains($type, '(')">
1251 <xsl:call-template name="GetTypeName">
1252 <xsl:with-param name="type" select="substring-before($type, '(')" />
1253 </xsl:call-template>
1255 <xsl:when test="not(contains($suffix, '.'))">
1256 <xsl:value-of select="$prefix" />
1259 <xsl:value-of select="$prefix" />
1260 <xsl:text>.</xsl:text>
1261 <xsl:call-template name="GetTypeName">
1262 <xsl:with-param name="type" select="$suffix" />
1263 </xsl:call-template>
1268 <xsl:template name="GetMemberName">
1269 <xsl:param name="type" />
1270 <xsl:param name="isproperty" select="0"/>
1271 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1272 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1274 <xsl:when test="contains($type, '(')">
1275 <xsl:call-template name="GetMemberName">
1276 <xsl:with-param name="type" select="substring-before($type, '(')" />
1277 </xsl:call-template>
1278 <xsl:text>(</xsl:text>
1279 <xsl:call-template name="GetMemberArgList">
1280 <xsl:with-param name="arglist" select="substring-before(substring-after($type, '('), ')')" />
1281 <xsl:with-param name="wrt" select="$TypeNamespace" />
1282 </xsl:call-template>
1283 <xsl:text>)</xsl:text>
1285 <xsl:when test="not(contains($suffix, '.'))">
1286 <xsl:value-of select="$suffix" />
1289 <xsl:call-template name="GetMemberName">
1290 <xsl:with-param name="type" select="$suffix" />
1291 </xsl:call-template>
1296 <xsl:template name="GetMemberArgList">
1297 <xsl:param name="arglist" />
1298 <xsl:param name="wrt" select="''"/>
1300 <xsl:variable name="_arglist">
1302 <xsl:when test="starts-with ($arglist, ',')">
1303 <xsl:value-of select="substring-after ($arglist, ',')" />
1306 <xsl:value-of select="$arglist" />
1311 <xsl:if test="starts-with ($arglist, ',')">
1312 <xsl:text>, </xsl:text>
1315 <xsl:variable name="c" select="substring-before ($_arglist, ',')" />
1316 <xsl:variable name="lt" select="substring-before ($_arglist, '<')" />
1317 <xsl:variable name="gt" select="substring-before ($_arglist, '>')" />
1320 <!-- Need to insert ',' between type arguments -->
1322 ($c != '' and $lt != '' and $gt != '' and
1323 string-length ($c) < string-length ($lt) and
1324 string-length ($c) < string-length ($gt)) or
1325 ($c != '' and $lt != '' and $gt = '' and
1326 string-length ($c) < string-length ($lt)) or
1327 ($c != '' and $lt = '' and $gt != '' and
1328 string-length ($c) < string-length ($gt)) or
1329 ($c != '' and $lt = '' and $gt = '')">
1330 <xsl:call-template name="GetTypeDisplayName">
1331 <xsl:with-param name="T" select="$c"/>
1332 <xsl:with-param name="wrt" select="$wrt"/>
1333 </xsl:call-template>
1334 <xsl:text>, </xsl:text>
1335 <xsl:call-template name="GetMemberArgList">
1336 <xsl:with-param name="arglist" select="substring-after($_arglist, ',')" />
1337 <xsl:with-param name="wrt" select="$wrt" />
1338 </xsl:call-template>
1341 <!-- start of nested type argument list < -->
1343 ($c != '' and $lt != '' and $gt != '' and
1344 string-length ($lt) < string-length ($c) and
1345 string-length ($lt) < string-length ($gt)) or
1346 ($c != '' and $lt != '' and $gt = '' and
1347 string-length ($lt) < string-length ($c)) or
1348 ($c = '' and $lt != '' and $gt != '' and
1349 string-length ($lt) < string-length ($gt))">
1350 <xsl:call-template name="GetTypeDisplayName">
1351 <xsl:with-param name="T" select="$lt"/>
1352 <xsl:with-param name="wrt" select="$wrt"/>
1353 </xsl:call-template>
1354 <xsl:text><</xsl:text>
1355 <xsl:call-template name="GetMemberArgList">
1356 <xsl:with-param name="arglist" select="substring-after($_arglist, '<')" />
1357 <xsl:with-param name="wrt" select="$wrt" />
1358 </xsl:call-template>
1361 <!-- end of (nested?) type argument list > -->
1363 ($c != '' and $lt != '' and $gt != '' and
1364 string-length ($gt) < string-length ($c) and
1365 string-length ($gt) < string-length ($lt)) or
1366 ($c != '' and $lt = '' and $gt = '' and
1367 string-length ($gt) < string-length ($c)) or
1368 ($c = '' and $lt != '' and $gt != '' and
1369 string-length ($gt) < string-length ($lt)) or
1370 ($c = '' and $lt = '' and $gt != '')">
1371 <xsl:call-template name="GetTypeDisplayName">
1372 <xsl:with-param name="T" select="$gt"/>
1373 <xsl:with-param name="wrt" select="$wrt"/>
1374 </xsl:call-template>
1375 <xsl:text>></xsl:text>
1376 <xsl:call-template name="GetMemberArgList">
1377 <xsl:with-param name="arglist" select="substring-after($_arglist, '>')" />
1378 <xsl:with-param name="wrt" select="$wrt" />
1379 </xsl:call-template>
1382 <!-- nothing left to do -->
1384 <xsl:call-template name="GetTypeDisplayName">
1385 <xsl:with-param name="T" select="$_arglist"/>
1386 <xsl:with-param name="wrt" select="$wrt"/>
1387 </xsl:call-template>
1392 <!-- Transforms the contents of the selected node containing a cref into a hyperlink. -->
1393 <xsl:template match="*|@*" mode="cref">
1394 <xsl:call-template name="makememberlink">
1395 <xsl:with-param name="cref" select="."/>
1396 </xsl:call-template>
1399 <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
1400 <xsl:value-of select="substring-after(., ':')"/></a>
1404 <xsl:template name="membertypeplural">
1405 <xsl:param name="name"/>
1407 <xsl:when test="$name='ExtensionMethod'">Extension Methods</xsl:when>
1408 <xsl:when test="$name='Constructor'">Constructors</xsl:when>
1409 <xsl:when test="$name='Property'">Properties</xsl:when>
1410 <xsl:when test="$name='Method'">Methods</xsl:when>
1411 <xsl:when test="$name='Field'">Fields</xsl:when>
1412 <xsl:when test="$name='Event'">Events</xsl:when>
1413 <xsl:when test="$name='Operator'">Operators</xsl:when>
1414 <xsl:when test="$name='Explicit'">Explicitly Implemented Interface Members</xsl:when>
1417 <xsl:template name="membertypeplurallc">
1418 <xsl:param name="name"/>
1420 <xsl:when test="$name='ExtensionMethod'">extension methods</xsl:when>
1421 <xsl:when test="$name='Constructor'">constructors</xsl:when>
1422 <xsl:when test="$name='Property'">properties</xsl:when>
1423 <xsl:when test="$name='Method'">methods</xsl:when>
1424 <xsl:when test="$name='Field'">fields</xsl:when>
1425 <xsl:when test="$name='Event'">events</xsl:when>
1426 <xsl:when test="$name='Operator'">operators</xsl:when>
1427 <xsl:when test="$name='Explicit'">explicitly implemented interface members</xsl:when>
1430 <xsl:template name="gettypetype">
1431 <xsl:variable name="sig" select="concat(' ', TypeSignature[@Language='C#']/@Value, ' ')"/>
1433 <xsl:when test="contains($sig,'class')">Class</xsl:when>
1434 <xsl:when test="contains($sig,'enum')">Enumeration</xsl:when>
1435 <xsl:when test="contains($sig,'struct')">Structure</xsl:when>
1436 <xsl:when test="contains($sig,'delegate')">Delegate</xsl:when>
1440 <!-- Ensures that the resuting node is not surrounded by a para tag. -->
1441 <xsl:template match="*|@*" mode="editlink">
1442 <xsl:call-template name="CreateEditLink">
1443 <xsl:with-param name="e" select="." />
1444 </xsl:call-template>
1447 <xsl:template match="*" mode="notoppara">
1449 <xsl:when test="starts-with (string(.), 'To be added')">
1450 <span class="NotEntered">Documentation for this section has not yet been entered.</span>
1452 <xsl:when test="count(*) = 1 and count(para)=1">
1453 <xsl:apply-templates select="para/node()"/>
1456 <xsl:apply-templates select="."/>
1461 <xsl:template match="para">
1463 <xsl:apply-templates/>
1467 <xsl:template match="paramref">
1468 <i><xsl:value-of select="@name"/>
1469 <xsl:apply-templates/>
1473 <xsl:template match="typeparamref">
1474 <i><xsl:value-of select="@name"/>
1475 <xsl:apply-templates/>
1479 <xsl:template match="block[@type='note']">
1482 <xsl:apply-templates/>
1485 <xsl:template match="block[@type='behaviors']">
1486 <h5 class="Subsection">Operation</h5>
1487 <xsl:apply-templates/>
1489 <xsl:template match="block[@type='overrides']">
1490 <h5 class="Subsection">Note to Inheritors</h5>
1491 <xsl:apply-templates/>
1493 <xsl:template match="block[@type='usage']">
1494 <h5 class="Subsection">Usage</h5>
1495 <xsl:apply-templates/>
1498 <xsl:template match="c">
1500 <xsl:apply-templates/>
1503 <xsl:template match="c//para">
1504 <xsl:apply-templates/><br/>
1507 <xsl:template match="code">
1508 <xsl:call-template name="CreateCodeBlock">
1509 <xsl:with-param name="language" select="@lang" />
1510 <xsl:with-param name="content" select="string(descendant-or-self::text())" />
1511 </xsl:call-template>
1513 <xsl:template match="img">
1515 <img src="source-id:{$source-id}:{@href}">
1516 <xsl:attribute name="class">
1518 <xsl:when test="count(@class)>0">
1519 <xsl:value-of select="@class" />
1521 <xsl:otherwise>picture</xsl:otherwise>
1528 <xsl:template match="onequarter">¼</xsl:template>
1529 <xsl:template match="pi">Ï€</xsl:template>
1530 <xsl:template match="theta">θ</xsl:template>
1531 <xsl:template match="leq">≤</xsl:template>
1532 <xsl:template match="geq">≥</xsl:template>
1533 <xsl:template match="subscript">
1534 <sub><xsl:value-of select="@term"/></sub>
1536 <xsl:template match="superscript">
1537 <sup><xsl:value-of select="@term"/></sup>
1545 <term>First Col Header</term>
1546 <description>Second Col Header</description>
1547 <description>Third Col Header</description>
1550 <term>First Row First Col</term>
1551 <description>First Row Second Col</description>
1552 <description>First Row Third Col</description>
1555 <term>Second Row First Col</term>
1556 <description>Second Row Second Col</description>
1557 <description>Second Row Third Col</description>
1562 <xsl:template match="list[@type='table']">
1563 <xsl:call-template name="CreateListTable">
1564 <xsl:with-param name="header">
1565 <th><xsl:apply-templates select="listheader/term" mode="notoppara"/></th>
1566 <xsl:for-each select="listheader/description">
1567 <th><xsl:apply-templates mode="notoppara"/></th>
1571 <xsl:with-param name="content">
1572 <xsl:for-each select="item">
1575 <xsl:apply-templates select="term" mode="notoppara"/>
1577 <xsl:for-each select="description">
1579 <xsl:apply-templates mode="notoppara"/>
1585 </xsl:call-template>
1588 <xsl:template match="list[@type='bullet']">
1590 <xsl:for-each select="item">
1592 <xsl:apply-templates select="term" mode="notoppara"/>
1597 <xsl:template match="list[@type='number']">
1599 <xsl:for-each select="item">
1601 <xsl:apply-templates select="term" mode="notoppara"/>
1607 <xsl:template match="list">
1608 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1611 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1615 <xsl:template match="see[@cref]">
1617 <xsl:when test="not(substring-after(@cref, 'T:')='')">
1618 <xsl:call-template name="maketypelink">
1619 <xsl:with-param name="type" select="normalize-space (@cref)"/>
1620 </xsl:call-template>
1622 <xsl:when test="not(substring-after(@cref, 'N:')='')">
1623 <xsl:call-template name="makenamespacelink">
1624 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1625 </xsl:call-template>
1628 <xsl:call-template name="makememberlink">
1629 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1630 </xsl:call-template>
1635 <xsl:template match="see[@langword]">
1636 <tt><xsl:value-of select="@langword"/></tt>
1639 <xsl:template name="GetInheritedMembers">
1640 <xsl:param name="declaringtype"/>
1641 <xsl:param name="generictypereplacements"/>
1642 <xsl:param name="listmembertype"/>
1643 <xsl:param name="showprotected"/>
1644 <xsl:param name="overloads-mode" select="false()" />
1645 <xsl:param name="showstatic" select='1'/>
1648 <xsl:when test="$listmembertype='ExtensionMethod' and $showprotected=false()">
1649 <xsl:for-each select="$declaringtype/Members/Member[MemberType=$listmembertype]">
1650 <Members Name="Link/@Type" FullName="Link/@Type">
1651 <Member MemberName="{@MemberName}">
1652 <xsl:attribute name="ExplicitMemberName">
1653 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1654 <xsl:with-param name="m" select="@MemberName" />
1655 </xsl:call-template>
1657 <xsl:attribute name="TypeParameters">
1658 <xsl:call-template name="GetTypeParameterNames">
1659 <xsl:with-param name="member" select="." />
1660 </xsl:call-template>
1662 <xsl:attribute name="Parameters">
1663 <xsl:call-template name="GetParameterTypes">
1664 <xsl:with-param name="member" select="." />
1665 </xsl:call-template>
1667 <xsl:copy-of select="./*" />
1673 <Members Name="{$declaringtype/@Name}" FullName="{$declaringtype/@FullName}">
1675 <xsl:copy-of select="$generictypereplacements"/>
1677 <!-- Get all members in this type that are of listmembertype and are either
1678 protected or not protected according to showprotected. -->
1680 <xsl:when test="$listmembertype = 'Explicit'">
1681 <xsl:for-each select="$declaringtype/Members/Member
1682 [MemberType != 'Constructor']
1683 [contains (@MemberName, '.')]">
1684 <Member MemberName="{@MemberName}">
1685 <xsl:attribute name="ExplicitMemberName">
1686 <xsl:call-template name="GetMemberName">
1687 <xsl:with-param name="type" select="@MemberName" />
1688 <xsl:with-param name="isproperty" select="$listmembertype = 'Property'"/>
1689 </xsl:call-template>
1691 <xsl:attribute name="TypeParameters">
1692 <xsl:call-template name="GetTypeParameterNames">
1693 <xsl:with-param name="member" select="." />
1694 </xsl:call-template>
1696 <xsl:attribute name="Parameters">
1697 <xsl:call-template name="GetParameterTypes">
1698 <xsl:with-param name="member" select="." />
1699 </xsl:call-template>
1701 <xsl:copy-of select="./*" />
1706 <xsl:for-each select="$declaringtype/Members/Member
1707 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1708 [(not($overloads-mode) or @MemberName=$index or
1709 ($index='Conversion' and (@MemberName='op_Implicit' or @MemberName='op_Explicit'))) ]
1710 [$showprotected=starts-with(MemberSignature[@Language='C#']/@Value, 'protected ')]
1711 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1712 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1713 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1714 [$showstatic or not(contains(MemberSignature[@Language='C#']/@Value,' static '))]
1715 [$listmembertype = 'Constructor' or not(contains(@MemberName, '.'))]
1717 <Member MemberName="{@MemberName}">
1718 <xsl:attribute name="ExplicitMemberName">
1719 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1720 <xsl:with-param name="m" select="@MemberName" />
1721 </xsl:call-template>
1723 <xsl:attribute name="TypeParameters">
1724 <xsl:call-template name="GetTypeParameterNames">
1725 <xsl:with-param name="member" select="." />
1726 </xsl:call-template>
1728 <xsl:attribute name="Parameters">
1729 <xsl:call-template name="GetParameterTypes">
1730 <xsl:with-param name="member" select="." />
1731 </xsl:call-template>
1733 <xsl:copy-of select="./*" />
1740 <xsl:copy-of select="$declaringtype/Docs/typeparam" />
1747 <xsl:if test="not($listmembertype='Constructor') and count($declaringtype/Base/BaseTypeName)=1">
1748 <xsl:variable name="basedocsfile">
1749 <xsl:call-template name="GetLinkTarget">
1750 <xsl:with-param name="type">
1751 <xsl:call-template name="GetEscapedTypeName">
1752 <xsl:with-param name="typename" select="$declaringtype/Base/BaseTypeName" />
1753 </xsl:call-template>
1755 <xsl:with-param name="cref">
1757 <xsl:with-param name="local-suffix" />
1758 <xsl:with-param name="remote"/>
1759 <xsl:with-param name="xmltarget" select='1'/>
1760 </xsl:call-template>
1763 <xsl:if test="not(string($basedocsfile) = '')">
1764 <xsl:call-template name="GetInheritedMembers">
1765 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1766 <xsl:with-param name="showprotected" select="$showprotected"/>
1767 <xsl:with-param name="declaringtype" select="document(string($basedocsfile),.)/Type"/>
1768 <xsl:with-param name="generictypereplacements" select="$declaringtype/Base/BaseTypeArguments/*"/>
1769 <xsl:with-param name="showstatic" select='0'/>
1770 </xsl:call-template>
1775 <xsl:template name="GetMemberNameWithoutGenericTypes">
1776 <xsl:param name="m" />
1778 <xsl:when test="contains ($m, '<')">
1779 <xsl:value-of select="substring-before ($m, '<')" />
1782 <xsl:value-of select="$m" />
1787 <xsl:template name="GetTypeParameterNames">
1788 <xsl:param name="member" />
1790 <xsl:for-each select="$member/TypeParameters/TypeParameter">
1791 <xsl:if test="not(position()=1)">, </xsl:if>
1792 <xsl:value-of select="@Name" />
1796 <xsl:template name="GetParameterTypes">
1797 <xsl:param name="member" />
1799 <xsl:for-each select="$member/Parameters/Parameter">
1800 <xsl:if test="not(position()=1)">, </xsl:if>
1801 <xsl:value-of select="@Type" />
1805 <xsl:template name="ListAllMembers">
1806 <xsl:param name="html-anchor" select="false()" />
1808 <xsl:call-template name="ListMembers">
1809 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1810 <xsl:with-param name="showprotected" select="false()"/>
1811 <xsl:with-param name="html-anchor" select="$html-anchor" />
1812 </xsl:call-template>
1814 <xsl:call-template name="ListMembers">
1815 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1816 <xsl:with-param name="showprotected" select="true()"/>
1817 <xsl:with-param name="html-anchor" select="$html-anchor" />
1818 </xsl:call-template>
1820 <xsl:call-template name="ListMembers">
1821 <xsl:with-param name="listmembertype" select="'Field'"/>
1822 <xsl:with-param name="showprotected" select="false()"/>
1823 <xsl:with-param name="html-anchor" select="$html-anchor" />
1824 </xsl:call-template>
1826 <xsl:call-template name="ListMembers">
1827 <xsl:with-param name="listmembertype" select="'Field'"/>
1828 <xsl:with-param name="showprotected" select="true()"/>
1829 <xsl:with-param name="html-anchor" select="$html-anchor" />
1830 </xsl:call-template>
1832 <xsl:call-template name="ListMembers">
1833 <xsl:with-param name="listmembertype" select="'Property'"/>
1834 <xsl:with-param name="showprotected" select="false()"/>
1835 <xsl:with-param name="html-anchor" select="$html-anchor" />
1836 </xsl:call-template>
1838 <xsl:call-template name="ListMembers">
1839 <xsl:with-param name="listmembertype" select="'Property'"/>
1840 <xsl:with-param name="showprotected" select="true()"/>
1841 <xsl:with-param name="html-anchor" select="$html-anchor" />
1842 </xsl:call-template>
1844 <xsl:call-template name="ListMembers">
1845 <xsl:with-param name="listmembertype" select="'Method'"/>
1846 <xsl:with-param name="showprotected" select="false()"/>
1847 <xsl:with-param name="html-anchor" select="$html-anchor" />
1848 </xsl:call-template>
1850 <xsl:call-template name="ListMembers">
1851 <xsl:with-param name="listmembertype" select="'Method'"/>
1852 <xsl:with-param name="showprotected" select="true()"/>
1853 <xsl:with-param name="html-anchor" select="$html-anchor" />
1854 </xsl:call-template>
1856 <xsl:call-template name="ListMembers">
1857 <xsl:with-param name="listmembertype" select="'Event'"/>
1858 <xsl:with-param name="showprotected" select="false()"/>
1859 <xsl:with-param name="html-anchor" select="$html-anchor" />
1860 </xsl:call-template>
1862 <xsl:call-template name="ListMembers">
1863 <xsl:with-param name="listmembertype" select="'Event'"/>
1864 <xsl:with-param name="showprotected" select="true()"/>
1865 <xsl:with-param name="html-anchor" select="$html-anchor" />
1866 </xsl:call-template>
1868 <xsl:call-template name="ListMembers">
1869 <xsl:with-param name="listmembertype" select="'Operator'"/>
1870 <xsl:with-param name="showprotected" select="false()"/>
1871 <xsl:with-param name="html-anchor" select="$html-anchor" />
1872 </xsl:call-template>
1874 <xsl:call-template name="ListMembers">
1875 <xsl:with-param name="listmembertype" select="'Explicit'"/>
1876 <xsl:with-param name="showprotected" select="true()"/>
1877 <xsl:with-param name="html-anchor" select="$html-anchor" />
1878 </xsl:call-template>
1880 <xsl:call-template name="ListMembers">
1881 <xsl:with-param name="listmembertype" select="'ExtensionMethod'"/>
1882 <xsl:with-param name="showprotected" select="false()"/>
1883 <xsl:with-param name="html-anchor" select="$html-anchor" />
1884 </xsl:call-template>
1887 <!-- Lists the members in the current Type node.
1888 Only lists members of type listmembertype.
1889 Displays the signature in siglanguage.
1890 showprotected = true() or false()
1892 <xsl:template name="ListMembers">
1893 <xsl:param name="listmembertype"/>
1894 <xsl:param name="showprotected"/>
1895 <xsl:param name="overloads-mode" select="false()" />
1896 <xsl:param name="html-anchor" select="false()" />
1898 <!-- get name and namespace of current type -->
1899 <xsl:variable name="TypeFullName" select="@FullName"/>
1900 <xsl:variable name="TypeName" select="@Name"/>
1901 <xsl:variable name="TypeNamespace" select="substring-before(@FullName, concat('.',@Name))"/>
1903 <xsl:variable name="MEMBERS-rtf">
1904 <xsl:call-template name="GetInheritedMembers">
1905 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1906 <xsl:with-param name="showprotected" select="$showprotected"/>
1907 <xsl:with-param name="declaringtype" select="."/>
1908 <xsl:with-param name="overloads-mode" select="$overloads-mode" />
1909 </xsl:call-template>
1911 <xsl:variable name="MEMBERS" select="msxsl:node-set($MEMBERS-rtf)" />
1914 <xsl:variable name="MEMBERS" select="
1916 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1917 [$showprotected=contains(MemberSignature[@Language='C#']/@Value,'protected')]
1918 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1919 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1920 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1924 <!-- if there aren't any, skip this -->
1925 <xsl:if test="count($MEMBERS//Member)">
1927 <xsl:variable name="SectionName">
1928 <xsl:if test="$listmembertype != 'Explicit' and $listmembertype != 'ExtensionMethod'">
1929 <xsl:if test="$showprotected">Protected </xsl:if>
1930 <xsl:if test="not($showprotected)">Public </xsl:if>
1932 <xsl:call-template name="membertypeplural"><xsl:with-param name="name" select="$listmembertype"/></xsl:call-template>
1936 <xsl:call-template name="CreateH2Section">
1937 <xsl:with-param name="name" select="$SectionName" />
1938 <xsl:with-param name="child-id" select="$SectionName" />
1939 <xsl:with-param name="content">
1940 <div class="SubsectionBox">
1941 <xsl:call-template name="CreateMembersTable">
1942 <xsl:with-param name="content">
1944 <xsl:for-each select="$MEMBERS/Members/Member">
1945 <!--<xsl:sort select="contains(MemberSignature[@Language='C#']/@Value,' static ')" data-type="text"/>-->
1946 <xsl:sort select="@MemberName = 'op_Implicit' or @MemberName = 'op_Explicit'"/>
1947 <xsl:sort select="@ExplicitMemberName" data-type="text"/>
1948 <xsl:sort select="count(TypeParameters/TypeParameter)"/>
1949 <xsl:sort select="@TypeParameters"/>
1950 <xsl:sort select="count(Parameters/Parameter)"/>
1951 <xsl:sort select="@Parameters"/>
1953 <xsl:variable name="local-id">
1955 <xsl:when test="count(Link) = 1">
1956 <xsl:value-of select="Link/@Member" />
1959 <xsl:call-template name="GetLinkId" >
1960 <xsl:with-param name="type" select="parent::Members" />
1961 <xsl:with-param name="member" select="." />
1962 </xsl:call-template>
1967 <xsl:variable name="linkfile">
1968 <xsl:if test="not(parent::Members/@FullName = $TypeFullName)">
1969 <xsl:call-template name="GetLinkTargetHtml">
1970 <xsl:with-param name="type">
1972 <xsl:when test="count(Link) = 1">
1973 <xsl:value-of select="Link/@Type"/>
1976 <xsl:call-template name="GetEscapedTypeName">
1977 <xsl:with-param name="typename" select="parent::Members/@FullName" />
1978 </xsl:call-template>
1982 <xsl:with-param name="cref" />
1983 </xsl:call-template>
1987 <xsl:variable name="linkid">
1988 <xsl:if test="$html-anchor">
1989 <xsl:value-of select="$linkfile" />
1990 <xsl:text>#</xsl:text>
1992 <xsl:value-of select="$local-id" />
1995 <xsl:variable name="isinherited">
1996 <xsl:if test="$listmembertype != 'ExtensionMethod' and not(parent::Members/@FullName = $TypeFullName)">
1997 <xsl:text> (</xsl:text>
1999 <xsl:text>Inherited from </xsl:text>
2000 <xsl:call-template name="maketypelink">
2001 <xsl:with-param name="type" select="parent::Members/@FullName"/>
2002 <xsl:with-param name="wrt" select="$TypeNamespace"/>
2003 </xsl:call-template>
2004 <xsl:text>.</xsl:text>
2006 <xsl:text>)</xsl:text>
2012 <!-- random info -->
2014 <!-- check if it has get and set accessors -->
2015 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'set;'))">
2016 <xsl:text>[read-only]</xsl:text>
2018 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'get;'))">
2019 <xsl:text>[write-only]</xsl:text>
2022 <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
2023 <div><i>default property</i></div>
2027 <xsl:call-template name="getmodifiers">
2028 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
2029 <xsl:with-param name="protection" select="false()"/>
2030 <xsl:with-param name="inheritance" select="true()"/>
2031 <xsl:with-param name="extra" select="false()"/>
2032 </xsl:call-template>
2037 <!-- constructor listing -->
2038 <xsl:when test="MemberType='Constructor'">
2039 <!-- link to constructor page -->
2043 <a href="{$linkid}">
2044 <xsl:call-template name="GetConstructorName">
2045 <xsl:with-param name="type" select="parent::Members" />
2046 <xsl:with-param name="ctor" select="." />
2047 </xsl:call-template>
2051 <!-- argument list -->
2052 <xsl:value-of select="'('"/>
2053 <xsl:for-each select="Parameters/Parameter">
2054 <xsl:if test="not(position()=1)">, </xsl:if>
2056 <xsl:call-template name="ShowParameter">
2057 <xsl:with-param name="Param" select="."/>
2058 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2059 <xsl:with-param name="prototype" select="true()"/>
2060 </xsl:call-template>
2062 <xsl:value-of select="')'"/>
2065 <!-- TODO: $implemented? -->
2070 <xsl:when test="$listmembertype = 'Explicit'">
2072 <a href="{$linkid}">
2074 <xsl:call-template name="GetMemberDisplayName">
2075 <xsl:with-param name="memberName" select="@MemberName" />
2076 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2077 </xsl:call-template>
2083 <!-- field, property and event listing -->
2084 <xsl:when test="MemberType='Field' or MemberType='Property' or MemberType='Event'">
2087 <!-- link to member page -->
2089 <a href="{$linkid}">
2090 <xsl:call-template name="GetMemberDisplayName">
2091 <xsl:with-param name="memberName" select="@MemberName" />
2092 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2093 </xsl:call-template>
2097 <!-- argument list for accessors -->
2098 <xsl:if test="Parameters/Parameter">
2099 <xsl:value-of select="'('"/>
2100 <xsl:for-each select="Parameters/Parameter">
2101 <xsl:if test="not(position()=1)">, </xsl:if>
2103 <xsl:call-template name="ShowParameter">
2104 <xsl:with-param name="Param" select="."/>
2105 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2106 <xsl:with-param name="prototype" select="true()"/>
2107 </xsl:call-template>
2110 <xsl:value-of select="')'"/>
2116 <!-- method listing -->
2117 <xsl:when test="$listmembertype='Method' or $listmembertype = 'ExtensionMethod'">
2120 <!-- link to method page -->
2122 <a href="{$linkid}">
2123 <xsl:call-template name="GetMemberDisplayName">
2124 <xsl:with-param name="memberName" select="@MemberName" />
2125 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2126 </xsl:call-template>
2130 <!-- argument list -->
2131 <xsl:value-of select="'('"/>
2132 <xsl:for-each select="Parameters/Parameter">
2133 <xsl:if test="not(position()=1)">, </xsl:if>
2135 <xsl:call-template name="ShowParameter">
2136 <xsl:with-param name="Param" select="."/>
2137 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2138 <xsl:with-param name="prototype" select="true()"/>
2139 </xsl:call-template>
2142 <xsl:value-of select="')'"/>
2144 <!-- return type -->
2145 <xsl:if test="not(ReturnValue/ReturnType='System.Void')">
2147 <xsl:text> : </xsl:text>
2148 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
2153 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2154 <xsl:copy-of select="$isinherited"/>
2159 <xsl:when test="$listmembertype='Operator'">
2162 <!-- link to operator page -->
2164 <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
2166 <a href="{$linkid}">
2167 <xsl:text>Conversion</xsl:text>
2169 <xsl:when test="ReturnValue/ReturnType = //Type/@FullName">
2170 <xsl:text> From </xsl:text>
2171 <xsl:value-of select="Parameters/Parameter/@Type"/>
2174 <xsl:text> to </xsl:text>
2175 <xsl:value-of select="ReturnValue/ReturnType"/>
2182 <xsl:when test="@MemberName='op_Implicit'">
2183 <xsl:text>(Implicit)</xsl:text>
2186 <xsl:text>(Explicit)</xsl:text>
2190 <xsl:when test="count(Parameters/Parameter)=1">
2192 <a href="{$linkid}">
2193 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2199 <a href="{$linkid}">
2200 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2203 <xsl:value-of select="'('"/>
2204 <xsl:for-each select="Parameters/Parameter">
2205 <xsl:if test="not(position()=1)">, </xsl:if>
2207 <xsl:call-template name="ShowParameter">
2208 <xsl:with-param name="Param" select="."/>
2209 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2210 <xsl:with-param name="prototype" select="true()"/>
2211 </xsl:call-template>
2214 <xsl:value-of select="')'"/>
2221 <!-- Other types: just provide a link -->
2223 <a href="{$linkid}">
2224 <xsl:call-template name="GetMemberDisplayName">
2225 <xsl:with-param name="memberName" select="@MemberName" />
2226 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2227 </xsl:call-template>
2233 <xsl:if test="$listmembertype != 'Method' and $listmembertype != 'ExtensionMethod'">
2235 <!-- description -->
2236 <xsl:if test="MemberType='Field' or MemberType = 'Property'">
2237 <i><xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates></i>
2238 <xsl:if test="MemberValue"> (<xsl:value-of select="MemberValue"/>)</xsl:if>
2239 <xsl:text>. </xsl:text>
2242 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2243 <xsl:copy-of select="$isinherited"/>
2251 </xsl:call-template>
2254 </xsl:call-template>
2260 <xsl:template name="GetLinkName">
2261 <xsl:param name="type"/>
2262 <xsl:param name="member"/>
2263 <xsl:call-template name="memberlinkprefix">
2264 <xsl:with-param name="member" select="$member"/>
2265 </xsl:call-template>
2266 <xsl:text>:</xsl:text>
2267 <xsl:call-template name="GetEscapedTypeName">
2268 <xsl:with-param name="typename" select="$type/@FullName" />
2269 </xsl:call-template>
2270 <xsl:if test="$member/MemberType != 'Constructor'">
2271 <xsl:text>.</xsl:text>
2272 <xsl:variable name="memberName">
2273 <xsl:call-template name="GetGenericName">
2274 <xsl:with-param name="membername" select="$member/@MemberName" />
2275 <xsl:with-param name="member" select="$member" />
2276 </xsl:call-template>
2278 <xsl:call-template name="Replace">
2279 <xsl:with-param name="s">
2280 <xsl:call-template name="ToBraces">
2281 <xsl:with-param name="s" select="$memberName" />
2282 </xsl:call-template>
2284 <xsl:with-param name="from">.</xsl:with-param>
2285 <xsl:with-param name="to">#</xsl:with-param>
2286 </xsl:call-template>
2290 <xsl:template name="GetGenericName">
2291 <xsl:param name="membername" />
2292 <xsl:param name="member" />
2293 <xsl:variable name="numgenargs" select="count($member/Docs/typeparam)" />
2295 <xsl:when test="$numgenargs = 0">
2296 <xsl:value-of select="$membername" />
2299 <xsl:if test="contains($membername, '<')">
2300 <xsl:value-of select="substring-before ($membername, '<')" />
2302 <xsl:text>``</xsl:text>
2303 <xsl:value-of select="$numgenargs" />
2308 <xsl:template name="GetEscapedTypeName">
2309 <xsl:param name="typename" />
2310 <xsl:variable name="base" select="substring-before ($typename, '<')" />
2313 <xsl:when test="$base != ''">
2314 <xsl:value-of select="translate ($base, '+', '.')" />
2315 <xsl:text>`</xsl:text>
2316 <xsl:call-template name="GetGenericArgumentCount">
2317 <xsl:with-param name="arglist" select="substring-after ($typename, '<')" />
2318 <xsl:with-param name="count">1</xsl:with-param>
2319 </xsl:call-template>
2321 <xsl:otherwise><xsl:value-of select="translate ($typename, '+', '.')" /></xsl:otherwise>
2325 <xsl:template name="GetGenericArgumentCount">
2326 <xsl:param name="arglist" />
2327 <xsl:param name="count" />
2329 <xsl:variable name="rest-rtf">
2330 <xsl:call-template name="SkipTypeArgument">
2331 <xsl:with-param name="s" select="$arglist" />
2332 </xsl:call-template>
2334 <xsl:variable name="rest" select="string($rest-rtf)" />
2337 <xsl:when test="$arglist != '' and $rest = ''">
2338 <xsl:value-of select="$count" />
2340 <xsl:when test="$arglist = '' and $rest = ''">
2341 <xsl:message terminate="yes">
2342 !WTF? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2345 <xsl:when test="starts-with ($rest, '>')">
2346 <xsl:value-of select="$count" />
2347 <xsl:call-template name="GetEscapedTypeName">
2348 <xsl:with-param name="typename" select="substring-after ($rest, '>')" />
2349 </xsl:call-template>
2351 <xsl:when test="starts-with ($rest, ',')">
2352 <xsl:call-template name="GetGenericArgumentCount">
2353 <xsl:with-param name="arglist" select="substring-after ($rest, ',')" />
2354 <xsl:with-param name="count" select="$count+1" />
2355 </xsl:call-template>
2358 <xsl:message terminate="yes">
2359 !WTF 2? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2365 <xsl:template name="SkipTypeArgument">
2366 <xsl:param name="s" />
2368 <xsl:variable name="p-rtf">
2369 <xsl:call-template name="GetCLtGtPositions">
2370 <xsl:with-param name="s" select="$s" />
2371 </xsl:call-template>
2373 <xsl:variable name="p" select="msxsl:node-set($p-rtf)"/>
2377 Have to select between three `s' patterns:
2378 A,B>: need to return ",B>"
2379 Foo<A,B>>: Need to forward to SkipGenericArgument to eventually return ">"
2380 Foo<A,B>+C>: Need to forward to SkipGenericArgument to eventually return ">"
2382 <xsl:when test="starts-with ($s, '>')">
2383 <xsl:message terminate="yes">
2384 SkipTypeArgument: invalid type substring '<xsl:value-of select="$s" />'
2387 <xsl:when test="$p/Comma/@Length > 0 and
2388 ($p/Lt/@Length = 0 or $p/Comma/@Length < $p/Lt/@Length) and
2389 ($p/Gt/@Length > 0 and $p/Comma/@Length < $p/Gt/@Length)">
2390 <xsl:text>,</xsl:text>
2391 <xsl:value-of select="substring-after ($s, ',')" />
2393 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2394 <xsl:variable name="r">
2395 <xsl:call-template name="SkipGenericArgument">
2396 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2397 </xsl:call-template>
2400 <xsl:when test="starts-with ($r, '>') or starts-with ($r, '+')">
2401 <xsl:value-of select="substring-after ($r, '>')" />
2403 <xsl:when test="starts-with ($r, ',')">
2404 <xsl:value-of select="$r" />
2408 ! WTF3: s=<xsl:value-of select="$s" />; r=<xsl:value-of select="$r" />
2413 <xsl:when test="$p/Gt/@Length > 0">
2414 <xsl:text>></xsl:text>
2415 <xsl:value-of select="substring-after ($s, '>')" />
2417 <xsl:otherwise><xsl:value-of select="$s" /></xsl:otherwise>
2421 <xsl:template name="GetCLtGtPositions">
2422 <xsl:param name="s" />
2424 <xsl:variable name="c" select="substring-before ($s, ',')" />
2425 <xsl:variable name="lt" select="substring-before ($s, '<')" />
2426 <xsl:variable name="gt" select="substring-before ($s, '>')" />
2428 <Comma String="{$c}" Length="{string-length ($c)}" />
2429 <Lt String="{$lt}" Length="{string-length ($lt)}" />
2430 <Gt String="{$gt}" Length="{string-length ($gt)}" />
2434 when given 'Foo<A,Bar<Baz<C,D,E>>>>', returns '>'
2435 when given 'Bar<C>+Nested>', returns '>'
2436 when given 'Foo<A,Bar<Baz<C,D,E>>>,', returns ','
2437 (basically, it matches '<' to '>' and "skips" the intermediate type-name contents.
2439 <xsl:template name="SkipGenericArgument">
2440 <xsl:param name="s" />
2442 <xsl:variable name="p-rtf">
2443 <xsl:call-template name="GetCLtGtPositions">
2444 <xsl:with-param name="s" select="$s" />
2445 </xsl:call-template>
2447 <xsl:variable name="p" select="msxsl:node-set($p-rtf)" />
2450 <xsl:when test="starts-with ($s, '>')">
2451 <xsl:message terminate="yes">
2452 SkipGenericArgument: invalid type substring '<xsl:value-of select="$s" />'
2455 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2456 <!-- within 'Foo<A...'; look for matching '>' -->
2457 <xsl:variable name="r">
2458 <xsl:call-template name="SkipGenericArgument">
2459 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2460 </xsl:call-template>
2462 <xsl:value-of select="substring-after ($r, '>')" />
2464 <xsl:when test="$p/Gt/@Length > 0">
2465 <!--<xsl:value-of select="substring ($s, string-length ($gt)+1)" />-->
2466 <xsl:value-of select="substring-after ($s, '>')" />
2469 <xsl:value-of select="$s" />
2474 <xsl:template name="GetEscapedParameter">
2475 <xsl:param name="orig-parameter-type" />
2476 <xsl:param name="parameter-type" />
2477 <xsl:param name="parameter-types" />
2478 <xsl:param name="escape" />
2479 <xsl:param name="index" />
2482 <xsl:when test="$index > count($parameter-types)">
2483 <xsl:if test="$parameter-type != $orig-parameter-type">
2484 <xsl:value-of select="$parameter-type" />
2488 <xsl:when test="$parameter-types[position() = $index]/@name = $parameter-type">
2489 <xsl:value-of select="concat ($escape, $index - 1)" />
2492 <xsl:variable name="typeparam" select="$parameter-types[position() = $index]/@name" />
2493 <xsl:call-template name="GetEscapedParameter">
2494 <xsl:with-param name="orig-parameter-type" select="$orig-parameter-type" />
2495 <xsl:with-param name="parameter-type">
2496 <xsl:call-template name="Replace">
2497 <xsl:with-param name="s">
2498 <xsl:call-template name="Replace">
2499 <xsl:with-param name="s">
2500 <xsl:call-template name="Replace">
2501 <xsl:with-param name="s">
2502 <xsl:call-template name="Replace">
2503 <xsl:with-param name="s" select="$parameter-type"/>
2504 <xsl:with-param name="from" select="concat('<', $typeparam, '>')" />
2505 <xsl:with-param name="to" select="concat('<', $escape, $index - 1, '>')" />
2506 </xsl:call-template>
2508 <xsl:with-param name="from" select="concat('<', $typeparam, ',')" />
2509 <xsl:with-param name="to" select="concat('<', $escape, $index - 1, ',')" />
2510 </xsl:call-template>
2512 <xsl:with-param name="from" select="concat (',', $typeparam, '>')" />
2513 <xsl:with-param name="to" select="concat(',', $escape, $index - 1, '>')" />
2514 </xsl:call-template>
2516 <xsl:with-param name="from" select="concat (',', $typeparam, ',')" />
2517 <xsl:with-param name="to" select="concat(',', $escape, $index - 1, ',')" />
2518 </xsl:call-template>
2520 <xsl:with-param name="parameter-types" select="$parameter-types" />
2521 <xsl:with-param name="typeparam" select="$typeparam" />
2522 <xsl:with-param name="escape" select="$escape" />
2523 <xsl:with-param name="index" select="$index + 1" />
2524 </xsl:call-template>
2529 <xsl:template name="GetLinkId">
2530 <xsl:param name="type"/>
2531 <xsl:param name="member"/>
2532 <xsl:call-template name="GetLinkName">
2533 <xsl:with-param name="type" select="$type" />
2534 <xsl:with-param name="member" select="$member" />
2535 </xsl:call-template>
2536 <xsl:if test="count($member/Parameters/Parameter) > 0">
2537 <xsl:text>(</xsl:text>
2538 <xsl:for-each select="Parameters/Parameter">
2539 <xsl:if test="not(position()=1)">,</xsl:if>
2540 <xsl:call-template name="GetParameterType">
2541 <xsl:with-param name="type" select="$type" />
2542 <xsl:with-param name="member" select="$member" />
2543 <xsl:with-param name="parameter" select="." />
2544 </xsl:call-template>
2546 <xsl:text>)</xsl:text>
2548 <xsl:if test="$member/@MemberName='op_Implicit' or $member/@MemberName='op_Explicit'">
2549 <xsl:text>~</xsl:text>
2550 <xsl:variable name="parameter-rtf">
2551 <Parameter Type="{$member/ReturnValue/ReturnType}" />
2553 <xsl:call-template name="GetParameterType">
2554 <xsl:with-param name="type" select="$type" />
2555 <xsl:with-param name="member" select="$member" />
2556 <xsl:with-param name="parameter" select="msxsl:node-set($parameter-rtf)/Parameter" />
2557 </xsl:call-template>
2562 - what should be <xsl:value-of select="@Type" /> becomes a nightmare once
2563 - generics enter the picture, since a parameter type could come from the
2564 - type itelf (becoming `N) or from the method (becoming ``N).
2566 <xsl:template name="GetParameterType">
2567 <xsl:param name="type" />
2568 <xsl:param name="member" />
2569 <xsl:param name="parameter" />
2571 <!-- the actual parameter type -->
2572 <xsl:variable name="ptype">
2574 <xsl:when test="contains($parameter/@Type, '[')">
2575 <xsl:value-of select="substring-before ($parameter/@Type, '[')" />
2577 <xsl:when test="contains($parameter/@Type, '&')">
2578 <xsl:value-of select="substring-before ($parameter/@Type, '&')" />
2580 <xsl:when test="contains($parameter/@Type, '*')">
2581 <xsl:value-of select="substring-before ($parameter/@Type, '*')" />
2584 <xsl:value-of select="$parameter/@Type" />
2589 <!-- parameter modifiers -->
2590 <xsl:variable name="pmodifier">
2591 <xsl:call-template name="Replace">
2592 <xsl:with-param name="s" select="substring-after ($parameter/@Type, $ptype)" />
2593 <xsl:with-param name="from">&</xsl:with-param>
2594 <xsl:with-param name="to">@</xsl:with-param>
2595 </xsl:call-template>
2598 <xsl:variable name="gen-type">
2599 <xsl:call-template name="GetEscapedParameter">
2600 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2601 <xsl:with-param name="parameter-type">
2602 <xsl:variable name="nested">
2603 <xsl:call-template name="GetEscapedParameter">
2604 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2605 <xsl:with-param name="parameter-type" select="$ptype" />
2606 <xsl:with-param name="parameter-types" select="$type/Docs/typeparam" />
2607 <xsl:with-param name="escape" select="'`'" />
2608 <xsl:with-param name="index" select="1" />
2609 </xsl:call-template>
2612 <xsl:when test="$nested != ''">
2613 <xsl:value-of select="$nested" />
2616 <xsl:value-of select="$ptype" />
2620 <xsl:with-param name="parameter-types" select="$member/Docs/typeparam" />
2621 <xsl:with-param name="escape" select="'``'" />
2622 <xsl:with-param name="index" select="1" />
2623 </xsl:call-template>
2626 <!-- the actual parameter type -->
2627 <xsl:variable name="parameter-type">
2629 <xsl:when test="$gen-type != ''">
2630 <xsl:value-of select="$gen-type" />
2631 <xsl:value-of select="$pmodifier" />
2634 <xsl:value-of select="concat($ptype, $pmodifier)" />
2639 <!-- s/</{/g; s/>/}/g; so that less escaping is needed. -->
2640 <xsl:call-template name="Replace">
2641 <xsl:with-param name="s">
2642 <xsl:call-template name="Replace">
2643 <xsl:with-param name="s" select="translate ($parameter-type, '+', '.')" />
2644 <xsl:with-param name="from">></xsl:with-param>
2645 <xsl:with-param name="to">}</xsl:with-param>
2646 </xsl:call-template>
2648 <xsl:with-param name="from"><</xsl:with-param>
2649 <xsl:with-param name="to">{</xsl:with-param>
2650 </xsl:call-template>
2653 <xsl:template name="Replace">
2654 <xsl:param name="s" />
2655 <xsl:param name="from" />
2656 <xsl:param name="to" />
2658 <xsl:when test="not(contains($s, $from))">
2659 <xsl:value-of select="$s" />
2662 <xsl:variable name="prefix" select="substring-before($s, $from)"/>
2663 <xsl:variable name="suffix" select="substring-after($s, $from)" />
2664 <xsl:value-of select="$prefix" />
2665 <xsl:value-of select="$to" />
2666 <xsl:call-template name="Replace">
2667 <xsl:with-param name="s" select="$suffix" />
2668 <xsl:with-param name="from" select="$from" />
2669 <xsl:with-param name="to" select="$to" />
2670 </xsl:call-template>
2675 <xsl:template name="getmodifiers">
2676 <xsl:param name="sig"/>
2677 <xsl:param name="protection" select="true()"/>
2678 <xsl:param name="inheritance" select="true()"/>
2679 <xsl:param name="extra" select="true()"/>
2680 <xsl:param name="typetype" select="false()"/>
2682 <xsl:variable name="Sig">
2683 <xsl:text> </xsl:text>
2685 <xsl:when test="contains($sig, '{')">
2686 <xsl:value-of select="substring-before ($sig, '{')" />
2689 <xsl:value-of select="$sig" />
2692 <xsl:text> </xsl:text>
2695 <xsl:if test="$protection">
2696 <xsl:if test="contains($Sig, ' public ')">public </xsl:if>
2697 <xsl:if test="contains($Sig, ' private ')">private </xsl:if>
2698 <xsl:if test="contains($Sig, ' protected ')">protected </xsl:if>
2699 <xsl:if test="contains($Sig, ' internal ')">internal </xsl:if>
2702 <xsl:if test="contains($Sig, ' static ')">static </xsl:if>
2703 <xsl:if test="contains($Sig, ' abstract ')">abstract </xsl:if>
2704 <xsl:if test="contains($Sig, ' operator ')">operator </xsl:if>
2706 <xsl:if test="contains($Sig, ' const ')">const </xsl:if>
2707 <xsl:if test="contains($Sig, ' readonly ')">readonly </xsl:if>
2709 <xsl:if test="$inheritance">
2710 <xsl:if test="contains($Sig, ' override ')">override </xsl:if>
2711 <xsl:if test="contains($Sig, ' new ')">new </xsl:if>
2714 <xsl:if test="$extra">
2715 <xsl:if test="contains($Sig, ' sealed ')">sealed </xsl:if>
2716 <xsl:if test="contains($Sig, ' virtual ')">virtual </xsl:if>
2718 <xsl:if test="contains($Sig, ' extern ')">extern </xsl:if>
2719 <xsl:if test="contains($Sig, ' checked ')">checked </xsl:if>
2720 <xsl:if test="contains($Sig, ' unsafe ')">unsafe </xsl:if>
2721 <xsl:if test="contains($Sig, ' volatile ')">volatile </xsl:if>
2722 <xsl:if test="contains($Sig, ' explicit ')">explicit </xsl:if>
2723 <xsl:if test="contains($Sig, ' implicit ')">implicit </xsl:if>
2726 <xsl:if test="$typetype">
2727 <xsl:if test="contains($Sig, ' class ')">class </xsl:if>
2728 <xsl:if test="contains($Sig, ' interface ')">interface </xsl:if>
2729 <xsl:if test="contains($Sig, ' struct ')">struct </xsl:if>
2730 <xsl:if test="contains($Sig, ' delegate ')">delegate </xsl:if>
2731 <xsl:if test="contains($Sig, ' enum ')">enum </xsl:if>
2735 <xsl:template name="GetTypeDescription">
2736 <xsl:variable name="sig" select="TypeSignature[@Language='C#']/@Value"/>
2738 <xsl:when test="contains($sig, ' class ')">Class</xsl:when>
2739 <xsl:when test="contains($sig, ' interface ')">Interface</xsl:when>
2740 <xsl:when test="contains($sig, ' struct ')">Struct</xsl:when>
2741 <xsl:when test="contains($sig, ' delegate ')">Delegate</xsl:when>
2742 <xsl:when test="contains($sig, ' enum ')">Enum</xsl:when>
2746 <xsl:template match="since">
2748 <i>Note: This namespace, class, or member is supported only in version <xsl:value-of select="@version" />
2753 <xsl:template name="GetLinkTargetHtml">
2754 <xsl:param name="type" />
2755 <xsl:param name="cref" />
2757 <xsl:variable name="href">
2758 <xsl:call-template name="GetLinkTarget">
2759 <xsl:with-param name="type" select="$type" />
2760 <xsl:with-param name="cref" select="$cref" />
2761 </xsl:call-template>
2764 <xsl:when test="string($href) = ''">
2765 <xsl:text>javascript:alert("Documentation not found.")</xsl:text>
2767 <xsl:otherwise><xsl:value-of select="$href" /></xsl:otherwise>