<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template  match="/">
	<HTML>
	<STYLE>
	H1 {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
	H2 {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
	.subhead {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
	.text {COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
	TH {COLOR: white; FONT-FAMILY: Arial; background-color: darkblue;}
	TD {COLOR: blue; FONT-FAMILY: Arial}
	TR { background-color: beige; }
	BODY { background-color: beige; }
	</STYLE>
	<BODY>
	<H1> Company Information for Infoteria </H1>
	<H2> Employee Listing </H2>
	<TABLE border="1">
	<TR>
	<th> Name </th>
	<th> Position </th>
	<th> Email </th>
	</TR>
	<xsl:for-each select="Company/Employee">
	<xsl:sort select="substring-after(Email,'@')" />
	<TR>
	<TD>
	<xsl:value-of select="FirstName" />
	<xsl:value-of select="LastName" />
	</TD>
	<TD>
	<xsl:value-of select="Position" />
	</TD>
	<TD>
	<xsl:value-of select="Email" />
	</TD>
	</TR>
	</xsl:for-each>
	
	</TABLE>
	<BR />
	<xsl:apply-templates/>
	</BODY>
	</HTML>
</xsl:template >
<xsl:template match="Company">
	<p> Total Employees: 
		<xsl:value-of select="count(Employee)" />
	</p>
</xsl:template>

</xsl:stylesheet>
