<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="soldier">
	<xsl:variable name="theUnit"><xsl:value-of select="unit/@id"/></xsl:variable>

<HTML>
	<HEAD>
		<TITLE>
			<xsl:value-of select="name/firstName"/>
                        <xsl:text>&#xA;</xsl:text>
			<xsl:value-of select="name/lastName"/>
		</TITLE>

<style type="text/css"> 
<!-- 
td { padding: 5 px}
div.table {line-height: 1.0em}
--> 
</style> 


	</HEAD>
  	<BODY BACKGROUND="http://dbappdev.com/ACS/images/gray.gif">


		<xsl:apply-templates select="name"/>
		<xsl:apply-templates select="unit"/>

		<br clear="left" /><hr width="90%" size="4" />

		<xsl:apply-templates select="image"/>
		<xsl:apply-templates select="ranksheld"/>
		<xsl:apply-templates select="misc-details"/>
		<xsl:apply-templates select="services"/>
		<xsl:apply-templates select="notes"/>
		<xsl:apply-templates select="pageLinks"/>

<br clear="left" /><hr width="90%" size="4" />

<br clear="all" />

<div align="center">
<p>
<a href="index.htm">
 <img src="http://www.dbappdev.com/ACS/images/20thhom.jpg" border="0" width="194" />
</a>
</p>
</div>

<br clear="left" />
<a href="javascript:window.history.go(-1);"><b>Back</b></a>
<xsl:text>&#xA;</xsl:text>
<a href="javascript:window.history.go(1);"><b>Next</b></a>

<div id="footing">
 <br clear="left" />
 <font color="navy">This page powered by <b>JavaScript</b>, <b>ASP</b>, <b>XML</b>, and <b>XSLT</b>.</font>
</div>


  	</BODY>
</HTML>
	</xsl:template>


	<xsl:template match="name">
		<h1 align="center">
			<xsl:value-of select="firstName"/>
                        <xsl:text>&#xA;</xsl:text>
			<xsl:value-of select="lastName"/>
		</h1>
	</xsl:template>

	<xsl:template match="unit">

		<h2 align="center">

	<xsl:variable name="ct20" select='"20th Connecticut Volunteer Infantry"'/>
	<xsl:variable name="ma33" select='"33rd Massachusetts Volunteer Infantry"'/>

	<xsl:choose>
		<xsl:when test="@id='ct20'"><xsl:value-of select="$ct20"/></xsl:when>
		<xsl:when test="@id='ma33'"><xsl:value-of select="$ma33"/></xsl:when>
		<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
	</xsl:choose>

		</h2>

	</xsl:template>


	<xsl:template match="image">

	<img border="1" align="right">
  		<xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>	
		<xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>	
	</img>
   	

	</xsl:template>

	<xsl:template match="ranksheld">

		<b>Ranks Held:</b>

              		<font color="navy">
			<xsl:for-each select="item">
				<li>
				<b>
					<xsl:value-of select="rank"/>
	                        	<xsl:text>&#xA;</xsl:text>
					<xsl:value-of select="company/@prefix"/>
                	        	<xsl:text>&#xA;</xsl:text>
					<xsl:value-of select="company"/>
				</b>
				</li>
			</xsl:for-each>
			</font>

	</xsl:template>	

	<xsl:template match="misc-details">
		<p>
			<xsl:for-each select="item">
		<br clear="left" />
		  <b>
			<xsl:value-of select="@id"/>
			<xsl:text>&#xA;:</xsl:text>
		  </b>
                        <xsl:text>&#xA;</xsl:text>
		  <b>
			<xsl:value-of select="."/>
		  </b>
			</xsl:for-each>
		</p>
	</xsl:template>
	
	
	<xsl:template match="services">

<xsl:variable name="ctrecs">- Record of Service of Connecticut Men During the War of the Rebellion</xsl:variable>

		<table align="left" border="0">
			<th>Date</th><th align="left">Service</th>
			<xsl:for-each select="item">
				<tr>
				<td valign="top" align="right">
					<b><xsl:value-of select="date"/></b>
				</td>
				<td valign="top">
					<b><xsl:value-of select="service"/></b>
				</td>
				</tr>
			</xsl:for-each>                 
		</table>
		<br clear="left" />
		<i>
	<xsl:value-of select="$ctrecs"/>
		</i>
	</xsl:template>

	<xsl:template match="notes">
		<div align="left">
			<blockquote>
			<p>
              		<font color="green">
			<xsl:for-each select="note">
				<br clear="left" />
				<xsl:value-of select="."/>
			</xsl:for-each>
			</font>
			</p>
			</blockquote>
		</div>
	</xsl:template>	

	<xsl:template match="pageLinks">
		<div align="left">
			<p>
			<xsl:for-each select="item">
			 <a>
  				<xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>	
			 <b>
				<xsl:value-of select="."/>
			 </b></a>
			 <xsl:text> - </xsl:text>
			</xsl:for-each>
			</p>
		</div>
	</xsl:template>	
		
</xsl:stylesheet>

