<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	
	<!--<xsl:output method="xml" version="1.1" encoding="utf-8" omit-xml-declaration="yes"
		doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
		octype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>-->

	<xsl:template match="/document">
<!--<html>
	<head>
		<title>Bailout Bill Comparison: <xsl:value-of select="@title"/> - GovTrack.us</title>
		<style>
			.doc { font-family: Georgia, Times New Roman; font-size: 9pt }
			.billtextline { }
			.leftdoc { padding-right: 1em; border-right: 1px solid black }
			.rightdoc { padding-left: 1em; }
			.inserted { background-color: #CCFFCC; }
			.removed { background-color: #FFCCCC; }
		</style>
	</head>
	<body>
		<h1>Bailout Bill Comparison: <xsl:value-of select="@title"/></h1>
		
		<p>This is a comparison of two bailout bill drafts.</p>
		
		<p>Lines <span class="removed">highlighted on the left</span> were removed. Lines <span class="inserted">highlighted on the right</span> were inserted.</p>
-->		
	<doc left-id="{@left-id}" left-description="{@left-description}" right-id="{@right-id}" right-description="{@right-description}">
		<table cellpadding="0" cellspacing="0" border="0" cols="2" width="800" class="doc">
			<tr><th width="400"><xsl:value-of select="@left-id"/></th> <th width="400"><xsl:value-of select="@right-id"/></th></tr>
			
			<xsl:for-each select="*">
				<tr valign="top">
					<td class="leftdoc"><xsl:apply-templates select="." mode="left"/></td>
					<td class="rightdoc"><xsl:apply-templates select="." mode="right"/></td>
				</tr>
			</xsl:for-each>
		</table>
	</doc>
<!--	</body>
</html>-->
	</xsl:template>

	<xsl:template match="text()" mode="left">
		<xsl:value-of select="."/>
	</xsl:template>
	<xsl:template match="text()" mode="right">
		<xsl:value-of select="."/>
	</xsl:template>
	<xsl:template match="text()" mode="left-removed">
		<span class="removed"><xsl:value-of select="."/></span>
	</xsl:template>
	<xsl:template match="text()" mode="right-inserted">
		<span class="inserted"><xsl:value-of select="."/></span>
	</xsl:template>

	<xsl:template match="line" mode="left">
		<div class="billtextline" style="margin-left: {@indent div 3}em"><xsl:apply-templates mode="left"/></div>
	</xsl:template>
	<xsl:template match="line" mode="right">
		<div class="billtextline" style="margin-left: {@indent div 3}em"><xsl:apply-templates mode="right"/></div>
	</xsl:template>
	<xsl:template match="line" mode="left-removed">
		<div class="billtextline removed" style="margin-left: {@indent}em"><xsl:apply-templates mode="left"/></div>
	</xsl:template>
	<xsl:template match="line" mode="right-inserted">
		<div class="billtextline inserted" style="margin-left: {@indent}em"><xsl:apply-templates mode="right"/></div>
	</xsl:template>

	<xsl:template match="inserted" mode="left">
	</xsl:template>
	<xsl:template match="inserted" mode="right">
		<xsl:apply-templates mode="right-inserted"/>
	</xsl:template>

	<xsl:template match="removed" mode="left">
		<xsl:apply-templates mode="left-removed"/>
	</xsl:template>
	<xsl:template match="removed" mode="right">
	</xsl:template>

	<xsl:template match="changed" mode="left">
		<xsl:apply-templates select="changed-from/node()" mode="left-removed"/>
	</xsl:template>
	<xsl:template match="changed" mode="right">
		<xsl:apply-templates select="changed-to/node()" mode="right-inserted"/>
	</xsl:template>
</xsl:stylesheet>
