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

	<xsl:template match="status" mode="GetBillStatus">
		<xsl:apply-templates select="*" mode="GetBillStatus"/>
	</xsl:template>

	<xsl:template match="vote" mode="GetBillStatus">
		<xsl:value-of select="xpd:perl('%VoteResultText', xpd:perl('%VoteResult', @result))"/>
		<xsl:value-of select="' '"/>
		<xsl:value-of select="xpd:perl('%ChamberNameShort', xpd:perl('firstchar', string(ancestor::bill/@type)))"/>
	</xsl:template>

	<xsl:template match="vote2" mode="GetBillStatus">
		<xsl:value-of select="'Passed '"/>
		<xsl:value-of select="xpd:perl('%ChamberNameShort', xpd:perl('firstchar', string(ancestor::bill/@type)))"/>
		<xsl:value-of select="', '"/>
		<xsl:if test="xpd:perl('%VoteResult', @result) = -1">
			<xsl:value-of select="', Failed '"/>
		</xsl:if>
		<xsl:value-of select="xpd:perl('%ChamberNameShortOther', xpd:perl('firstchar', string(ancestor::bill/@type)))"/>
	</xsl:template>

	<xsl:template match="*" mode="GetBillStatus">
		<xsl:value-of select="xpd:perl('%StatusText', name())"/>
	</xsl:template>

</xsl:stylesheet>
