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