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

<xsl:template match="/">
<html><body>

<xsl:if test="count(//error) &gt; 0">
	<b class="ErrorTitle">The service returned the following messages:</b><br/>
	<xsl:for-each select="//error">
		<b class="Error"><xsl:value-of select="."/></b><br/>
	</xsl:for-each>
</xsl:if>
<xsl:for-each select="//results">
<h3><xsl:value-of select="@title"/></h3>
<table>
	<tr>
	<xsl:for-each select="./header/col">
		<th><xsl:value-of select="./@value"/></th>
	</xsl:for-each>
	</tr>

	<xsl:for-each select="./row">
	<tr>
		<xsl:for-each select="./col">
		<td>
		<xsl:choose>
			<xsl:when test="@type = 'zoomto' or @type = 'pan'">
				<a href="javascript:changePointScale({@x},{@y},2)"><xsl:value-of select="@value"/></a>
			</xsl:when>
			<xsl:when test="@type = 'internal'">
				<a href="javascript:{@command}"><xsl:value-of select="@value"/></a>
			</xsl:when>
			<xsl:when test="@type = 'image'">
				<xsl:choose>
					<xsl:when test="@href"><a target="_blank" href="{@href}"><img width="{@width}" height="{@height}" src="{@src}"/></a></xsl:when>
					<xsl:otherwise><img width="{@width}" height="{@height}" src="{@src}"/></xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="@href"><a target="_blank" href="{@href}"><xsl:value-of select="./@value"/></a></xsl:when>
					<xsl:otherwise><xsl:value-of select="./@value"/></xsl:otherwise>
				</xsl:choose>

			</xsl:otherwise>
		</xsl:choose>
		</td>
		</xsl:for-each>
	</tr>
	</xsl:for-each>
</table>
</xsl:for-each>
</body></html>
</xsl:template>
</xsl:stylesheet>
