﻿<?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"/>

	<xsl:template match="/">
		<xsl:for-each select="AjaxRequest/MasterPortalList/Portal">
			<xsl:variable name="DefaultTab">
				<xsl:choose>
					<xsl:when test="DefaultTab[text()]">
						<xsl:value-of select="DefaultTab"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>default</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>

			<xsl:variable name="Module">
				<xsl:choose>
					<xsl:when test="Module[text()]">
						<xsl:value-of select="Module"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>CSRE</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>

			<div>
				<img src="{ImageURL}" style="width: 135px; height: 135px;  margin-top: 10px;"></img>
				<a href="/website/{$Module}/{PortalItemID}/{$DefaultTab}" style="margin-left: 10px; font-size: 16px;">
					<xsl:value-of select="DomainName"/>
				</a>
			</div>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>
