1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.1//EN"
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
encoding="UTF-8"
indent="yes"
/>
<xsl:template match="jclassinfo">
<html xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="jclassinfo.css"/>
</head>
<body>
<xsl:apply-templates select="class"/>
<p>Report generated with jclassinfo <xsl:value-of select="@version"/></p>
</body>
</html>
</xsl:template>
<xsl:template match="class">
<div class="class-section">
<h2><xsl:value-of select="@name"/></h2>
<p class="general-information">
<xsl:if test="@sourcefile">
Build from: <xsl:value-of select="@sourcefile"/><br/>
</xsl:if>
<xsl:if test="@access">
Access: <xsl:value-of select="@access"/><br/>
</xsl:if>
<xsl:if test="@extends">
Extends: <xsl:value-of select="@extends"/><br/>
</xsl:if>
<xsl:if test="@package">
Package: <xsl:value-of select="@package"/><br/>
</xsl:if>
<xsl:if test="@vm">
Requires: Java VM <xsl:value-of select="@vm"/><br/>
</xsl:if>
</p>
<xsl:if test="count(implements) > 0">
<h3>Implements</h3>
<div class="implements">
<ul>
<xsl:for-each select="implements">
<li><xsl:value-of select="@name"/></li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
<h3>Synopsis</h3>
<div class="synopsis">
<xsl:if test="count(field) > 0">
<p>
<xsl:apply-templates select="field"/>
</p>
</xsl:if>
<xsl:if test="count(method) > 0">
<p>
<xsl:apply-templates select="method" mode="brief"/>
</p>
</xsl:if>
</div>
<xsl:apply-templates select="constant_pool"/>
<xsl:if test="count(method) > 0">
<div class="methods">
<h3>Methods</h3>
<xsl:apply-templates select="method"/>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="constant_pool">
<h3>Constant Pool</h3>
<div class="constant_pool">
<table>
<th>
<td>Index</td>
<td>Type</td>
<td>Value...</td>
</th>
<xsl:apply-templates/>
</table>
</div>
</xsl:template>
<xsl:template match="Integer|Float|Long|Double">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="@value"/></td>
</tr>
</xsl:template>
<xsl:template match="String">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="@string_index"/></td>
</tr>
</xsl:template>
<xsl:template match="Utf8">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="."/></td>
</tr>
</xsl:template>
<xsl:template match="Class">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="@name_index"/></td>
</tr>
</xsl:template>
<xsl:template match="NameAndType">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="@name_index"/></td>
<td><xsl:value-of select="@signature_index"/></td>
</tr>
</xsl:template>
<xsl:template match="Fieldref|Methodref|InterfaceMethodref">
<tr>
<td><xsl:value-of select="@index"/></td>
<td><xsl:value-of select="name()"/></td>
<td><xsl:value-of select="@class_index"/></td>
<td><xsl:value-of select="@name_and_type_index"/></td>
</tr>
</xsl:template>
<xsl:template match="field">
<xsl:value-of select="@access"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@type"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:if test="attribute[@name='ConstantValue']">
= <xsl:value-of select="attribute/value"/>
</xsl:if>
<br/>
</xsl:template>
<xsl:template match="method" mode="brief">
<xsl:value-of select="@access"/><xsl:value-of select="string(' ')"/>
<xsl:value-of select="@type"/><xsl:value-of select="string(' ')"/>
<xsl:value-of select="@name"/><xsl:value-of select="string(' ')"/>
<xsl:text>(</xsl:text>
<xsl:for-each select="param">
<xsl:if test="position() > 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@type"/>
</xsl:for-each>
<xsl:text>)</xsl:text><br/>
</xsl:template>
<xsl:template match="method">
<h4>
<xsl:value-of select="@access"/><xsl:value-of select="string(' ')"/>
<xsl:value-of select="@type"/><xsl:value-of select="string(' ')"/>
<xsl:value-of select="@name"/><xsl:value-of select="string(' ')"/>
<xsl:text>(</xsl:text>
<xsl:for-each select="param">
<xsl:if test="position() > 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="@type"/>
</xsl:for-each>
<xsl:text>)</xsl:text>
</h4>
<p>
<xsl:apply-templates select="attribute"/>
</p>
<hr/>
</xsl:template>
<xsl:template match="attribute">
<xsl:apply-templates select="code"/>
</xsl:template>
<xsl:template match="code">
<table class="code">
<xsl:apply-templates select="instruction"/>
</table>
</xsl:template>
<xsl:template match="instruction">
<tr>
<td>
<xsl:value-of select="@pc"/>
</td>
<td>
<xsl:value-of select="@name"/>
<xsl:for-each select="operand">
<xsl:value-of select="string(' ')"/><xsl:value-of select="@value"/>
</xsl:for-each>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
|