<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
	<xsl:key name="imageLookup" match="/familyTree/images/image" use="@id"/>
	<xsl:param name="ImageID">IA587.x</xsl:param>
	<xsl:template match="/">
		<table class="noborder">
			<xsl:for-each select="/familyTree/images/image[@id=$ImageID]">
				<xsl:variable name="format" select="@format"/>
				<tr>
					<td>
						<img src="Images/{@id}.{@format}" height="{@height}" width="{@width}"/>
					</td>
					<td>
						<h3>
							<xsl:value-of select="."/>
						</h3>
						<xsl:for-each select="//image[@idRef=$ImageID] ">								
							<a class="big">
								<xsl:attribute name="href">Descendants.asp?id=<xsl:value-of select="ancestor::*[name()='person']/@id"/></xsl:attribute>
								<img src="Images/{@idRef}.t{@position}.{$format}" height="96" width="80">
									<xsl:attribute name="alt"><xsl:value-of select="../../name"/></xsl:attribute>
								</img>&#160;<strong><xsl:value-of select="../../name"/><xsl:if test="../../nickname!='' "> "<xsl:value-of select="../../nickname"/>"</xsl:if></strong>
							</a>
							<br/>
						</xsl:for-each>
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>
</xsl:stylesheet>

