> Can somebody please advice me how to get the above formatting by
> modifying this xsl template.
You have to get distinct @Site values. This trick is done in xslt by
using key() feature. There is a nice template in the excellent Cooktop
xml editor.
You can also choose to use a less standard thing as e-xslt
(
www.exslt.org) which provide a distinct function
(
http://www.exslt.org/set/functions/distinct/index.html)
Here is a working xsl (consider some improvement in the key to avoid the
//row select) :
---------------------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns

sl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="site" match="@Site" use="."/>
<xsl:template match="/">
<!-- the key declaration must be global ! -->
<!--
substitute xpath with xpath to your xpath to the node to iterate
substitute @att with the name of the attribute or . for txt node.
-->
<xsl:for-each select="root/*[count(@Site | key('site', @Site)[1]) = 1]">
<b><xsl:value-of select="@Site" /></b>
<table width="100%">
<tr>
<td><b>ClassroomName</b></td>
<td><b>Start Date</b></td>
</tr>
<xsl:apply-templates select="//row[@Site=current()/@Site]" />
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="row">
<tr>
<td><xsl:value-of select="@ClassroomName" /></td>
<td><xsl:value-of select="@StartDate" /></td>
</tr>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
Hth
--
Rémi Peyronnet