﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes" omit-xml-declaration ="yes"/>

    <xsl:template match="/">
        <xsl:variable name ="HostName" select ="AjaxRequest/HostName"></xsl:variable>
        <table class="tableMaster" cellpadding="0" cellspacing="0">
            <xsl:for-each select ="AjaxRequest/Items/Item[not(following::OwnerName = OwnerName)]">
                <xsl:variable name ="Name" select ="OwnerName"></xsl:variable>
                <tr>
                    <td>
                        <div class="labelHeader seperatorLine">
                            <xsl:value-of select ="OwnerName" />
                        </div>
                    </td>
                </tr>
                <xsl:for-each select ="../../Items/Item[OwnerName = $Name]">
                    <tr>
                        <td>
                            <a class="link" target="_blank" href="http://{$HostName}/Goal.aspx?ID={GoalID}">
                                <xsl:value-of select ="ItemName"/>
                            </a>
                        </td>
                    </tr>
                </xsl:for-each>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>
