1<?xml version="1.0"?>
2<!--
3 Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
6 This code is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License version 2 only, as
8 published by the Free Software Foundation.
9
10 This code is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 version 2 for more details (a copy is included in the LICENSE file that
14 accompanied this code).
15
16 You should have received a copy of the GNU General Public License version
17 2 along with this work; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 or visit www.oracle.com if you need additional information or have any
22 questions.
23
24-->
25
26<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
27
28<xsl:import href="jvmtiLib.xsl"/>
29
30<xsl:output method="html" indent="yes"
31  doctype-system="about:legacy-compat"/>
32
33<xsl:param name="development"></xsl:param>
34
35<xsl:template match="specification">
36  <html lang="en">
37  <head>
38        <title>
39          <xsl:value-of select="@label"/>
40          <xsl:text> </xsl:text>
41          <xsl:call-template name="showversion"/>
42        </title>
43        <style>
44          .centered { text-align: center; }
45          .leftAligned { text-align: left; }
46          .rightAligned { text-align: right; }
47          .bgLight { background-color: #EEEEFF; }
48          .bgDark { background-color: #CCCCFF}
49          th { font-weight: normal; text-align: left; }
50          div.sep { height: 10px; }
51          div.callbackCtnr { margin: 0 5%; }
52          hr { border-width:0; color:gray; background-color:gray; }
53          hr.thick { height:3px; }
54          hr.thin { height:1px; }
55          table.bordered, div.bordered { border: 2px solid black; border-spacing: 0; border-collapse: collapse; }
56          table.bordered td, table.bordered th, div.bordered div.divTableHead, div.bordered .divTableCell {
57            padding: 3px;
58            border: 2px solid black;
59          }
60          .wide { width: 100%; }
61          table.bordered caption, divCaption {
62            border: 2px solid black;
63            border-bottom-width: 0;
64          }
65          .captionTitle {
66            background-color: #CCCCFF;
67            font-size: larger;
68            text-align:center;
69            padding: 3px;
70          }
71          .captionDescr {
72            border-top: 2px solid black;
73            padding: 3px;
74            text-align: left;
75          }
76          div.divTable { display: table; }
77          <!-- workaround for <div> with border, display: table & width: 100% -->
78          div.wideDivTableCtnr { padding-right: 2px; }
79          div.divTableRow { display: table-row; }
80          div.divTableHead, div.divTableCell { display: table-cell; vertical-align: middle; }
81          div.divTableHead { font-weight: bold; text-align: center; }
82          table.bordered td.noPadding { padding: 0; }
83          div.withPadding { padding: 3px; }
84          div.topBorder { border-top: 2px solid black; }
85        </style>
86  </head>
87  <body>
88    <header class="centered">
89      <xsl:apply-templates select="title"/>
90    </header>
91    <nav>
92      <ul>
93        <li>
94          <a href="#SpecificationIntro"><b>Introduction</b></a>
95          <ul>
96            <xsl:for-each select="intro">
97              <li>
98                <a>
99                  <xsl:attribute name="href">#<xsl:value-of select="@id"/>
100                  </xsl:attribute>
101                  <b><xsl:value-of select="@label"/></b>
102                </a>
103              </li>
104            </xsl:for-each>
105          </ul>
106        </li>
107        <li>
108          <a href="#FunctionSection"><b>Functions</b></a>
109          <ul>
110            <xsl:for-each select="functionsection/intro">
111              <li>
112                <a>
113                  <xsl:attribute name="href">#<xsl:value-of select="@id"/>
114                  </xsl:attribute>
115                  <b><xsl:value-of select="@label"/></b>
116                </a>
117              </li>
118            </xsl:for-each>
119            <li>
120              <a href="#FunctionIndex"><b>Function Index</b></a>
121              <ul>
122                <xsl:for-each select="functionsection/category">
123                  <li>
124                    <a>
125                      <xsl:attribute name="href">#<xsl:value-of select="@id"/>
126                      </xsl:attribute>
127                      <b><xsl:value-of select="@label"/></b>
128                    </a>
129                  </li>
130                </xsl:for-each>
131              </ul>
132            </li>
133            <li>
134              <a href="#ErrorSection"><b>Error Codes</b></a>
135            </li>
136          </ul>
137        </li>
138        <li>
139          <a href="#EventSection"><b>Events</b></a>
140          <ul>
141            <li>
142              <a href="#EventIndex"><b>Event Index</b></a>
143            </li>
144          </ul>
145        </li>
146        <li>
147          <a href="#DataSection"><b>Data Types</b></a>
148          <ul>
149            <xsl:for-each select="//basetypes">
150            <li>
151              <a>
152                <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
153                <b>
154                  <xsl:value-of select="@label"/>
155                </b>
156              </a>
157            </li>
158            </xsl:for-each>
159            <li>
160              <a href="#StructureTypeDefinitions"><b>Structure Type Definitions</b></a>
161            </li>
162            <li>
163              <a href="#FunctionTypeDefinitions"><b>Function Type Definitions</b></a>
164            </li>
165            <li>
166              <a href="#EnumerationDefinitions"><b>Enumeration Definitions</b></a>
167            </li>
168            <li>
169              <a href="#FunctionTable"><b>Function Table</b></a>
170            </li>
171          </ul>
172        </li>
173        <li>
174          <a href="#ConstantIndex"><b>Constant Index</b></a>
175        </li>
176        <xsl:if test="$development = 'Show'">
177          <li>
178            <a href="#SpecificationIssues"><b>Issues</b></a>
179            <ul>
180              <xsl:for-each select="issuessection/intro">
181                <li>
182                  <a>
183                    <xsl:attribute name="href">#<xsl:value-of select="@id"/>
184                    </xsl:attribute>
185                    <b><xsl:value-of select="@label"/></b>
186                  </a>
187                </li>
188              </xsl:for-each>
189            </ul>
190          </li>
191        </xsl:if>
192        <li>
193          <a href="#ChangeHistory"><b>Change History</b></a>
194        </li>
195      </ul>
196    </nav>
197    <!-- end table of contents, begin body -->
198    <main>
199    <div class="sep"/>
200    <hr class="thick"/>
201    <div class="sep"/>
202    <p id="SpecificationIntro"/>
203      <xsl:apply-templates select="intro"/>
204    <p id="FunctionSection"/>
205      <xsl:apply-templates select="functionsection"/>
206    <p id="ErrorSection"/>
207      <xsl:apply-templates select="errorsection"/>
208    <p id="DataSection"/>
209      <xsl:apply-templates select="datasection"/>
210    <p id="EventSection"/>
211      <xsl:apply-templates select="eventsection"/>
212    <p id="ConstantIndex"/>
213      <div class="sep"/>
214      <hr class="thick"/>
215      <h2>
216        Constant Index
217      </h2>
218      <blockquote>
219        <xsl:apply-templates select="//constant" mode="index">
220          <xsl:sort select="@id"/>
221        </xsl:apply-templates>
222      </blockquote>
223    <xsl:if test="$development = 'Show'">
224      <p id="SpecificationIssues"/>
225      <div class="sep"/>
226      <hr class="thick"/>
227      <h2>
228        <xsl:value-of select="issuessection/@label"/>
229      </h2>
230      <xsl:apply-templates select="issuessection/intro"/>
231    </xsl:if>
232    <p id="ChangeHistory"/>
233      <xsl:apply-templates select="changehistory"/>
234    </main>
235  </body>
236</html>
237</xsl:template>
238
239<xsl:template match="title">
240    <h1>
241      <xsl:apply-templates/>
242    </h1>
243    <h2>
244      <xsl:value-of select="@subtitle"/>
245      <xsl:text> </xsl:text>
246      <xsl:call-template name="showbasicversion"/>
247    </h2>
248</xsl:template>
249
250<xsl:template match="functionsection">
251  <div class="sep"/>
252  <hr class="thick"/>
253  <h2>
254    <xsl:value-of select="@label"/>
255  </h2>
256  <xsl:apply-templates select="intro"/>
257  <h3 id="FunctionIndex">Function Index</h3>
258  <ul>
259    <xsl:apply-templates select="category" mode="index"/>
260  </ul>
261  <xsl:apply-templates select="category" mode="body"/>
262</xsl:template>
263
264<xsl:template match="category" mode="index">
265  <li>
266    <a>
267      <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
268      <b>
269        <xsl:value-of select="@label"/>
270      </b>
271    </a>
272    <ul>
273      <xsl:apply-templates select="function[count(@hide)=0]" mode="index"/>
274    </ul>
275  </li>
276</xsl:template>
277
278<xsl:template match="function|callback" mode="index">
279  <li>
280    <a>
281      <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
282      <xsl:apply-templates select="synopsis" mode="index"/>
283    </a>
284  </li>
285</xsl:template>
286
287<xsl:template match="synopsis" mode="index">
288    <xsl:value-of select="."/>
289</xsl:template>
290
291<xsl:template match="category" mode="body">
292  <p>
293    <xsl:attribute name="id">
294      <xsl:value-of select="@id"/>
295    </xsl:attribute>
296  </p>
297  <hr class="thick"/>
298  <h2 class="centered"><xsl:value-of select="@label"/></h2>
299  <xsl:value-of select="@label"/> functions:
300  <ul>
301    <xsl:apply-templates select="function[count(@hide)=0]" mode="index"/>
302  </ul>
303  <xsl:variable name="calltypes" select="callback"/>
304  <xsl:if test="count($calltypes)!=0">
305    <xsl:value-of select="@label"/> function types:
306    <ul>
307      <xsl:apply-templates select="$calltypes" mode="index"/>
308    </ul>
309  </xsl:if>
310  <xsl:variable name="cattypes"
311    select="(descendant::typedef|descendant::uniontypedef|descendant::capabilitiestypedef|descendant::constants[@kind='enum'])"/>
312  <xsl:if test="count($cattypes)!=0">
313    <xsl:value-of select="@label"/> types:
314    <ul>
315      <xsl:for-each select="$cattypes">
316        <li>
317          <a>
318            <xsl:attribute name="href">
319              <xsl:text>#</xsl:text>
320              <xsl:value-of select="@id"/>
321            </xsl:attribute>
322            <code><xsl:value-of select="@id"/></code>
323          </a>
324          <xsl:text> - </xsl:text>
325          <xsl:value-of select="@label"/>
326        </li>
327      </xsl:for-each>
328    </ul>
329  </xsl:if>
330  <xsl:variable name="catconst"
331    select="(descendant::constants[@kind!='enum'])"/>
332  <xsl:if test="count($catconst)!=0">
333    <xsl:value-of select="@label"/> flags and constants:
334    <ul>
335      <xsl:for-each select="$catconst">
336        <li>
337          <a>
338            <xsl:attribute name="href">
339              <xsl:text>#</xsl:text>
340              <xsl:value-of select="@id"/>
341            </xsl:attribute>
342            <xsl:value-of select="@label"/>
343          </a>
344        </li>
345      </xsl:for-each>
346    </ul>
347  </xsl:if>
348  <xsl:apply-templates select="intro|typedef|uniontypedef|capabilitiestypedef"/>
349  <div class="sep"/>
350  <xsl:apply-templates select="function[count(@hide)=0]|callback" mode="body"/>
351</xsl:template>
352
353<xsl:template match="function" mode="body">
354  <hr class="thin">
355    <xsl:attribute name="id">
356      <xsl:value-of select="@id"/>
357    </xsl:attribute>
358
359  </hr>
360  <xsl:apply-templates select="synopsis" mode="body"/>
361  <blockquote>
362    <xsl:apply-templates select="typedef" mode="code"/>
363    <xsl:apply-templates select="descendant::constants[@kind='enum']" mode="signature"/>
364    <pre>
365      <xsl:text>jvmtiError
366</xsl:text>
367      <xsl:value-of select="@id"/>(jvmtiEnv* env<xsl:apply-templates select="parameters" mode="signature"/>)</pre>
368  </blockquote>
369  <xsl:apply-templates select="description"/>
370  <xsl:apply-templates select="." mode="generalinfo"/>
371  <xsl:apply-templates select="capabilities|eventcapabilities"/>
372  <xsl:apply-templates select="typedef" mode="body"/>
373  <xsl:apply-templates select="parameters" mode="body"/>
374  <xsl:apply-templates select="." mode="errors"/>
375</xsl:template>
376
377<xsl:template match="function" mode="generalinfo">
378  <div class="wideDivTableCtnr">
379  <div class="divTable bordered wide">
380    <div class="divTableRow bgLight">
381      <div class="divTableCell"><a href="#jvmtiPhase">Phase</a></div>
382      <div class="divTableCell"><a href="#heapCallbacks">Callback Safe</a></div>
383      <div class="divTableCell"><a href="#FunctionTable">Position</a></div>
384      <div class="divTableCell"><a href="#ChangeHistory">Since</a></div>
385    </div>
386    <div class="divTableRow">
387      <div class="divTableCell">
388        <xsl:apply-templates select="." mode="phaseinfo"/>
389      </div>
390      <div class="divTableCell">
391        <xsl:apply-templates select="." mode="callbacksafeinfo"/>
392      </div>
393      <div class="divTableCell">
394        <xsl:value-of select="@num"/>
395      </div>
396      <div class="divTableCell">
397        <xsl:value-of select="@since"/>
398      </div>
399    </div>
400  </div>
401  </div>
402</xsl:template>
403
404<xsl:template match="event" mode="generalinfo">
405  <div class="wideDivTableCtnr">
406  <div class="divTable bordered wide">
407    <div class="divTableRow bgLight">
408      <div class="divTableCell"><a href="#jvmtiPhase">Phase</a></div>
409      <div class="divTableCell"><a href="#heapCallbacks">Event Type</a></div>
410      <div class="divTableCell"><a href="#FunctionTable">Number</a></div>
411      <div class="divTableCell"><a href="#FunctionTable">Enabling</a></div>
412      <div class="divTableCell"><a href="#ChangeHistory">Since</a></div>
413    </div>
414    <div class="divTableRow">
415      <div class="divTableCell">
416        <xsl:apply-templates select="." mode="phaseinfo"/>
417      </div>
418      <div class="divTableCell">
419        <code><xsl:value-of select="@const"/></code>
420      </div>
421      <div class="divTableCell">
422        <xsl:value-of select="@num"/>
423      </div>
424      <div class="divTableCell">
425        <code><a href="#SetEventNotificationMode">SetEventNotificationMode</a>(JVMTI_ENABLE,
426        <xsl:value-of select="@const"/>, NULL)</code>
427      </div>
428      <div class="divTableCell">
429        <xsl:value-of select="@since"/>
430      </div>
431    </div>
432  </div>
433  </div>
434</xsl:template>
435
436<xsl:template match="function" mode="phaseinfo">
437  may
438  <xsl:choose>
439    <xsl:when test="count(@phase) = 0 or @phase = 'live'">
440      only be called during the live
441    </xsl:when>
442    <xsl:otherwise>
443      <xsl:choose>
444        <xsl:when test="@phase = 'onload'">
445          only be called during the OnLoad or the live
446        </xsl:when>
447        <xsl:otherwise>
448          <xsl:choose>
449            <xsl:when test="@phase = 'any'">
450              be called during any
451            </xsl:when>
452            <xsl:otherwise>
453              <xsl:choose>
454                <xsl:when test="@phase = 'start'">
455                  only be called during the start or the live
456                </xsl:when>
457                <xsl:otherwise>
458                  <xsl:choose>
459                    <xsl:when test="@phase = 'onloadOnly'">
460                      only be called during the OnLoad
461                    </xsl:when>
462                    <xsl:otherwise>
463                      <xsl:message terminate="yes">
464                        bad phase - <xsl:value-of select="@phase"/>
465                      </xsl:message>
466                    </xsl:otherwise>
467                  </xsl:choose>
468                </xsl:otherwise>
469            </xsl:choose>
470            </xsl:otherwise>
471          </xsl:choose>
472        </xsl:otherwise>
473      </xsl:choose>
474    </xsl:otherwise>
475  </xsl:choose>
476  phase
477</xsl:template>
478
479
480<xsl:template match="event" mode="phaseinfo">
481  sent
482  <xsl:choose>
483    <xsl:when test="count(@phase) = 0 or @phase = 'live'">
484      only during the live
485    </xsl:when>
486    <xsl:otherwise>
487      <xsl:choose>
488        <xsl:when test="@phase = 'any'">
489          during the primordial, start or live
490        </xsl:when>
491        <xsl:otherwise>
492          <xsl:choose>
493            <xsl:when test="@phase = 'start'">
494              during the start or live
495            </xsl:when>
496            <xsl:otherwise>
497              <xsl:message terminate="yes">
498                bad phase - <xsl:value-of select="@phase"/>
499              </xsl:message>
500            </xsl:otherwise>
501          </xsl:choose>
502        </xsl:otherwise>
503      </xsl:choose>
504    </xsl:otherwise>
505  </xsl:choose>
506  phase
507</xsl:template>
508
509
510<xsl:template match="function" mode="callbacksafeinfo">
511  <xsl:choose>
512    <xsl:when test="contains(@callbacksafe,'safe')">
513    This function may be called from the callbacks to the
514    <a href="#Heap">Heap</a> iteration functions, or from the
515    event handlers for the
516    <a href="#GarbageCollectionStart"><code>GarbageCollectionStart</code></a>,
517    <a href="#GarbageCollectionFinish"><code>GarbageCollectionFinish</code></a>,
518    and <a href="#ObjectFree"><code>ObjectFree</code></a> events.
519    </xsl:when>
520    <xsl:otherwise>
521      No
522    </xsl:otherwise>
523  </xsl:choose>
524</xsl:template>
525
526
527<xsl:template match="callback" mode="body">
528  <hr class="thin">
529    <xsl:attribute name="id">
530      <xsl:value-of select="@id"/>
531    </xsl:attribute>
532  </hr>
533  <xsl:apply-templates select="synopsis" mode="body"/>
534  <div class="callbackCtnr">
535  <blockquote>
536    <pre>
537      <xsl:text>typedef </xsl:text>
538      <xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
539      <xsl:text> (JNICALL *</xsl:text>
540      <xsl:value-of select="@id"/>
541      <xsl:text>)
542    (</xsl:text>
543      <xsl:for-each select="parameters">
544        <xsl:apply-templates select="param[position()=1]" mode="signature"/>
545        <xsl:for-each select="param[position()>1]">
546          <xsl:text>,
547     </xsl:text>
548          <xsl:apply-templates select="." mode="signature"/>
549        </xsl:for-each>
550      </xsl:for-each>
551      <xsl:text>);</xsl:text>
552    </pre>
553  </blockquote>
554  <xsl:apply-templates select="description"/>
555  <xsl:apply-templates select="parameters" mode="body"/>
556  </div>
557</xsl:template>
558
559<xsl:template match="synopsis" mode="body">
560  <h3><xsl:value-of select="."/></h3>
561</xsl:template>
562
563<xsl:template match="eventsection">
564  <div class="sep"/>
565  <hr class="thick"/>
566  <h2>
567    <xsl:value-of select="@label"/>
568  </h2>
569  <xsl:apply-templates select="intro"/>
570  <blockquote>
571  <pre>
572  <xsl:text>
573typedef struct {
574</xsl:text>
575  <xsl:call-template name="eventStruct">
576    <xsl:with-param name="events" select="event"/>
577    <xsl:with-param name="index" select="0"/>
578    <xsl:with-param name="started" select="false"/>
579    <xsl:with-param name="comment" select="'No'"/>
580  </xsl:call-template>
581  <xsl:text>} jvmtiEventCallbacks;
582</xsl:text>
583  </pre>
584  </blockquote>
585  <div class="sep"/>
586  <hr class="thin"/>
587  <h3 id="EventIndex">Event Index</h3>
588  <ul>
589    <xsl:apply-templates select="event" mode="index">
590      <xsl:sort select="@label"/>
591    </xsl:apply-templates>
592  </ul>
593  <xsl:apply-templates select="event" mode="body"/>
594</xsl:template>
595
596<xsl:template match="event" mode="index">
597  <li>
598    <a>
599      <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
600      <b>
601        <xsl:value-of select="@label"/>
602      </b>
603    </a>
604  </li>
605</xsl:template>
606
607<xsl:template match="event" mode="body">
608  <p>
609    <xsl:attribute name="id">
610      <xsl:value-of select="@id"/>
611    </xsl:attribute>
612  </p>
613  <hr class="thick"/>
614  <h2><xsl:value-of select="@label"/></h2>
615  <div class="sep"/>
616  <blockquote>
617    <xsl:apply-templates select="typedef" mode="code"/>
618    <pre>
619<xsl:text>void JNICALL
620</xsl:text>
621      <xsl:value-of select="@id"/>(jvmtiEnv *jvmti_env<xsl:apply-templates select="parameters" mode="signature"/>)</pre>
622  </blockquote>
623  <xsl:apply-templates select="description"/>
624  <xsl:apply-templates select="." mode="generalinfo"/>
625  <xsl:apply-templates select="typedef" mode="body"/>
626  <xsl:apply-templates select="capabilities"/>
627  <xsl:apply-templates select="parameters" mode="body"/>
628</xsl:template>
629
630<xsl:template match="capabilitiestypedef" mode="code">
631  <blockquote>
632    <pre>
633      <xsl:apply-templates select="." mode="genstruct"/>
634    </pre>
635  </blockquote>
636</xsl:template>
637
638<xsl:template match="typedef" mode="code">
639  <pre>
640  <xsl:call-template name="gentypedef">
641    <xsl:with-param name="tdef" select="."/>
642  </xsl:call-template>
643  </pre>
644</xsl:template>
645
646<xsl:template match="uniontypedef" mode="code">
647  <pre>
648  <xsl:call-template name="genuniontypedef">
649    <xsl:with-param name="tdef" select="."/>
650  </xsl:call-template>
651  </pre>
652</xsl:template>
653
654<xsl:template match="capabilitiestypedef|typedef|uniontypedef" mode="description">
655  <xsl:apply-templates select="description"/>
656</xsl:template>
657
658<xsl:template match="capabilitiestypedef|typedef|uniontypedef">
659  <h3>
660    <xsl:attribute name="id">
661      <xsl:value-of select="@id"/>
662    </xsl:attribute>
663    <xsl:value-of select="@label"/>
664  </h3>
665  <xsl:apply-templates select="." mode="description"/>
666  <blockquote>
667    <xsl:apply-templates select="." mode="code"/>
668    <xsl:apply-templates select="." mode="justbody"/>
669  </blockquote>
670</xsl:template>
671
672<xsl:template match="constants" mode="signature">
673  <pre>
674  <xsl:apply-templates select="." mode="enum"/>
675  </pre>
676</xsl:template>
677
678<xsl:template match="typedef|uniontypedef" mode="body">
679  <p>
680    <xsl:attribute name="id">
681      <xsl:value-of select="@id"/>
682    </xsl:attribute>
683  </p>
684  <xsl:apply-templates select="." mode="justbody"/>
685</xsl:template>
686
687<xsl:template match="typedef|uniontypedef" mode="justbody">
688    <table class="bordered wide">
689      <caption class="captionTitle">
690        <code><xsl:value-of select="@id"/></code> - <xsl:value-of select="@label"/>
691      </caption>
692      <tr class="bgLight">
693        <th scope="col">Field</th>
694        <th scope="col">Type</th>
695        <th scope="col">Description</th>
696      </tr>
697      <xsl:apply-templates select="field" mode="body"/>
698    </table>
699</xsl:template>
700
701<xsl:template match="capabilitiestypedef" mode="body">
702  <p>
703    <xsl:attribute name="id">
704      <xsl:value-of select="@id"/>
705    </xsl:attribute>
706  </p>
707  <xsl:apply-templates select="." mode="justbody"/>
708</xsl:template>
709
710<xsl:template match="capabilitiestypedef" mode="justbody">
711    <table class="bordered wide">
712      <caption>
713        <div class="captionTitle">
714          <code><xsl:value-of select="@id"/></code> - <xsl:value-of select="@label"/>
715        </div>
716        <div class="captionDescr">All types are <code>unsigned int : 1</code></div>
717      </caption>
718      <tr class="bgLight">
719        <th scope="col">Field</th>
720        <th scope="col">Description</th>
721        <th scope="col"><a href="#ChangeHistory">Since</a></th>
722      </tr>
723      <xsl:apply-templates select="capabilityfield" mode="body"/>
724    </table>
725</xsl:template>
726
727<xsl:template match="typedef|uniontypedef|capabilitiestypedef|constants" mode="tableentry">
728  <tr>
729    <th scope="row">
730      <a>
731        <xsl:attribute name="href">
732          <xsl:text>#</xsl:text>
733          <xsl:value-of select="@id"/>
734        </xsl:attribute>
735        <code><xsl:value-of select="@id"/></code>
736      </a>
737    </th>
738    <td>
739      <xsl:value-of select="@label"/>
740    </td>
741  </tr>
742</xsl:template>
743
744<xsl:template match="field" mode="body">
745  <tr>
746    <th scope="row">
747      <code>
748        <xsl:attribute name="id">
749          <xsl:value-of select="../@id"/>.<xsl:value-of select="@id"/>
750        </xsl:attribute>
751        <xsl:value-of select="@id"/>
752      </code>
753    </th>
754    <td>
755      <code>
756        <xsl:apply-templates select="child::*[position()=1]" mode="link"/>
757      </code>
758    </td>
759    <td>
760      <xsl:apply-templates select="description" mode="brief"/>
761    </td>
762  </tr>
763</xsl:template>
764
765<xsl:template match="capabilityfield" mode="body">
766  <tr>
767    <th scope="row">
768      <code>
769        <xsl:choose>
770          <xsl:when test="@disp1!=''">
771            <xsl:value-of select="@disp1"/>
772            <br></br>
773            <xsl:value-of select="@disp2"/>
774          </xsl:when>
775          <xsl:otherwise>
776            <xsl:value-of select="@id"/>
777          </xsl:otherwise>
778        </xsl:choose>
779      </code>
780    </th>
781    <td>
782      <xsl:attribute name="id">
783        <xsl:value-of select="../@id"/>.<xsl:value-of select="@id"/>
784      </xsl:attribute>
785      <xsl:apply-templates select="description" mode="brief"/>
786    </td>
787    <td>
788      <xsl:value-of select="@since"/>
789    </td>
790  </tr>
791</xsl:template>
792
793<xsl:template match="callback" mode="tableentry">
794  <tr>
795    <th scope="row">
796      <a>
797        <xsl:attribute name="href">
798          <xsl:text>#</xsl:text>
799          <xsl:value-of select="@id"/>
800        </xsl:attribute>
801        <code>
802          <xsl:value-of select="@id"/>
803        </code>
804      </a>
805    </th>
806    <td>
807      <xsl:apply-templates select="synopsis" mode="index"/>
808    </td>
809  </tr>
810</xsl:template>
811
812<xsl:template match="constants">
813  <blockquote>
814    <table class="bordered">
815      <xsl:attribute name="id">
816        <xsl:value-of select="@id"/>
817      </xsl:attribute>
818      <caption class="captionTitle">
819        <xsl:value-of select="@label"/>
820        <xsl:if test="@kind='enum'">
821          <xsl:text> (</xsl:text>
822          <code>
823            <xsl:value-of select="@id"/>
824          </code>
825          <xsl:text>)</xsl:text>
826        </xsl:if>
827      </caption>
828
829      <tr class="bgLight">
830        <th scope="col">Constant</th>
831        <th scope="col">Value</th>
832        <th scope="col">Description</th>
833      </tr>
834      <xsl:apply-templates select="constant" mode="body"/>
835    </table>
836  </blockquote>
837</xsl:template>
838
839<xsl:template match="constant" mode="index">
840  <a>
841    <xsl:attribute name="href">#<xsl:value-of select="@id"/>
842    </xsl:attribute>
843    <code>
844      <xsl:value-of select="@id"/>
845    </code>
846  </a>
847  <br/>
848</xsl:template>
849
850<xsl:template match="constant" mode="body">
851  <tr>
852    <th scope="row">
853      <code>
854        <xsl:attribute name="id">
855          <xsl:value-of select="@id"/>
856        </xsl:attribute>
857        <xsl:value-of select="@id"/>
858      </code>
859    </th>
860    <td class="rightAligned">
861      <xsl:value-of select="@num"/>
862    </td>
863    <td>
864      <xsl:apply-templates/>
865    </td>
866  </tr>
867</xsl:template>
868
869<xsl:template match="basetypes">
870  <p>
871    <xsl:attribute name="id">
872      <xsl:value-of select="@id"/>
873    </xsl:attribute>
874  </p>
875    <table class="bordered wide">
876      <caption class="captionTitle"><xsl:value-of select="@label"/></caption>
877      <tr class="bgLight">
878        <th scope="col">Type</th>
879        <th scope="col">Description</th>
880      </tr>
881      <xsl:apply-templates select="basetype" mode="body"/>
882    </table>
883</xsl:template>
884
885<xsl:template match="basetype" mode="body">
886  <tr>
887    <th scope="row">
888      <code>
889        <xsl:value-of select="@id"/>
890      </code>
891    </th>
892    <td class="noPadding">
893      <div class="withPadding">
894        <a>
895          <xsl:attribute name="id">
896            <xsl:choose>
897              <xsl:when test="count(@name)=1">
898                <xsl:value-of select="@name"/>
899              </xsl:when>
900              <xsl:otherwise>
901                <xsl:value-of select="@id"/>
902              </xsl:otherwise>
903            </xsl:choose>
904          </xsl:attribute>
905        </a>
906        <xsl:apply-templates select="description" mode="brief"/>
907      </div>
908      <xsl:if test="count(definition)!=0">
909        <div class="withPadding topBorder">
910          <pre>
911            <xsl:apply-templates select="definition"/>
912          </pre>
913        </div>
914      </xsl:if>
915    </td>
916  </tr>
917</xsl:template>
918
919<xsl:template match="description">
920  <xsl:apply-templates/>
921  <div class="sep"/>
922</xsl:template>
923
924<xsl:template match="description" mode="brief">
925  <xsl:apply-templates/>
926</xsl:template>
927
928<xsl:template match="fieldlink">
929  <a>
930    <xsl:attribute name="href">#<xsl:value-of select="@struct"/>.<xsl:value-of select="@id"/></xsl:attribute>
931    <xsl:choose>
932      <xsl:when test=".=''">
933        <code>
934          <xsl:value-of select="@id"/>
935        </code>
936      </xsl:when>
937      <xsl:otherwise>
938        <xsl:apply-templates/>
939      </xsl:otherwise>
940    </xsl:choose>
941  </a>
942</xsl:template>
943
944<xsl:template match="paramlink">
945  <a>
946    <xsl:attribute name="href">#<xsl:value-of select="ancestor::function/@id|ancestor::event/@id"/>.<xsl:value-of select="@id"/>
947    </xsl:attribute>
948    <xsl:choose>
949      <xsl:when test=".=''">
950        <code>
951          <xsl:value-of select="@id"/>
952        </code>
953      </xsl:when>
954      <xsl:otherwise>
955        <xsl:apply-templates/>
956      </xsl:otherwise>
957    </xsl:choose>
958  </a>
959</xsl:template>
960
961<xsl:template match="eventlink|errorlink|typelink|datalink|functionlink">
962  <a>
963    <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
964    <xsl:choose>
965      <xsl:when test=".=''">
966        <code>
967          <xsl:value-of select="@id"/>
968        </code>
969      </xsl:when>
970      <xsl:otherwise>
971        <xsl:apply-templates/>
972      </xsl:otherwise>
973    </xsl:choose>
974  </a>
975</xsl:template>
976
977<xsl:template match="functionphaselist">
978  <xsl:variable name="phase" select="@phase"/>
979  <ul>
980    <xsl:for-each select="/specification/functionsection/category/function[@phase=$phase and count(@hide)=0]">
981      <li>
982        <a>
983          <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
984          <b>
985            <xsl:value-of select="@id"/>
986          </b>
987        </a>
988      </li>
989    </xsl:for-each>
990  </ul>
991</xsl:template>
992
993<xsl:template match="eventphaselist">
994  <xsl:variable name="phase" select="@phase"/>
995  <ul>
996    <xsl:for-each select="//eventsection/event[@phase=$phase]">
997      <li>
998        <a>
999          <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
1000          <b>
1001            <xsl:value-of select="@id"/>
1002          </b>
1003        </a>
1004      </li>
1005    </xsl:for-each>
1006  </ul>
1007</xsl:template>
1008
1009<xsl:template match="externallink">
1010  <a>
1011    <xsl:attribute name="href">
1012      <xsl:value-of select="@id"/>
1013    </xsl:attribute>
1014    <xsl:value-of select="."/>
1015  </a>
1016</xsl:template>
1017
1018<xsl:template match="vmspec">
1019  <cite>
1020    <xsl:text>The Java&#8482; Virtual Machine Specification</xsl:text>
1021    <xsl:if test="count(@chapter)=1">
1022      <xsl:text>, Chapter </xsl:text>
1023      <xsl:value-of select="@chapter"/>
1024    </xsl:if>
1025  </cite>
1026</xsl:template>
1027
1028<xsl:template match="internallink">
1029  <a>
1030    <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
1031    <xsl:apply-templates/>
1032  </a>
1033</xsl:template>
1034
1035<xsl:template match="parameters" mode="body">
1036  <div class="sep"/>
1037  <!--
1038  docchecker complains if a table has only one row.
1039  -->
1040  <xsl:choose>
1041    <xsl:when test="count(param)!=0">
1042      <table class="bordered wide">
1043        <caption class="captionTitle">Parameters</caption>
1044        <tr class="bgLight">
1045          <th scope="col">Name</th>
1046          <th scope="col">Type</th>
1047          <th scope="col">Description</th>
1048        </tr>
1049        <xsl:apply-templates select="param[count(jclass/@method)=0]" mode="body"/>
1050      </table>
1051    </xsl:when>
1052    <xsl:otherwise>
1053      <div class="bordered">
1054        <div class="captionTitle">Parameters</div>
1055        <div class="captionDescr">None</div>
1056      </div>
1057    </xsl:otherwise>
1058  </xsl:choose>
1059</xsl:template>
1060
1061<xsl:template match="param" mode="body">
1062  <tr>
1063    <th scope="row">
1064      <code>
1065        <xsl:attribute name="id">
1066          <xsl:value-of select="../../@id"/>.<xsl:value-of select="@id"/>
1067        </xsl:attribute>
1068        <xsl:value-of select="@id"/>
1069      </code>
1070    </th>
1071    <td>
1072      <code>
1073        <xsl:apply-templates select="child::*[position()=1]" mode="link"/>
1074      </code>
1075    </td>
1076    <td>
1077      <xsl:apply-templates select="description" mode="brief"/>
1078      <xsl:if test="count(ancestor::function)=1">
1079        <xsl:apply-templates select="child::*[position()=1]" mode="funcdescription"/>
1080      </xsl:if>
1081    </td>
1082  </tr>
1083</xsl:template>
1084
1085<xsl:template match="capabilities">
1086  <div class="sep"/>
1087  <!--
1088  docchecker complains if a table has only one column.
1089  -->
1090  <xsl:choose>
1091    <xsl:when test="count(required)!=0 or count(capability)!=0">
1092      <table class="bordered wide">
1093        <caption>
1094          <div class="captionTitle">Capabilities</div>
1095          <xsl:choose>
1096            <xsl:when test="count(required)=0">
1097              <div class="captionDescr"><b>Required Functionality</b></div>
1098            </xsl:when>
1099            <xsl:otherwise>
1100              <div class="captionDescr">
1101                <b>Optional Functionality:</b> might not be implemented for all virtual machines.
1102                <xsl:choose>
1103                  <xsl:when test="count(required)=1">
1104                    The following capability
1105                  </xsl:when>
1106                  <xsl:otherwise>
1107                    One of the following capabilities
1108                  </xsl:otherwise>
1109                </xsl:choose>
1110                (as returned by <a href="#GetCapabilities"><code>GetCapabilities</code></a>)
1111                must be true to use this
1112                <xsl:choose>
1113                  <xsl:when test="ancestor::function">
1114                    function.
1115                  </xsl:when>
1116                  <xsl:otherwise>
1117                    event.
1118                  </xsl:otherwise>
1119                </xsl:choose>
1120              </div>
1121            </xsl:otherwise>
1122          </xsl:choose>
1123        </caption>
1124        <xsl:if test="count(required)!=0">
1125          <tr class="bgLight">
1126            <th scope="col">Capability</th>
1127            <th scope="col">Effect</th>
1128          </tr>
1129          <xsl:apply-templates select="required"/>
1130        </xsl:if>
1131
1132        <xsl:if test="count(capability)!=0">
1133          <tr class="bgDark">
1134            <th colspan="2" scope="rowgroup" class="centered">
1135              Optional Features
1136            </th>
1137          </tr>
1138          <xsl:if test="count(required)=0">
1139            <tr class="bgLight">
1140              <th scope="col">Capability</th>
1141              <th scope="col">Effect</th>
1142            </tr>
1143          </xsl:if>
1144          <xsl:apply-templates select="capability"/>
1145        </xsl:if>
1146      </table>
1147    </xsl:when>
1148    <xsl:otherwise>
1149      <div class="bordered">
1150        <div class="captionTitle">Capabilities</div>
1151        <div class="captionDescr"><b>Required Functionality</b></div>
1152      </div>
1153    </xsl:otherwise>
1154  </xsl:choose>
1155</xsl:template>
1156
1157<xsl:template match="eventcapabilities">
1158  <div class="sep"/>
1159  <table class="bordered wide">
1160    <caption>
1161      <div class="captionTitle">Capabilities</div>
1162      <div class="captionDescr"><b>Required Functionality</b></div>
1163    </caption>
1164    <tr class="bgDark">
1165      <th colspan="2" scope="rowgroup" class="centered">
1166        Event Enabling Capabilities
1167      </th>
1168    </tr>
1169    <tr class="bgLight">
1170      <th scope="col">Capability</th>
1171      <th scope="col">Events</th>
1172    </tr>
1173    <xsl:for-each select="//capabilityfield">
1174      <xsl:variable name="capa" select="@id"/>
1175      <xsl:variable name="events" select="//event[capabilities/required/@id=$capa]"/>
1176      <xsl:if test="count($events)">
1177        <tr>
1178          <th scope="row">
1179            <a>
1180              <xsl:attribute name="href">#jvmtiCapabilities.<xsl:value-of select="@id"/>
1181              </xsl:attribute>
1182              <code>
1183                <xsl:value-of select="@id"/>
1184              </code>
1185            </a>
1186          </th>
1187          <td>
1188            <xsl:for-each select="$events">
1189              <a>
1190                <xsl:attribute name="href">#<xsl:value-of select="@id"/>
1191                </xsl:attribute>
1192                <code>
1193                  <xsl:value-of select="@id"/>
1194                </code>
1195              </a>
1196              <br/>
1197            </xsl:for-each>
1198          </td>
1199        </tr>
1200      </xsl:if>
1201    </xsl:for-each>
1202  </table>
1203</xsl:template>
1204
1205<xsl:template match="capability|required">
1206  <tr>
1207    <th scope="row">
1208      <a>
1209        <xsl:attribute name="href">#jvmtiCapabilities.<xsl:value-of select="@id"/>
1210        </xsl:attribute>
1211        <code>
1212          <xsl:value-of select="@id"/>
1213        </code>
1214      </a>
1215    </th>
1216    <td>
1217      <xsl:choose>
1218        <xsl:when test=".=''">
1219          <xsl:variable name="desiredID" select="@id"/>
1220          <xsl:for-each select="//capabilityfield[@id=$desiredID]">
1221            <xsl:apply-templates select="description" mode="brief"/>
1222          </xsl:for-each>
1223        </xsl:when>
1224        <xsl:otherwise>
1225          <xsl:apply-templates/>
1226        </xsl:otherwise>
1227      </xsl:choose>
1228    </td>
1229  </tr>
1230</xsl:template>
1231
1232<xsl:template match="function" mode="errors">
1233  <xsl:variable name="haserrors">
1234    <xsl:apply-templates select="capabilities/required" mode="haserrors"/>
1235    <xsl:apply-templates select="errors/error" mode="haserrors"/>
1236    <xsl:apply-templates select="parameters/param" mode="haserrors"/>
1237  </xsl:variable>
1238  <div class="sep"/>
1239  <!--
1240  docchecker complains if a table has only one column.
1241  -->
1242  <xsl:choose>
1243    <xsl:when test="contains($haserrors,'yes')">
1244      <table class="bordered wide">
1245        <caption>
1246          <div class="captionTitle">Errors</div>
1247          <div class="captionDescr">
1248            This function returns either a
1249            <a href="#universal-error">universal error</a>
1250            or one of the following errors
1251          </div>
1252        </caption>
1253        <tr class="bgLight">
1254          <th scope="col">Error</th>
1255          <th scope="col">Description</th>
1256        </tr>
1257        <xsl:apply-templates select="capabilities/required" mode="errors"/>
1258        <xsl:apply-templates select="errors/error"/>
1259        <xsl:apply-templates select="parameters/param" mode="errors"/>
1260      </table>
1261    </xsl:when>
1262    <xsl:otherwise>
1263      <div class="bordered">
1264        <div class="captionTitle">Errors</div>
1265        <div class="captionDescr">
1266            This function returns a
1267            <a href="#universal-error">universal error</a>
1268        </div>
1269      </div>
1270    </xsl:otherwise>
1271  </xsl:choose>
1272</xsl:template>
1273
1274<xsl:template match="required" mode="haserrors">
1275  yes
1276</xsl:template>
1277
1278<xsl:template match="required" mode="errors">
1279  <tr>
1280    <th scope="row">
1281      <a href="#JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
1282        <code>
1283          JVMTI_ERROR_MUST_POSSESS_CAPABILITY
1284        </code>
1285      </a>
1286    </th>
1287    <td>
1288      The environment does not possess the capability
1289      <a>
1290        <xsl:attribute name="href">#jvmtiCapabilities.<xsl:value-of select="@id"/></xsl:attribute>
1291        <code>
1292          <xsl:value-of select="@id"/>
1293        </code>
1294      </a>.
1295      Use <a href="#AddCapabilities"><code>AddCapabilities</code></a>.
1296    </td>
1297  </tr>
1298</xsl:template>
1299
1300<xsl:template match="param" mode="haserrors">
1301  <xsl:apply-templates mode="haserrors"/>
1302</xsl:template>
1303
1304<xsl:template match="param" mode="errors">
1305  <xsl:apply-templates select="." mode="errors1"/>
1306  <xsl:apply-templates select="." mode="errors2"/>
1307</xsl:template>
1308
1309<xsl:template match="param" mode="errors1">
1310  <xsl:variable name="haserrors">
1311    <xsl:apply-templates mode="haserrors"/>
1312  </xsl:variable>
1313  <xsl:if test="contains($haserrors,'yes')!=0">
1314    <xsl:variable name="erroridraw">
1315      <xsl:apply-templates mode="errorid"/>
1316    </xsl:variable>
1317    <xsl:variable name="errorid" select="normalize-space($erroridraw)"/>
1318    <tr>
1319      <th scope="row">
1320        <a>
1321          <xsl:attribute name="href">#<xsl:value-of select="$errorid"/></xsl:attribute>
1322          <code>
1323            <xsl:value-of select="$errorid"/>
1324          </code>
1325        </a>
1326      </th>
1327      <td>
1328        <xsl:apply-templates mode="errordesc">
1329          <xsl:with-param name="id" select="@id"/>
1330        </xsl:apply-templates>
1331      </td>
1332    </tr>
1333  </xsl:if>
1334</xsl:template>
1335
1336<xsl:template match="param" mode="errors2">
1337  <xsl:variable name="haserrors2">
1338    <xsl:apply-templates mode="haserrors2"/>
1339  </xsl:variable>
1340  <xsl:if test="contains($haserrors2,'yes')!=0">
1341    <xsl:variable name="erroridraw2">
1342      <xsl:apply-templates mode="errorid2"/>
1343    </xsl:variable>
1344    <xsl:variable name="errorid2" select="normalize-space($erroridraw2)"/>
1345    <tr>
1346      <th scope="row">
1347        <a>
1348          <xsl:attribute name="href">#<xsl:value-of select="$errorid2"/></xsl:attribute>
1349          <code>
1350            <xsl:value-of select="$errorid2"/>
1351          </code>
1352        </a>
1353      </th>
1354      <td>
1355        <xsl:apply-templates mode="errordesc2">
1356          <xsl:with-param name="id" select="@id"/>
1357        </xsl:apply-templates>
1358      </td>
1359    </tr>
1360  </xsl:if>
1361</xsl:template>
1362
1363<xsl:template match="description" mode="haserrors">
1364</xsl:template>
1365
1366<xsl:template match="description" mode="errorid">
1367</xsl:template>
1368
1369<xsl:template match="description" mode="errordesc">
1370</xsl:template>
1371
1372<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|jthread|jthreadGroup|jobject|enum|jlocation" mode="haserrors">
1373  yes
1374</xsl:template>
1375
1376<xsl:template match="jclass" mode="haserrors">
1377  <xsl:if test="count(@method)=0">
1378    yes
1379  </xsl:if>
1380</xsl:template>
1381
1382<xsl:template match="description|jclass|jfieldID|jrawMonitorID|
1383                    jthreadGroup|jobject|enum|jlocation|jvalue|jchar|jint|jlong|jfloat|jdouble|jboolean|
1384                    char|uchar|size_t|void|varargs|struct|
1385                    ptrtype|outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf" mode="haserrors2">
1386</xsl:template>
1387
1388<xsl:template match="jmethodID" mode="haserrors2">
1389  <xsl:if test="count(@native)=1 and contains(@native,'error')">
1390    yes
1391  </xsl:if>
1392</xsl:template>
1393
1394<xsl:template match="jthread" mode="haserrors2">
1395  <xsl:if test="count(@started)=0 or contains(@started,'yes') or @started=''">
1396    yes
1397  </xsl:if>
1398</xsl:template>
1399
1400<xsl:template match="jframeID" mode="haserrors2">
1401    yes
1402</xsl:template>
1403
1404<xsl:template match="description" mode="errorid2">
1405</xsl:template>
1406
1407<xsl:template match="description" mode="errordesc2">
1408</xsl:template>
1409
1410<xsl:template match="jmethodID" mode="errorid">
1411  <xsl:text>JVMTI_ERROR_INVALID_METHODID</xsl:text>
1412</xsl:template>
1413
1414<xsl:template match="jmethodID" mode="errorid2">
1415    <xsl:text>JVMTI_ERROR_NATIVE_METHOD</xsl:text>
1416</xsl:template>
1417
1418<xsl:template match="jmethodID" mode="errordesc">
1419  <xsl:param name="id"/>
1420  <xsl:apply-templates select="." mode="paramlink"/>
1421  <xsl:text> is not a jmethodID.</xsl:text>
1422</xsl:template>
1423
1424<xsl:template match="jmethodID" mode="errordesc2">
1425  <xsl:param name="id"/>
1426  <xsl:apply-templates select="." mode="paramlink"/>
1427  <xsl:text> is a native method.</xsl:text>
1428</xsl:template>
1429
1430<xsl:template match="jfieldID" mode="errorid">
1431  <xsl:text>JVMTI_ERROR_INVALID_FIELDID</xsl:text>
1432</xsl:template>
1433
1434<xsl:template match="jfieldID" mode="errordesc">
1435  <xsl:param name="id"/>
1436  <xsl:apply-templates select="." mode="paramlink"/>
1437  <xsl:text> is not a jfieldID.</xsl:text>
1438</xsl:template>
1439
1440<xsl:template match="jframeID" mode="errorid">
1441  <xsl:text>JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:text>
1442</xsl:template>
1443
1444<xsl:template match="jframeID" mode="errorid2">
1445  <xsl:text>JVMTI_ERROR_NO_MORE_FRAMES</xsl:text>
1446</xsl:template>
1447
1448<xsl:template match="jframeID" mode="errordesc">
1449  <xsl:param name="id"/>
1450  <xsl:apply-templates select="." mode="paramlink"/>
1451  <xsl:text> is less than zero.</xsl:text>
1452</xsl:template>
1453
1454<xsl:template match="jframeID" mode="errordesc2">
1455  <xsl:param name="id"/>
1456  <xsl:text>There are no stack frames at the specified </xsl:text>
1457  <xsl:apply-templates select="." mode="paramlink"/>
1458  <xsl:text>.</xsl:text>
1459</xsl:template>
1460
1461<xsl:template match="jrawMonitorID" mode="errorid">
1462  <xsl:text>JVMTI_ERROR_INVALID_MONITOR</xsl:text>
1463</xsl:template>
1464
1465<xsl:template match="jrawMonitorID" mode="errordesc">
1466  <xsl:param name="id"/>
1467  <xsl:apply-templates select="." mode="paramlink"/>
1468  <xsl:text> is not a jrawMonitorID.</xsl:text>
1469</xsl:template>
1470
1471<xsl:template match="jclass" mode="errorid">
1472  <xsl:text>JVMTI_ERROR_INVALID_CLASS</xsl:text>
1473</xsl:template>
1474
1475<xsl:template match="jclass" mode="errordesc">
1476  <xsl:param name="id"/>
1477  <xsl:apply-templates select="." mode="paramlink"/>
1478  <xsl:text> is not a class object or the class has been unloaded.</xsl:text>
1479</xsl:template>
1480
1481<xsl:template match="jthread" mode="errorid">
1482  <xsl:text>JVMTI_ERROR_INVALID_THREAD</xsl:text>
1483</xsl:template>
1484
1485<xsl:template match="jthread" mode="errorid2">
1486  <xsl:text>JVMTI_ERROR_THREAD_NOT_ALIVE</xsl:text>
1487</xsl:template>
1488
1489<xsl:template match="jthread" mode="errordesc">
1490  <xsl:param name="id"/>
1491  <xsl:apply-templates select="." mode="paramlink"/>
1492  <xsl:text> is not a thread object.</xsl:text>
1493</xsl:template>
1494
1495<xsl:template match="jthread" mode="errordesc2">
1496  <xsl:param name="id"/>
1497  <xsl:apply-templates select="." mode="paramlink"/>
1498  <xsl:text> is not live (has not been started or is now dead).</xsl:text>
1499</xsl:template>
1500
1501<xsl:template match="jthreadGroup" mode="errorid">
1502  <xsl:text>JVMTI_ERROR_INVALID_THREAD_GROUP</xsl:text>
1503</xsl:template>
1504
1505<xsl:template match="jthreadGroup" mode="errordesc">
1506  <xsl:param name="id"/>
1507  <xsl:apply-templates select="." mode="paramlink"/>
1508  <xsl:text> is not a thread group object.</xsl:text>
1509</xsl:template>
1510
1511<xsl:template match="jobject" mode="errorid">
1512  <xsl:text>JVMTI_ERROR_INVALID_OBJECT</xsl:text>
1513</xsl:template>
1514
1515<xsl:template match="jobject" mode="errordesc">
1516  <xsl:param name="id"/>
1517  <xsl:apply-templates select="." mode="paramlink"/>
1518  <xsl:text> is not an object.</xsl:text>
1519</xsl:template>
1520
1521<xsl:template match="enum" mode="errorid">
1522  <xsl:choose>
1523    <xsl:when test=".='jvmtiEvent'">
1524      <xsl:text>JVMTI_ERROR_INVALID_EVENT_TYPE</xsl:text>
1525    </xsl:when>
1526    <xsl:otherwise>
1527      <xsl:text>JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:text>
1528    </xsl:otherwise>
1529  </xsl:choose>
1530</xsl:template>
1531
1532<xsl:template match="enum" mode="errordesc">
1533  <xsl:param name="id"/>
1534  <xsl:apply-templates select="." mode="paramlink"/>
1535  <xsl:text> is not a </xsl:text>
1536  <xsl:value-of select="."/>
1537  <xsl:text>.</xsl:text>
1538</xsl:template>
1539
1540<xsl:template match="jlocation" mode="errorid">
1541  <xsl:text>JVMTI_ERROR_INVALID_LOCATION</xsl:text>
1542</xsl:template>
1543
1544<xsl:template match="jlocation" mode="errordesc">
1545  <xsl:param name="id"/>
1546  <xsl:apply-templates select="." mode="paramlink"/>
1547  <xsl:text> is not a valid location.</xsl:text>
1548</xsl:template>
1549
1550<xsl:template match="jint" mode="haserrors">
1551  <xsl:if test="count(@min)=1">
1552    yes
1553  </xsl:if>
1554</xsl:template>
1555
1556<xsl:template match="jint" mode="errorid">
1557  <xsl:text>JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:text>
1558</xsl:template>
1559
1560<xsl:template match="jint" mode="errordesc">
1561  <xsl:param name="id"/>
1562  <xsl:apply-templates select="." mode="paramlink"/>
1563  <xsl:text> is less than </xsl:text>
1564  <code><xsl:value-of select="@min"/></code>
1565  <xsl:text>.</xsl:text>
1566</xsl:template>
1567
1568<xsl:template match="jvalue|jchar|jlong|jfloat|jdouble|jboolean|char|uchar|size_t|void|varargs|struct" mode="haserrors">
1569</xsl:template>
1570
1571<xsl:template match="jvalue|jchar|jlong|jfloat|jdouble|jboolean|char|uchar|size_t|void|varargs|struct" mode="errordesc">
1572  <xsl:param name="id"/>
1573  <xsl:message terminate="yes">
1574    attempt to get error description for <xsl:apply-templates select="." mode="paramlink"/>
1575  </xsl:message>
1576</xsl:template>
1577
1578<xsl:template match="ptrtype|outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf" mode="haserrors">
1579  <xsl:if test="count(nullok)=0">
1580    yes
1581  </xsl:if>
1582</xsl:template>
1583
1584<xsl:template match="ptrtype|outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf" mode="errorid">
1585  <xsl:text>JVMTI_ERROR_NULL_POINTER</xsl:text>
1586</xsl:template>
1587
1588<xsl:template match="ptrtype|outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf" mode="errordesc">
1589  <xsl:param name="id"/>
1590  <xsl:if test="count(nullok)=1">
1591    <xsl:message terminate="yes">
1592      attempt to get error description in null ok case for <xsl:apply-templates select="." mode="paramlink"/>
1593    </xsl:message>
1594  </xsl:if>
1595  <xsl:apply-templates select="." mode="paramlink"/>
1596  <xsl:text> is </xsl:text>
1597  <code>NULL</code>
1598  <xsl:text>.</xsl:text>
1599</xsl:template>
1600
1601<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|jint|jclass|jthread|jthreadGroup|jobject|enum|jlocation|ptrtype|outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf" mode="paramlink">
1602  <a>
1603    <xsl:attribute name="href">#<xsl:value-of select="ancestor::function/@id|ancestor::event/@id"/>.<xsl:value-of select="ancestor::param/@id"/>
1604    </xsl:attribute>
1605    <code>
1606      <xsl:value-of select="ancestor::param/@id"/>
1607    </code>
1608  </a>
1609</xsl:template>
1610
1611<xsl:template match="error" mode="haserrors">
1612  yes
1613</xsl:template>
1614
1615<xsl:template match="error">
1616  <tr>
1617    <th scope="row">
1618      <a>
1619        <xsl:attribute name="href">#<xsl:value-of select="@id"/></xsl:attribute>
1620        <code>
1621          <xsl:value-of select="@id"/>
1622        </code>
1623      </a>
1624    </th>
1625    <td>
1626      <xsl:apply-templates/>
1627    </td>
1628  </tr>
1629</xsl:template>
1630
1631<xsl:template match="errorsection">
1632  <div class="sep"/>
1633  <hr class="thick"/>
1634  <h2>
1635    Errors
1636  </h2>
1637  <div class="sep"/>
1638  <xsl:apply-templates select="intro"/>
1639  <div class="sep"/>
1640  <xsl:apply-templates select="errorcategory"/>
1641  <div class="sep"/>
1642</xsl:template>
1643
1644<xsl:template match="datasection">
1645  <div class="sep"/>
1646  <hr class="thick"/>
1647  <h2>
1648    Data Types
1649  </h2>
1650  <div class="sep"/>
1651  <xsl:apply-templates select="intro"/>
1652  <xsl:apply-templates select="basetypes"/>
1653  <div class="sep"/>
1654  <table id="StructureTypeDefinitions" class="bordered wide">
1655    <caption class="captionTitle">Structure Type Definitions</caption>
1656    <tr class="bgLight">
1657      <th scope="col">Type</th>
1658      <th scope="col">Description</th>
1659    </tr>
1660    <xsl:apply-templates select="//typedef|//uniontypedef|//capabilitiestypedef" mode="tableentry">
1661      <xsl:sort select="@id"/>
1662    </xsl:apply-templates>
1663  </table>
1664  <div class="sep"/>
1665  <table id="FunctionTypeDefinitions" class="bordered wide">
1666    <caption class="captionTitle">Function Type Definitions</caption>
1667    <tr class="bgLight">
1668      <th scope="col">Type</th>
1669      <th scope="col">Description</th>
1670    </tr>
1671    <xsl:apply-templates select="//callback" mode="tableentry">
1672      <xsl:sort select="@id"/>
1673    </xsl:apply-templates>
1674  </table>
1675  <div class="sep"/>
1676  <table id="EnumerationDefinitions" class="bordered wide">
1677    <caption class="captionTitle">Enumeration Definitions</caption>
1678    <tr class="bgLight">
1679      <th scope="col">Type</th>
1680      <th scope="col">Description</th>
1681    </tr>
1682    <xsl:apply-templates select="//constants[@kind='enum']" mode="tableentry">
1683      <xsl:sort select="@id"/>
1684    </xsl:apply-templates>
1685  </table>
1686  <div class="sep"/>
1687  <table id="FunctionTable" class="bordered wide">
1688    <caption class="captionTitle">Function Table Layout</caption>
1689    <tr class="bgLight">
1690      <th scope="col">Position</th>
1691      <th scope="col">Function</th>
1692      <th scope="col">Declaration</th>
1693    </tr>
1694    <xsl:call-template name="funcStruct">
1695      <xsl:with-param name="funcs" select="//functionsection/category/function[count(@hide)=0]"/>
1696      <xsl:with-param name="index" select="1"/>
1697    </xsl:call-template>
1698  </table>
1699  <div class="sep"/>
1700</xsl:template>
1701
1702
1703<xsl:template name="funcStruct">
1704  <xsl:param name="funcs"/>
1705  <xsl:param name="index"/>
1706  <xsl:variable name="thisFunction" select="$funcs[@num=$index]"/>
1707  <tr>
1708    <th scope="row" class="rightAligned">
1709      <xsl:number value="$index" format="  1"/>
1710    </th>
1711    <xsl:choose>
1712      <xsl:when test="count($thisFunction)=1">
1713        <td>
1714          <a>
1715            <xsl:attribute name="href">
1716              <xsl:text>#</xsl:text>
1717              <xsl:value-of select="$thisFunction/@id"/>
1718            </xsl:attribute>
1719            <xsl:value-of select="$thisFunction/synopsis"/>
1720          </a>
1721        </td>
1722        <td>
1723          <pre>
1724            <xsl:text>jvmtiError (JNICALL *</xsl:text>
1725            <xsl:value-of select="$thisFunction/@id"/>
1726            <xsl:text>) (jvmtiEnv* env</xsl:text>
1727            <xsl:apply-templates select="$thisFunction/parameters" mode="signature">
1728              <xsl:with-param name="comma">
1729                <xsl:text>,&#xA;                       </xsl:text>
1730              </xsl:with-param>
1731            </xsl:apply-templates>
1732            <xsl:text>);</xsl:text>
1733        </pre>
1734      </td>
1735    </xsl:when>
1736    <xsl:otherwise>
1737      <xsl:if test="count($thisFunction) != 0">
1738        <xsl:message terminate="yes">
1739          More than one function has index number <xsl:number value="$index" format="  1"/>.
1740      </xsl:message>
1741      </xsl:if>
1742      <td>
1743        <i>reserved</i>
1744      </td>
1745      <td>
1746        <pre>
1747          <xsl:text>void *reserved</xsl:text>
1748          <xsl:value-of select="$index"/>
1749          <xsl:text>;</xsl:text>
1750        </pre>
1751      </td>
1752    </xsl:otherwise>
1753  </xsl:choose>
1754  </tr>
1755  <xsl:if test="count($funcs[@num &gt; $index]) &gt; 0">
1756    <xsl:call-template name="funcStruct">
1757      <xsl:with-param name="funcs" select="$funcs"/>
1758      <xsl:with-param name="index" select="1+$index"/>
1759    </xsl:call-template>
1760  </xsl:if>
1761</xsl:template>
1762
1763
1764
1765<xsl:template match="errorcategory">
1766  <h3>
1767    <xsl:attribute name="id">
1768      <xsl:value-of select="@id"/>
1769    </xsl:attribute>
1770    <xsl:value-of select="@label"/>
1771  </h3>
1772  <xsl:apply-templates select="intro"/>
1773  <div class="sep"/>
1774  <dl>
1775    <xsl:apply-templates select="errorid"/>
1776  </dl>
1777  <div class="sep"/>
1778</xsl:template>
1779
1780<xsl:template match="errorid">
1781  <dt>
1782    <code>
1783      <xsl:attribute name="id">
1784        <xsl:value-of select="@id"/>
1785      </xsl:attribute>
1786      <xsl:value-of select="@id"/> (<xsl:value-of select="@num"/>)
1787    </code>
1788  </dt>
1789  <dd>
1790    <xsl:apply-templates/>
1791    <div class="sep"/>
1792  </dd>
1793</xsl:template>
1794
1795<xsl:template name="lastchangeversion">
1796  <xsl:for-each select="//change">
1797     <xsl:if test="position() = last()">
1798       <xsl:value-of select="@version"/>
1799     </xsl:if>
1800  </xsl:for-each>
1801</xsl:template>
1802
1803<xsl:template match="changehistory">
1804    <div class="sep"/>
1805    <hr class="thick"/>
1806    <h2>Change History</h2>
1807    Last update: <xsl:value-of select="@update"/><br/>
1808    Version: <xsl:call-template name="lastchangeversion"/>
1809    <div class="sep"/>
1810    <xsl:apply-templates select="intro"/>
1811    <div class="sep"/>
1812    <table class="bordered wide">
1813      <tr class="bgLight">
1814        <th scope="col">
1815          <b>Version</b><br/>
1816          <b>Date</b>
1817        </th>
1818        <th scope="col">
1819          <b>Changes</b>
1820        </th>
1821      </tr>
1822      <xsl:apply-templates select="change"/>
1823    </table>
1824</xsl:template>
1825
1826<xsl:template match="change">
1827  <tr>
1828    <th scope="row">
1829      <xsl:if test="count(@version)">
1830        <b>
1831          <xsl:value-of select="@version"/>
1832        </b>
1833        <br/>
1834      </xsl:if>
1835      <xsl:value-of select="@date"/>
1836    </th>
1837    <td>
1838      <xsl:apply-templates/>
1839    </td>
1840  </tr>
1841</xsl:template>
1842
1843<xsl:template match="intro">
1844  <xsl:if test="@id!=''">
1845    <xsl:choose>
1846      <xsl:when test="@label!=''">
1847        <h3>
1848          <xsl:attribute name="id">
1849            <xsl:value-of select="@id"/>
1850          </xsl:attribute>
1851          <xsl:value-of select="@label"/>
1852        </h3>
1853      </xsl:when>
1854      <xsl:otherwise>
1855        <a>
1856          <xsl:attribute name="name">
1857            <xsl:value-of select="@id"/>
1858          </xsl:attribute>
1859        </a>
1860      </xsl:otherwise>
1861    </xsl:choose>
1862  </xsl:if>
1863  <xsl:apply-templates/>
1864</xsl:template>
1865
1866<xsl:template match="issue">
1867  <xsl:if test="$development = 'Show'">
1868    <p style="color: red">
1869    To be resolved:
1870      <xsl:apply-templates/>
1871    </p>
1872  </xsl:if>
1873</xsl:template>
1874
1875<xsl:template match="rationale">
1876  <p style="color: purple">
1877  Rationale:
1878      <xsl:apply-templates/>
1879  </p>
1880</xsl:template>
1881
1882<xsl:template match="todo">
1883  <xsl:if test="$development = 'Show'">
1884    <p style="color: green">
1885    To do:
1886      <xsl:apply-templates/>
1887    </p>
1888  </xsl:if>
1889</xsl:template>
1890
1891<xsl:template match="elide">
1892</xsl:template>
1893
1894<xsl:template match="b">
1895  <b>
1896  <xsl:apply-templates/>
1897  </b>
1898</xsl:template>
1899
1900<xsl:template match="example">
1901  <blockquote>
1902    <pre>
1903      <xsl:apply-templates/>
1904    </pre>
1905  </blockquote>
1906</xsl:template>
1907
1908
1909<xsl:template match="table">
1910  <table class="bordered wide">
1911    <xsl:apply-templates/>
1912  </table>
1913</xsl:template>
1914
1915<xsl:template match="tr">
1916  <tr>
1917    <xsl:if test="@class">
1918      <xsl:attribute name="class">
1919        <xsl:value-of select="@class"/>
1920      </xsl:attribute>
1921    </xsl:if>
1922    <xsl:apply-templates/>
1923  </tr>
1924</xsl:template>
1925
1926<xsl:template match="td">
1927  <td>
1928    <xsl:if test="@class">
1929      <xsl:attribute name="class">
1930        <xsl:value-of select="@class"/>
1931      </xsl:attribute>
1932    </xsl:if>
1933    <xsl:apply-templates/>
1934  </td>
1935</xsl:template>
1936
1937<xsl:template match="th">
1938  <th>
1939    <xsl:if test="@class">
1940      <xsl:attribute name="class">
1941        <xsl:value-of select="@class"/>
1942      </xsl:attribute>
1943    </xsl:if>
1944    <xsl:if test="@scope">
1945      <xsl:attribute name="scope">
1946        <xsl:value-of select="@scope"/>
1947      </xsl:attribute>
1948    </xsl:if>
1949    <xsl:apply-templates/>
1950  </th>
1951</xsl:template>
1952
1953<xsl:template match="dl">
1954  <dl>
1955    <xsl:apply-templates/>
1956  </dl>
1957</xsl:template>
1958
1959<xsl:template match="dt">
1960  <dt>
1961    <xsl:apply-templates/>
1962  </dt>
1963</xsl:template>
1964
1965<xsl:template match="dd">
1966  <dd>
1967    <xsl:apply-templates/>
1968  </dd>
1969</xsl:template>
1970
1971<xsl:template match="blockquote">
1972  <blockquote>
1973    <xsl:apply-templates/>
1974  </blockquote>
1975</xsl:template>
1976
1977<xsl:template match="p">
1978  <div class="sep"/>
1979</xsl:template>
1980
1981<xsl:template match="br">
1982  <br>
1983    <xsl:apply-templates/>
1984  </br>
1985</xsl:template>
1986
1987<xsl:template match="ul">
1988  <ul>
1989    <xsl:attribute name="style">list-style-type:<xsl:value-of select="@type"/></xsl:attribute>
1990    <xsl:apply-templates/>
1991  </ul>
1992</xsl:template>
1993
1994<xsl:template match="li">
1995  <li>
1996    <xsl:apply-templates/>
1997  </li>
1998</xsl:template>
1999
2000<xsl:template match="code">
2001  <code>
2002    <xsl:apply-templates/>
2003  </code>
2004</xsl:template>
2005
2006<xsl:template match="tm">
2007  <xsl:apply-templates/>
2008  <sup style="font-size: xx-small">
2009    <xsl:text>TM</xsl:text>
2010  </sup>
2011  <xsl:text>&#032;</xsl:text>
2012</xsl:template>
2013
2014<xsl:template match="b">
2015  <b>
2016    <xsl:apply-templates/>
2017  </b>
2018</xsl:template>
2019
2020<xsl:template match="i">
2021  <i>
2022    <xsl:apply-templates/>
2023  </i>
2024</xsl:template>
2025
2026<xsl:template match="space">
2027  <xsl:text>&#032;</xsl:text>
2028</xsl:template>
2029
2030<xsl:template match="jvmti">
2031  <xsl:text>JVM</xsl:text><small style="font-size: xx-small">&#160;</small><xsl:text>TI</xsl:text>
2032</xsl:template>
2033
2034
2035</xsl:stylesheet>
2036