1
|
<?xml version="1.0"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
|
4
|
<xsl:template match="/">
|
5
|
<html>
|
6
|
<head>
|
7
|
</head>
|
8
|
<body>
|
9
|
<center>
|
10
|
<h2>XML View</h2>
|
11
|
</center>
|
12
|
<table border="1" cellpadding="5">
|
13
|
<tr><td><B>Element Name</B></td><td><B>Value</B></td></tr>
|
14
|
<xsl:apply-templates />
|
15
|
</table></body>
|
16
|
</html>
|
17
|
</xsl:template>
|
18
|
|
19
|
<xsl:template match="*">
|
20
|
<xsl:for-each select="./*">
|
21
|
<tr><td><xsl:value-of select="local-name()"/></td>
|
22
|
<td><xsl:value-of select="."/></td></tr>
|
23
|
</xsl:for-each>
|
24
|
</xsl:template>
|
25
|
|
26
|
</xsl:stylesheet>
|