File: export2html.xsl

package info (click to toggle)
libnb-platform18-java 12.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 729,800 kB
  • sloc: java: 5,059,097; xml: 574,432; php: 78,788; javascript: 29,039; ansic: 10,278; sh: 6,386; cpp: 4,612; jsp: 3,643; sql: 1,097; makefile: 540; objc: 288; perl: 277; haskell: 93
file content (574 lines) | stat: -rw-r--r-- 29,169 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<?xml version="1.0" encoding="UTF-8" ?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="jsonhelp.xsl" />
    <xsl:output method="html"/>
    <xsl:param name="date" />
    <xsl:param name="download" select="'true'"/>
    <xsl:param name="maturity" />
    <xsl:param name="version" />
    <xsl:param name="releaseinfo" />
    
    <!-- unique key over all groups of apis -->
    <xsl:key match="//api[@type='export']" name="apiGroups" use="@group" />
    <!-- unique key over all names of apis -->
    <xsl:key match="//api" name="apiNames" use="@name" />
    <xsl:template match="/apis" >
        <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
        <html>
            <head>
                <!-- projects.netbeans.org -->
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                <xsl:element name="title">
                    <xsl:call-template name="apachenetbeanstext" >
                        <xsl:with-param name="maturity">
                            <xsl:value-of select="$maturity"/>
                        </xsl:with-param>
                    </xsl:call-template>
                    <xsl:text>API List</xsl:text>
                </xsl:element>
                <link rel="stylesheet" href="netbeans.css" type="text/css"/>
                <link rel="icon" type="image/png" sizes="32x32" href="//netbeans.apache.org/favicon-32x32.png" /> 
                <link rel="icon" type="image/png" sizes="16x16" href="//netbeans.apache.org/favicon-16x16.png" />
          

            </head>

            <body>

                <center>
                    <xsl:element name="h1">
                        <xsl:call-template name="apachenetbeanstext" >
                            <xsl:with-param name="maturity">
                                <xsl:value-of select="$maturity"/>
                            </xsl:with-param>
                        </xsl:call-template>
                        <xsl:text>API List</xsl:text>
                    </xsl:element>
                    <xsl:element name="h3">
                        <xsl:call-template name="apachenetbeansversion" >
                            <xsl:with-param name="maturity">
                                <xsl:value-of select="$maturity"/>                
                            </xsl:with-param>
                            <xsl:with-param name="version">
                                <xsl:value-of select="$version"/>                
                            </xsl:with-param>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:if test="$date" >
                        <xsl:value-of select="$date" />
                        <p/>
                    </xsl:if>
                </center>

                This document provides a list of <em>NetBeans APIs</em> with a short description
                of what they are used for, and a table describing different types of interfaces
                (see <a href="http://wiki.netbeans.org/API_Design">What is
                    an API?</a> to understand why we list DTDs, file formats, etc.) and with
                a stability category (<span style="background:#ffffff">stable and official</span>,
                <span style="background:#ddcc80">under development</span>,
                <span style="background:#afafaf;text-decoration:line-through">deprecated</span>,
                <span style="background:#e0c0c0">friend or private</span>;
                see <a href="http://wiki.netbeans.org/API_Stability">API
                    stability</a> for more info).
                The aim is to provide as detailed a definition of NetBeans module 
                external interfaces as possible and give other developers a chance to decide
                whether they want to depend on a particular API or not.
                <p/>
                Some of these APIs are part of the 
                <a href="http://platform.netbeans.org/">NetBeans Platform</a>
                (for example lookup,
                loaders, utilities, nodes, explorer, window systems, multiview, etc.), some of them
                are specific to 
                <a href="http://www.netbeans.org/products/ide/index.html">NetBeans IDE</a> 
                (projects, javacore, diff, etc.) and some
                are not included in the release at all and are just provided for download
                (usually via autoupdate). Basically when building an application based on
                <em>NetBeans</em> one is free to choose the set of modules and their APIs 
                to satisfy one's needs.
                <p>
                    This is a list of APIs for 
                    <xsl:call-template name="apachenetbeansversion" >
                        <xsl:with-param name="maturity">
                            <xsl:value-of select="$maturity"/>                
                        </xsl:with-param>
                        <xsl:with-param name="version">
                            <xsl:value-of select="$version"/>                
                        </xsl:with-param>
                    </xsl:call-template>, if you want to see
                    a list of APIs at for a particular version, you may want to go to:
                </p>
                <ul>
                    <xsl:variable name="currentversion" select="document($releaseinfo)/*/@position"/>
                    <xsl:for-each select="document($releaseinfo)//release">
                        <xsl:sort data-type="number" select="@position" order="descending" />
                        <li>
                            <xsl:choose>
                                <xsl:when test="$currentversion = @position">
                                    This is were your are - Javadoc as released for
                                    <xsl:call-template name="apachenetbeansversion" >
                                        <xsl:with-param name="maturity">
                                            <xsl:value-of select="@tlp"/>
                                        </xsl:with-param>
                                        <xsl:with-param name="version">
                                            <xsl:value-of select="@version"/>                
                                        </xsl:with-param>
                                    </xsl:call-template>             
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:element name="a">
                                        <xsl:attribute name="href">
                                            <xsl:value-of select="@apidocurl"/>
                                        </xsl:attribute>
                                        <xsl:attribute name="target">_top</xsl:attribute>
                                        <xsl:value-of select="@version"/>
                                    </xsl:element>                 
                                    - Javadoc as released for 
                                    <xsl:call-template name="apachenetbeansversion" >
                                        <xsl:with-param name="maturity">
                                            <xsl:value-of select="@tlp"/>
                                        </xsl:with-param>
                                        <xsl:with-param name="version">
                                            <xsl:value-of select="@version"/>                
                                        </xsl:with-param>
                                    </xsl:call-template>          
                                </xsl:otherwise>
                            </xsl:choose>
                    
                        </li>
                    </xsl:for-each>
                </ul>
                <p>
                    This is a list of apidocs of NetBeans of Oracle era.
                </p>
                <ul>
                    <li>
                        <a href="http://bits.netbeans.org/8.2/javadoc/" target="_top">8.2</a> - Javadoc as released for NetBeans IDE 8.2</li>
                    <li>
                        <a href="http://bits.netbeans.org/8.1/javadoc/" target="_top">8.1</a> - Javadoc as released for NetBeans IDE 8.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/8.0.1/javadoc/" target="_top">8.0.1</a> - Javadoc as released for NetBeans IDE 8.0.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/8.0/javadoc/" target="_top">8.0</a> - Javadoc as released for NetBeans IDE 8.0</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.4/javadoc/" target="_top">7.4</a> - Javadoc as released for NetBeans IDE 7.4</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.3.1/javadoc/" target="_top">7.3.1</a> - Javadoc as released for NetBeans IDE 7.3.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.3/javadoc/" target="_top">7.3</a> - Javadoc as released for NetBeans IDE 7.3</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.2.1/javadoc/" target="_top">7.2.1</a> - Javadoc as released for NetBeans IDE 7.2.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.2/javadoc/" target="_top">7.2</a> - Javadoc as released for NetBeans IDE 7.2</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.1.2/javadoc/" target="_top">7.1.2</a> - Javadoc as released for NetBeans IDE 7.1.2</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.1.1/javadoc/" target="_top">7.1.1</a> - Javadoc as released for NetBeans IDE 7.1.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.1/javadoc/" target="_top">7.1</a> - Javadoc as released for NetBeans IDE 7.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.0.1/javadoc/" target="_top">7.0.1</a> - Javadoc as released for NetBeans IDE 7.0.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/7.0/javadoc/" target="_top">7.0</a> - Javadoc as released for NetBeans IDE 7.0</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.9.1/javadoc/" target="_top">6.9.1</a> - Javadoc as released for NetBeans IDE 6.9.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.9/javadoc/" target="_top">6.9</a> - Javadoc as released for NetBeans IDE 6.9</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.8/javadoc/" target="_top">6.8</a> - Javadoc as released for NetBeans IDE 6.8</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.7/javadoc/" target="_top">6.7</a> - Javadoc as released for NetBeans IDE 6.7</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.5/javadoc/" target="_top">6.5</a> - Javadoc as released for NetBeans IDE 6.5</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.1/javadoc/" target="_top">6.1</a> - Javadoc as released for NetBeans IDE 6.1</li>
                    <li>
                        <a href="http://bits.netbeans.org/6.0/javadoc/" target="_top">6.0</a> - Javadoc as released for NetBeans IDE 6.0</li>
                    <li>
                        <a href="http://www.netbeans.org/download/5_5_1/javadoc/" target="_top">5.5.1</a> - Javadoc as released for NetBeans IDE 5.5.1</li>
                    <li>
                        <a href="http://www.netbeans.org/download/5_5/javadoc/" target="_top">5.5</a> - Javadoc as released for NetBeans IDE 5.5</li>
                    <li>
                        <a href="http://www.netbeans.org/download/5_0/javadoc/" target="_top">5.0</a> - Javadoc as released for NetBeans IDE 5.0</li>
                </ul>
                <p/>
                To get the API of your module listed here, see the documentation for the 
                Javadoc building
                <a href="http://wiki.netbeans.org/APIDevelopment">infrastructure</a>.
        
                <h4>Additional Sources of Information</h4>
        
                <ul>
                    <li>
                        <a href="apichanges.html">Changes since previous release</a>
                    </li>
                    <li>
                        <a href="usecases.html">How to use certain NetBeans APIs</a>
                    </li>
                    <li>
                        <a href="allclasses-frame.html">Index of all NetBeans API classes</a>
                    </li>
                    <li>
                        <a href="layers.html">Extracted List of Layer APIs</a>
                    </li>
                    <li>
                        <a href="properties.html">Extracted List of Property APIs</a>
                    </li>
                    <li>
                        <a href="branding.html">Extracted List of Branding APIs</a>
                    </li>
                </ul>

                <h4>FAQ and Mailing List</h4>

                <p>Can't find what you're looking for? Try the <a href="https://netbeans.apache.org" target="_top">Apache NetBeans website</a>.</p>

                <hr/>
                <xsl:call-template name="list-modules" />
                <hr/>
                <xsl:apply-templates />
        
            </body>
        </html>
       
    </xsl:template>
    
    <xsl:template name="list-modules">
        <h2>Content</h2>
        <ul>
            <xsl:for-each select="/apis/module" >
                <xsl:sort select="@name" />
                <xsl:choose>
                    <xsl:when test="api" >
                        <li>
                            <span>
                                <xsl:attribute name="style">
                                    <xsl:choose>
                                        <xsl:when test="descendant::api[@category='stable' and @group='java']">background:#ffffff</xsl:when>
                                        <xsl:when test="descendant::api[@category='official' and @group='java']">background:#ffffff</xsl:when>
                                        <xsl:when test="descendant::api[@category='devel' and @group='java']">background:#ddcc80</xsl:when>
                                        <xsl:when test="descendant::api[@category='deprecated' and @group='java']">text-decoration: line-through</xsl:when>
                                        <xsl:otherwise>background:#e0c0c0</xsl:otherwise>
                                    </xsl:choose>
                                </xsl:attribute>
                                <a>
                                    <xsl:attribute name="href">
                                        <xsl:value-of select="substring-before(@target,'/')" />/overview-summary.html</xsl:attribute>
                                    <xsl:attribute name="target">classFrame</xsl:attribute>
                                    <xsl:value-of select="@name"/>
                                </a> -
                                <!-- XXX the following is crap; e.g. messes up descs of Dialogs API, I/O API, ... -->
                                <!-- Should use e.g.:
                                <answer id="arch-what">
                                    <span class="summary">This API does such-and-such.</span>
                                    It also does some other less important stuff.
                                </answer>
                                -->
                                <xsl:comment>Begin of first sentenece</xsl:comment>
                                <xsl:apply-templates mode="first-sentence" select="description" />
                                <xsl:comment>End of first sentenece</xsl:comment>.
                            </span>
                        </li>
                    </xsl:when>
                    <xsl:otherwise>
                        <!-- will be covered later -->
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
            <xsl:for-each select="/apis/module" >
                <xsl:sort select="api" order="descending" />
                <xsl:sort select="@name" />
                <xsl:choose>
                    <xsl:when test="api" >
                        <!-- covered before -->
                    </xsl:when>
                    <xsl:otherwise>
                        <li>
                            <xsl:variable name="where" select="substring-before(@target, '/')"/>
                            <b>
                                <a href="{$where}/overview-summary.html">
                                    <xsl:value-of select="$where"/>
                                </a>
                            </b>
                            - no API description provided
                            (see <a href="http://wiki.netbeans.org/APIDevelopment">how to do it</a>)
                        </li>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
        </ul>
    </xsl:template>

    <xsl:template match="module">
        <xsl:variable name="interfaces" select="descendant::api[@type='export' and generate-id() = generate-id(key('apiNames', @name))]" />
        <xsl:variable name="module.name" select="@name" />
        <xsl:variable name="arch.stylesheet" select="@stylesheet" />
        <xsl:variable name="arch.overviewlink" select="@overviewlink" />
        <xsl:variable name="arch.footer" select="@footer" />
        <xsl:variable name="arch.target" select="@target" />

        <xsl:if test="$interfaces">
            <h3>
                <a name="def-api-{$module.name}">
                    <xsl:value-of select="$module.name"/>
                </a>
            </h3>

                
            <a>
                <xsl:attribute name="href">
                    <xsl:call-template name="filedirapi" >
                        <xsl:with-param name="arch.target" select="$arch.target" />
                    </xsl:call-template>
                    <xsl:text>/index.html</xsl:text>
                </xsl:attribute>
                <xsl:text>javadoc</xsl:text>
            </a>
            <xsl:if test="$download = 'true'"> | <a>
                    <xsl:attribute name="href">
                        <xsl:call-template name="filedirapi" >
                            <xsl:with-param name="arch.target" select="$arch.target" />
                        </xsl:call-template>
                        <xsl:text>.zip</xsl:text>
                    </xsl:attribute>
                    <xsl:text>download</xsl:text>
                </a>
            </xsl:if>
            | <a>
                <xsl:attribute name="href">
                    <xsl:value-of select="$arch.target" />
                </xsl:attribute>
                <xsl:text>architecture</xsl:text>
            </a> 
            <xsl:if test="//module[@name=$module.name]/arch-usecases" >
                | <a>
                    <xsl:attribute name="href">
                        <xsl:text>usecases.html#usecase-</xsl:text>
                        <xsl:value-of select="$module.name" />
                    </xsl:attribute>
                    <xsl:text>usecases</xsl:text>
                </a>
            </xsl:if>
            <p/>

            <div>
                <xsl:apply-templates select="description"/>
            </div>

            <xsl:if test="deploy-dependencies">
                <div>
                    <p>
                        <b>Usage:</b>
                    </p>
                    <xsl:apply-templates select="deploy-dependencies"/>
                </div>
            </xsl:if>

            <p/>
            <table cellpadding="1" cellspacing="0" border="0" class="tablebg" width="100%">
                <tr>
                    <td>
                        <table border="0" cellpadding="3" cellspacing="1" width="100%">
                            <!--                    <tr><td COLSPAN="5" class="tablecbg" ALIGN="CENTER"><font CLASS="titlectable">Do not duplicate any files</font></td></tr> -->
                            <tr class="tablersh">
                                <td align="CENTER" width="30%">
                                    <span class="titlectable">Interface Name</span>
                                </td>
                                <td align="CENTER" width="15%">
                                    <span class="titlectable">Stability Classification</span>
                                </td>
                                <td align="CENTER" >
                                    <span class="titlectable">Specified in What Document?</span>
                                </td>
                            </tr>

                            <xsl:for-each select="$interfaces">
                                <xsl:if test="@group='java'" >
                                    <xsl:call-template name="api" >
                                        <xsl:with-param name="arch.target" select="$arch.target" />
                                    </xsl:call-template>
                                </xsl:if>
                            </xsl:for-each>

                            <xsl:for-each select="//api[generate-id() = generate-id(key('apiGroups', @group))]">
                                <xsl:variable name="grp" select="@group" />
                                <xsl:if test="$grp!='java'" >
                                    <xsl:variable name="apis" select="/apis" />
                                    <xsl:variable name="module" select="$apis/module[@name=$module.name]" />

                                    <xsl:variable name="allOfTheGroup" select="$module/api[@group=$grp]" />
                                    <xsl:if test="$allOfTheGroup">
                                        <tr class="tabler">
                                            <td>Set of <xsl:value-of select="$grp"/> APIs</td>
                                            <td>Individual</td>
                                            <td>
                                                <a href="{$arch.target}#group-{$grp}">table with definitions</a>
                                            </td>
                                        </tr>
                                    </xsl:if>
                                </xsl:if>
                            </xsl:for-each>

                        </table>
                    </td>
                </tr>
            </table>
        </xsl:if>


        <P/>

    </xsl:template>

    <xsl:template name="api">
        <xsl:param name="arch.target" />
        <xsl:variable name="name" select="@name" />
        <xsl:variable name="type" select="@type" />
        <xsl:variable name="category" select="@category" />
        <xsl:variable name="url" select="@url" />
        <xsl:variable name="description" select="node()" />

        <tr class="tabler">
            <td>
                <a>
                    <xsl:attribute name="href" >
                        <xsl:value-of select="$arch.target" />
                        <xsl:text>#java-</xsl:text>
                        <xsl:value-of select="$name"/>
                    </xsl:attribute>
                    <xsl:value-of select="$name" />
                </a>
            </td>
            <!--
            <td>
                <xsl:choose>
                    <xsl:when test="$type='import'">Imported</xsl:when>
                    <xsl:when test="$type='export'">Exported</xsl:when>
                    <xsl:otherwise>WARNING: <xsl:value-of select="$type" /></xsl:otherwise>
                </xsl:choose>
            </td> -->
            <td> <!-- stability category -->
                <a>
                    <xsl:attribute name="href">
                        <xsl:text>http://wiki.netbeans.org/API_Stability#</xsl:text>
                        <xsl:value-of select="$category" />
                    </xsl:attribute>
                    <xsl:choose>
                        <xsl:when test="$category='official'">Official</xsl:when>
                        <xsl:when test="$category='stable'">Stable</xsl:when>
                        <xsl:when test="$category='devel'">Devel</xsl:when>
                        <xsl:when test="$category='third'">Third_Party</xsl:when>
                        <xsl:when test="$category='standard'">Standard</xsl:when>
                        <xsl:when test="$category='friend'">Friend</xsl:when>
                        <xsl:when test="$category='private'">Private</xsl:when>
                        <xsl:when test="$category='deprecated'">Deprecated</xsl:when>
                        <xsl:otherwise>
                            <xsl:message>
                                WARNING: <xsl:value-of select="$category"/>
                            </xsl:message>
                        </xsl:otherwise>
                    </xsl:choose>
                </a>  
            </td>

            <td> <!-- url -->
                <a href="{$url}">
                    <xsl:value-of select="$url"/>
                </a>
                <xsl:if test="$description" >
                    <p>
                        <xsl:apply-templates select="$description" />
                    </p>
                </xsl:if>
            </td>
        </tr>

    </xsl:template>

    <xsl:template match="api-ref">
        <!-- simply bold the name, it link will likely be visible bellow -->
        <b>
            <xsl:value-of select="@name" />
        </b>
    </xsl:template>

    <!-- extracts first part before slash from LoadersAPI/bleble.html -->

    <xsl:template name="filedirapi" >
        <xsl:param name="arch.target" />
    
        <xsl:if test="substring-before($arch.target,'/')">
            <xsl:value-of select="substring-before($arch.target,'/')" />
        </xsl:if>
    </xsl:template>


    <!-- Format random HTML elements as is: -->
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <!-- Gets the first sentence with HTML tags -->
    
    <xsl:template mode="first-sentence" match="api-ref">
        <b>
            <xsl:value-of select="@name" />
        </b>
        <xsl:text> </xsl:text>
    </xsl:template>

    <xsl:template mode="first-sentence" match="node()">
        <xsl:choose>
            <xsl:when test="count(child::*) = 0" >
                <xsl:variable name="first-sentence" select="substring-before(normalize-space(), '. ')" />
                <xsl:variable name="first-dot" select="substring-before(normalize-space(), '.')" />
                <xsl:choose>
                    <xsl:when test="$first-sentence" >
                        <xsl:value-of select="$first-sentence" />
                        <!-- this trick starts comment which disables output produces after 
                        Which means comments out everything after the .
                        -->
                        <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
                    </xsl:when>
                    <xsl:when test="$first-dot" >
                        <xsl:value-of select="$first-dot" />
                        <!-- this trick starts comment which disables output produces after 
                        Which means comments out everything after the .
                        -->
                        <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="." />
                    </xsl:otherwise>
                </xsl:choose>
                <xsl:apply-templates mode="first-sentence" select="child::*"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates mode="first-sentence" select="node()"/>
            </xsl:otherwise>
        </xsl:choose>
        
    </xsl:template>
    
</xsl:stylesheet>