<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>

<xsl:template match="/">

<html>
<head>
	<title>Address book</title>
</head>

<body style="background:silver;">

<p/><table width="70%" align="center" style="background:silver;color:menutext;font:message-box;">
<tr>
	<th align="center" style="color:activecaptiontext;font:caption;">Name</th>
	<th align="center" style="color:activecaptiontext;font:caption;">Surname</th>
	<th align="center" style="color:activecaptiontext;font:caption;">Balance</th>
</tr>

<xsl:for-each select="//root/person">

<tr>
	<td>
		<xsl:attribute name="align">center</xsl:attribute>
		<xsl:if test="balance &lt; 0">
			<xsl:attribute name="bgcolor">red</xsl:attribute>
		</xsl:if>
		<xsl:value-of select="name"/>
	</td>
	<td align="center"><xsl:value-of select="surname"/></td>
	<td align="center"><xsl:value-of select="balance"/></td>
</tr>

</xsl:for-each>

</table>

</body>
</html>
</xsl:template>
</xsl:stylesheet>
