3 Converts the "Microsoft Internal XML Documentation Format" into the
4 "Microsoft XML Documentation Format".
6 The "Microsoft Internal XML Documentation Format" (msidoc) is whatever XML
7 format is used within Microsoft to document the BCL, as deduced from reading
8 their ECMA documentation dump.
10 The "Microsoft XML Documentation Format" (msxdoc) is what 'gmcs /doc'
11 produces, and is documented in ECMA 334 §E.
13 msidoc is similar, but not identical to, msxdoc. For example, where msxdoc
14 uses <see cref="FOO"/>, msidoc uses
15 <codeEntityReference>FOO</codeEntityReference>. They also introduce
16 additional "wrapping" elements in various places (e.g. <content/>), useful
17 extensions (such as documenting method overload lists), and other oddities.
21 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
23 xmlns:authoring="http://ddue.schemas.microsoft.com/authoring/2003/5"
24 exclude-result-prefixes="msxsl authoring"
27 <xsl:output omit-xml-declaration="yes" />
29 <xsl:template match="assembly" />
30 <xsl:template match="authoring:changeHistory" />
31 <xsl:template match="authoring:clsCompliantAlternative" />
32 <xsl:template match="authoring:internalOnly" />
33 <xsl:template match="authoring:notesForCallers" />
34 <xsl:template match="authoring:notesForImplementers" />
35 <xsl:template match="authoring:notesForInheritors" />
36 <xsl:template match="authoring:overload" />
37 <xsl:template match="authoring:relatedTopics" />
39 <xsl:template match="member">
40 <!-- skip Overload: members, as these have no msxdoc equivalent. -->
41 <xsl:if test="not (starts-with (@name, 'Overload:'))">
42 <member name="{@name}">
43 <xsl:apply-templates />
48 <xsl:template match="authoring:remarks">
50 <xsl:apply-templates />
51 <xsl:for-each select="../authoring:notesForInheritors">
52 <block subset="none" type="overrides">
53 <xsl:apply-templates />
56 <xsl:for-each select="../authoring:notesForImplementers">
57 <block subset="none" type="behaviors">
58 <xsl:apply-templates />
61 <xsl:for-each select="../authoring:notesForCallers">
62 <block subset="none" type="usage">
63 <xsl:apply-templates />
69 <xsl:template match="authoring:dduexml" >
70 <xsl:apply-templates />
73 <xsl:template match="authoring:codeEntityReference">
77 <xsl:template match="authoring:equivalentCodeEntity">
78 <seealso cref="{authoring:codeEntityReference}" />
81 <xsl:template match="authoring:codeInline">
83 <xsl:apply-templates />
87 <xsl:template match="authoring:codeReference">
91 <xsl:template match="authoring:parameters">
92 <xsl:apply-templates />
95 <xsl:template match="authoring:parameter">
96 <param name="{authoring:parameterReference}">
97 <xsl:for-each select="*">
98 <xsl:if test="not (position () = 1)">
99 <xsl:apply-templates />
105 <xsl:template match="authoring:genericParameters">
106 <xsl:apply-templates />
109 <xsl:template match="authoring:genericParameter">
110 <typeparam name="{authoring:parameterReference}">
111 <xsl:for-each select="*">
112 <xsl:if test="not (position () = 1)">
113 <xsl:apply-templates />
119 <xsl:template match="authoring:parameterReference">
120 <paramref name="{.}" />
123 <xsl:template match="authoring:returnValue">
125 <xsl:apply-templates />
129 <xsl:template match="authoring:exceptions">
130 <xsl:apply-templates />
133 <xsl:template match="authoring:exception">
134 <exception cref="{authoring:codeEntityReference}">
135 <xsl:apply-templates select="authoring:content" />
139 <xsl:template match="authoring:codeExamples">
140 <xsl:apply-templates />
143 <xsl:template match="authoring:codeExample">
145 <xsl:when test="count(authoring:legacy) > 0">
149 <xsl:apply-templates select="authoring:description/authoring:content" />
150 <xsl:apply-templates select="authoring:codeReference" />
156 <xsl:template match="authoring:content">
157 <xsl:apply-templates />
160 <xsl:template match="authoring:languageKeyword">
161 <see langword="{.}" />
164 <xsl:template match="authoring:table">
166 <xsl:apply-templates />
170 <xsl:template match="authoring:tableHeader">
172 <xsl:for-each select="authoring:row/authoring:entry">
174 <xsl:when test="position() = 1">
176 <xsl:apply-templates />
181 <xsl:apply-templates />
189 <xsl:template match="authoring:row">
191 <xsl:for-each select="authoring:entry">
193 <xsl:when test="position() = 1">
195 <xsl:apply-templates />
200 <xsl:apply-templates />
208 <xsl:template match="authoring:list">
209 <list type="{@class}">
210 <xsl:apply-templates />
214 <xsl:template match="authoring:listItem">
216 <xsl:apply-templates />
220 <xsl:template match="authoring:alert">
221 <block subset="none" type="note">
222 <xsl:apply-templates />
226 <xsl:template match="authoring:permissions">
227 <xsl:apply-templates />
230 <xsl:template match="authoring:permission">
231 <permission cref="{authoring:codeEntityReference}">
232 <xsl:apply-templates select="authoring:content" />
236 <xsl:template match="authoring:threadSafety">
238 <xsl:apply-templates />
242 <xsl:template match="authoring:embeddedLabel">
244 <xsl:value-of select="." />
245 <xsl:text>:</xsl:text>
249 <xsl:template match="authoring:externalLink">
250 <format type="text/html">
251 <a href="{authoring:linkUri}">
252 <xsl:value-of select="authoring:linkText" />
257 <xsl:template match="authoring:legacyLink">
259 <xsl:value-of select="." />
263 <xsl:template match="authoring:token">
265 <xsl:when test=". = 'compact_v20_long'">
266 <xsl:text>.NET Compact Framework version 2.0</xsl:text>
268 <xsl:when test=". = 'compact_v35_long'">
269 <xsl:text>.NET Compact Framework version 3.5</xsl:text>
271 <xsl:when test=". = 'dnprdnext'">
272 <xsl:text>.NET Framework version 2.0</xsl:text>
274 <xsl:when test=". = 'vbprvbext'">
275 <xsl:text>Microsoft Visual Basic 2005</xsl:text>
277 <xsl:when test=". = 'vbprvblong'">
278 <xsl:text>Visual Basic 2005</xsl:text>
281 <xsl:text>UNKNOWN_TOKEN(</xsl:text>
282 <xsl:value-of select="." />
283 <xsl:text>)</xsl:text>
288 <!-- cute trick to remove the xmlns attributes on copied nodes. -->
289 <xsl:template match="*">
290 <xsl:element name="{local-name()}">
291 <xsl:apply-templates />