<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" version="4.0" indent="yes"/>

	<!-- template that matches the root node -->
	<xsl:template match="/">
		<html>
			<head>
				<title>LDAP Node Properties Viewer</title>
				<style type="text/css">
					<xsl:text>&#xA;</xsl:text>
					<xsl:text>body { color: #CCCCCC; background-color: #333355 }&#xA;</xsl:text>
					<xsl:text>ul { margin: 0 2em 0 2em }&#xA;</xsl:text>
					<xsl:text>.nodename { color: #55AA55; font-weight: bold; font-family: sans-serif }&#xA;</xsl:text>
				</style>
			</head>
			<body>
				<xsl:apply-templates select="*"/>
			</body>
		</html>
	</xsl:template>

	<!-- template that matches the node name property -->
	<xsl:template match="@*">
		<xsl:value-of select="."/>
	</xsl:template>

	<!-- template that matches the toplevel attribute node -->
	<xsl:template match="/*">
		<h2>
		<xsl:text>Properties of Node </xsl:text>
		<!-- read node name property -->
		<span class="nodename">
			<xsl:apply-templates select="@Node"/>		
		</span>
		</h2>
		<!-- list children -->
		<xsl:apply-templates select="*"/>
	</xsl:template>

	<!-- template that matches any text node (just print the text) -->
	<xsl:template match="text()">
		<xsl:value-of select="."/>
	</xsl:template>

	<!-- template that matches any other element node -->
	<xsl:template match="*">
		<ul>
			<li>
				<span class="nodename">
					<xsl:value-of select="name(.)"/>
					<xsl:text>: </xsl:text>
				</span>
				<xsl:apply-templates select="@*|node()"/>
			</li>
		</ul>
	</xsl:template>
		
</xsl:stylesheet>