﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
	version="1.0"
	xmlns:am="http://www.ani-mayhem.com/"
	xmlns:db="http://www.ani-mayhem.com/database"
	xmlns:g="http://www.ani-mayhem.com/guide"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="http://www.w3.org/1999/xhtml"
	exclude-result-prefixes="am g db xsl">
	<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="no" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/MarkUp/DTD/xhtml11.dtd"/>
	<xsl:variable name="cgi">http://www.ani-mayhem.com/cardcatalog.aspx?xmlid=</xsl:variable>
	<xsl:template match="/">
		<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<title>Ani-Mayhem Online - Guide</title>
				<link rel="stylesheet" href="http://www.ani-mayhem.com/ani-mayhem.css" type="text/css"/>
				<link rel="stylesheet" href="http://www.ani-mayhem.com/guide/guide.css" type="text/css"/>
				<link rel="shortcut icon" href="http://www.ani-mayhem.com/ani-mayhem.ico" type="image/x-icon"/>
			</head>
			<body id="guide">
				<h1>
					<a href="http://www.ani-mayhem.com/">
						<img src="http://www.ani-mayhem.com/ani-mayhem.png" alt="Ani-Mayhem Online" />
					</a>
				</h1>
				<hr />
				<h2 class="location">
					<span class="h2">
						<span class="title">Guide</span>
						<span class="date">February 2, 2012</span>
					</span>
				</h2>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="am:ani-mayhem">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="am:card">
		<div class="border" id="{@xml:id}">
			<xsl:apply-templates/>
		</div>
		<hr />
	</xsl:template>
	<xsl:template match="g:Character | g:Enhancement | g:Equipment | g:Haven | g:Item | g:Location">
		<p class="{translate(local-name(), 'CEHIL', 'cehil')}">
			<xsl:call-template name="dbName"/>
			<span class="type">
				<xsl:value-of select="local-name()"/>
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:FlashEffect">
		<p class="flasheffect">
			<xsl:call-template name="dbName"/>
			<span class="type">
				Flash Effect
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:GlobalEffect">
		<p class="globaleffect">
			<xsl:call-template name="dbName"/>
			<span class="type">
				Global Effect
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:MajorDisaster">
		<p class="majordisaster">
			<xsl:call-template name="dbName"/>
			<span class="type">
				Major Disaster
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:MinorDisaster">
		<p class="minordisaster">
			<xsl:call-template name="dbName"/>
			<span class="type">
				Minor Disaster
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:Combat">
		<p class="combat">
			<span class="name">
				<a>
					<xsl:attribute name="href"><xsl:value-of select="$cgi"/><xsl:value-of select="..//@xml:id"/></xsl:attribute>
					<xsl:value-of select="substring-before(db:Name, ' /')"/>
				</a>
				<xsl:text> / </xsl:text>
				<a>
					<xsl:attribute name="href"><xsl:value-of select="$cgi"/><xsl:value-of select="substring-after(@g:Transform, 'Combat ')"/></xsl:attribute>
					<xsl:value-of select="substring-after(db:Name, '/ ')"/>
				</a>
			</span>
			<span class="type">
				Combat
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="g:CharmCombat">
		<p class="charmcombat">
			<span class="name">
				<a>
					<xsl:attribute name="href"><xsl:value-of select="$cgi"/><xsl:value-of select="..//@xml:id"/></xsl:attribute>
					<xsl:value-of select="substring-before(db:Name, ' /')"/>
				</a>
				<xsl:text> / </xsl:text>
				<a>
					<xsl:attribute name="href"><xsl:value-of select="$cgi"/><xsl:value-of select="substring-after(@g:Transform, 'Combat ')"/></xsl:attribute>
					<xsl:value-of select="substring-after(db:Name, '/ ')"/>
				</a>
			</span>
			<span class="type">
				Charm Combat
			</span>
		</p>
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="db:Name"/>
	<xsl:template name="dbName">
		<span class="name">
			<a>
				<xsl:attribute name="href"><xsl:value-of select="$cgi"/><xsl:value-of select="..//@xml:id"/></xsl:attribute>
				<xsl:value-of select="db:Name"/>
			</a>
		</span>
	</xsl:template>
	<xsl:template match="g:Categories">
		<tr>
			<td>
				Categories:
			</td>
			<td>
				<xsl:if test="count(./*) &gt;= 1"><xsl:apply-templates select="./*[1]" mode="g:Keyword"/></xsl:if>
				<xsl:if test="count(./*) &gt;= 2">, <xsl:apply-templates select="./*[2]" mode="g:Keyword"/></xsl:if>
				<xsl:if test="count(./*) &gt;= 3">, <xsl:apply-templates select="./*[3]" mode="g:Keyword"/></xsl:if>
				<xsl:if test="count(./*) &gt;= 4">, <xsl:apply-templates select="./*[4]" mode="g:Keyword"/></xsl:if>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="g:Abilities | g:Cost | g:Bonus | g:Gender | g:Uses | g:Instruction | g:Text | g:Quote | g:Skills">
		<tr>
			<td>
				<xsl:value-of select="local-name()"/>:
			</td>
			<td>
				<xsl:apply-templates/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="g:Attack | g:Defense | g:Movement | g:Charm | g:Energy">
		<xsl:value-of select="local-name()"/> = <xsl:apply-templates/><br/>
	</xsl:template>
	<xsl:template match="g:Skills/*">
		<xsl:apply-templates select="." mode="g:Keyword"/>
		<xsl:call-template name="value"><xsl:with-param name="value" select="."/></xsl:call-template>
		<xsl:if test="position() != last()"><br/></xsl:if>
	</xsl:template>
	<xsl:template match="g:Requirements">
		<tr>
			<td>
				Requirements:
			</td>
			<td class="requirements">
				<xsl:apply-templates select="g:Requirement[1]/*[1]"/>
				<xsl:if test="g:Requirement[1]/*[2]">
					&amp;
					<xsl:apply-templates select="g:Requirement[1]/*[2]"/>
					<xsl:if test="g:Requirement[1]/*[3]">
						&amp;
						<xsl:apply-templates select="g:Requirement[1]/*[3]"/>
						<xsl:if test="g:Requirement[1]/*[4]">
							&amp;
							<xsl:apply-templates select="g:Requirement[1]/*[4]"/>
						</xsl:if>
					</xsl:if>
				</xsl:if>
				<xsl:if test="g:Requirement[2]">
					<br/>
					<span class="or">
						or
					</span>
					<br/>
					<xsl:apply-templates select="g:Requirement[2]/*[1]"/>
					<xsl:if test="g:Requirement[2]/*[2]">
						&amp;
						<xsl:apply-templates select="g:Requirement[2]/*[2]"/>
						<xsl:if test="g:Requirement[2]/*[3]">
							&amp;
							<xsl:apply-templates select="g:Requirement[2]/*[3]"/>
							<xsl:if test="g:Requirement[2]/*[4]">
								&amp;
								<xsl:apply-templates select="g:Requirement[2]/*[4]"/>
							</xsl:if>
						</xsl:if>
					</xsl:if>
				</xsl:if>
				<xsl:if test="g:Requirement[3]">
					<br/>
					<span class="or">
						or
					</span>
					<br/>
					<xsl:apply-templates select="g:Requirement[3]/*[1]"/>
					<xsl:if test="g:Requirement[3]/*[2]">
						&amp;
						<xsl:apply-templates select="g:Requirement[3]/*[2]"/>
						<xsl:if test="g:Requirement[3]/*[3]">
							&amp;
							<xsl:apply-templates select="g:Requirement[3]/*[3]"/>
							<xsl:if test="g:Requirement[3]/*[4]">
								&amp;
								<xsl:apply-templates select="g:Requirement[3]/*[4]"/>
							</xsl:if>
						</xsl:if>
					</xsl:if>
				</xsl:if>
				<xsl:if test="g:Requirement[4]">
					<br/>
					<span class="or">
						or
					</span>
					<br/>
					<xsl:apply-templates select="g:Requirement[4]/*[1]"/>
					<xsl:if test="g:Requirement[4]/*[2]">
						&amp;
						<xsl:apply-templates select="g:Requirement[4]/*[2]"/>
							<xsl:if test="g:Requirement[4]/*[3]">
							&amp;
							<xsl:apply-templates select="g:Requirement[4]/*[3]"/>
							<xsl:if test="g:Requirement[4]/*[4]">
								&amp;
								<xsl:apply-templates select="g:Requirement[4]/*[4]"/>
							</xsl:if>
						</xsl:if>
					</xsl:if>
				</xsl:if>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="g:Requirement/*">
		<xsl:apply-templates select="." mode="g:Keyword"/>
		<xsl:call-template name="value">
			<xsl:with-param name="value" select="."/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="g:Gender/*">
		<xsl:value-of select="local-name()"/>
	</xsl:template>
	<xsl:template match="g:line">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template name="value">
		<xsl:param name="value"/>
		<xsl:choose>
			<xsl:when test="$value &gt; 1">
				<xsl:text> x</xsl:text><xsl:value-of select="$value"/>
			</xsl:when>
			<xsl:when test="$value &lt; 0">
				<xsl:text> </xsl:text><xsl:value-of select="$value"/>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="g:Acrobatics"		mode="g:Keyword">Acrobatics</xsl:template>
	<xsl:template match="g:Alien"			mode="g:Keyword">Alien</xsl:template>
	<xsl:template match="g:AirElement"		mode="g:Keyword">Air Element</xsl:template>
	<xsl:template match="g:AnySkill"		mode="g:Keyword">*Any Skill</xsl:template>
	<xsl:template match="g:Android"			mode="g:Keyword">Android</xsl:template>
	<xsl:template match="g:Animal"			mode="g:Keyword">Animal</xsl:template>
	<xsl:template match="g:AnyElement"		mode="g:Keyword">Any Element</xsl:template>
	<xsl:template match="g:Archaeology"		mode="g:Keyword">Archaeology</xsl:template>
	<xsl:template match="g:Archeology"		mode="g:Keyword">Archeology</xsl:template>
	<xsl:template match="g:Battlesuit"		mode="g:Keyword">Battlesuit</xsl:template>
	<xsl:template match="g:BlindLuck"		mode="g:Keyword">Blind Luck</xsl:template>
	<xsl:template match="g:Bugrom"			mode="g:Keyword">Bugrom</xsl:template>
	<xsl:template match="g:Bureaucracy"		mode="g:Keyword">Bureaucracy</xsl:template>
	<xsl:template match="g:Celebrity"		mode="g:Keyword">Celebrity</xsl:template>
	<xsl:template match="g:Chi"			mode="g:Keyword">Chi</xsl:template>
	<xsl:template match="g:Climbing"		mode="g:Keyword">Climbing</xsl:template>
	<xsl:template match="g:Clothing"		mode="g:Keyword">Clothing</xsl:template>
	<xsl:template match="g:Communications"		mode="g:Keyword">Communications</xsl:template>
	<xsl:template match="g:Computer"		mode="g:Keyword">Computer</xsl:template>
	<xsl:template match="g:Cooking"			mode="g:Keyword">Cooking</xsl:template>
	<xsl:template match="g:Cute"			mode="g:Keyword">Cute</xsl:template>
	<xsl:template match="g:Cyborg"			mode="g:Keyword">Cyborg</xsl:template>
	<xsl:template match="g:DarkTribe"		mode="g:Keyword">Dark Tribe</xsl:template>
	<xsl:template match="g:Demon"			mode="g:Keyword">Demon</xsl:template>
	<xsl:template match="g:Dimensional"		mode="g:Keyword">Dimensional</xsl:template>
	<xsl:template match="g:Dream"			mode="g:Keyword">Dream</xsl:template>
	<xsl:template match="g:Driving"			mode="g:Keyword">Driving</xsl:template>
	<xsl:template match="g:Earth"			mode="g:Keyword">Earth</xsl:template>
	<xsl:template match="g:ESP"			mode="g:Keyword">ESP</xsl:template>
	<xsl:template match="g:Fear"			mode="g:Keyword">Fear</xsl:template>
	<xsl:template match="g:Female"			mode="g:Keyword">Female</xsl:template>
	<xsl:template match="g:Fire"			mode="g:Keyword">Fire</xsl:template>
	<xsl:template match="g:FireElement"		mode="g:Keyword">Fire Element</xsl:template>
	<xsl:template match="g:Flying"			mode="g:Keyword">Flying</xsl:template>
	<xsl:template match="g:FlyingVehicle"		mode="g:Keyword">Flying Vehicle</xsl:template>
	<xsl:template match="g:Food"			mode="g:Keyword">Food</xsl:template>
	<xsl:template match="g:Freeza"			mode="g:Keyword">Freeza</xsl:template>
	<xsl:template match="g:Genius"			mode="g:Keyword">Genius</xsl:template>
	<xsl:template match="g:Gift"			mode="g:Keyword">Gift</xsl:template>
	<xsl:template match="g:Godling"			mode="g:Keyword">Godling</xsl:template>
	<xsl:template match="g:HalfSaiyan"		mode="g:Keyword">Half-Saiyan</xsl:template>
	<xsl:template match="g:HandHeldWeapon" 		mode="g:Keyword">Hand-held Weapon</xsl:template>
	<xsl:template match="g:Haven"	 		mode="g:Keyword">Haven</xsl:template>
	<xsl:template match="g:Holding"			mode="g:Keyword">Holding</xsl:template>
	<xsl:template match="g:Horde"			mode="g:Keyword">Horde</xsl:template>
	<xsl:template match="g:HotTub"			mode="g:Keyword">Hot Tub</xsl:template>
	<xsl:template match="g:Hungry"			mode="g:Keyword">Hungry</xsl:template>
	<xsl:template match="g:Hunter"			mode="g:Keyword">Hunter</xsl:template>
	<xsl:template match="g:Illusion"		mode="g:Keyword">Illusion</xsl:template>
	<xsl:template match="g:Insect"			mode="g:Keyword">Insect</xsl:template>
	<xsl:template match="g:Investigation"		mode="g:Keyword">Investigation</xsl:template>
	<xsl:template match="g:Ki"			mode="g:Keyword">Ki</xsl:template>
	<xsl:template match="g:Knowledge"		mode="g:Keyword">Knowledge</xsl:template>
	<xsl:template match="g:Legal"			mode="g:Keyword">Legal</xsl:template>
	<xsl:template match="g:Magic"			mode="g:Keyword">Magic</xsl:template>
	<xsl:template match="g:Male"			mode="g:Keyword">Male</xsl:template>
	<xsl:template match="g:Marksman"		mode="g:Keyword">Marksman</xsl:template>
	<xsl:template match="g:MartialArts"		mode="g:Keyword">Martial Arts</xsl:template>
	<xsl:template match="g:Masaki"			mode="g:Keyword">Masaki</xsl:template>
	<xsl:template match="g:Mech"			mode="g:Keyword">Mech</xsl:template>
	<xsl:template match="g:Mecha"			mode="g:Keyword">Mecha</xsl:template>
	<xsl:template match="g:Medic"			mode="g:Keyword">Medic</xsl:template>
	<xsl:template match="g:Medical"			mode="g:Keyword">Medical</xsl:template>
	<xsl:template match="g:Military"		mode="g:Keyword">Military</xsl:template>
	<xsl:template match="g:Missile"			mode="g:Keyword">Missile</xsl:template>
	<xsl:template match="g:Money"			mode="g:Keyword">Money</xsl:template>
	<xsl:template match="g:Move"			mode="g:Keyword">Move</xsl:template>
	<xsl:template match="g:move"			mode="g:Keyword">move</xsl:template>
	<xsl:template match="g:Movement3"		mode="g:Keyword">Movement 3+</xsl:template>
	<xsl:template match="g:Movement4"		mode="g:Keyword">Movement 4+</xsl:template>
	<xsl:template match="g:Museum"			mode="g:Keyword">Museum</xsl:template>
	<xsl:template match="g:Music"			mode="g:Keyword">Music</xsl:template>
	<xsl:template match="g:Namek"			mode="g:Keyword">Namek</xsl:template>
	<xsl:template match="g:NonFlyingVehicle"	mode="g:Keyword">Non-flying Vehicle</xsl:template>
	<xsl:template match="g:Ogre"			mode="g:Keyword">Ogre</xsl:template>
	<xsl:template match="g:Peeping"			mode="g:Keyword">Peeping</xsl:template>
	<xsl:template match="g:Phase"			mode="g:Keyword">Phase</xsl:template>
	<xsl:template match="g:Pilot"			mode="g:Keyword">Pilot</xsl:template>
	<xsl:template match="g:Planetary"		mode="g:Keyword">Planetary</xsl:template>
	<xsl:template match="g:PlanetaryVehicle"	mode="g:Keyword">Planetary Vehicle</xsl:template>
	<xsl:template match="g:Police"			mode="g:Keyword">Police</xsl:template>
	<xsl:template match="g:Priest"			mode="g:Keyword">Priest</xsl:template>
	<xsl:template match="g:PureHeart"		mode="g:Keyword">Pure Heart</xsl:template>
	<xsl:template match="g:Robot"			mode="g:Keyword">Robot</xsl:template>
	<xsl:template match="g:Royalty"			mode="g:Keyword">Royalty</xsl:template>
	<xsl:template match="g:Ruler"			mode="g:Keyword">Ruler</xsl:template>
	<xsl:template match="g:Saiyan"			mode="g:Keyword">Saiyan</xsl:template>
	<xsl:template match="g:SavoirFaire"		mode="g:Keyword">Savoir-Faire</xsl:template>
	<xsl:template match="g:School"			mode="g:Keyword">School</xsl:template>
	<xsl:template match="g:Science"			mode="g:Keyword">Science</xsl:template>
	<xsl:template match="g:Seduction"		mode="g:Keyword">Seduction</xsl:template>
	<xsl:template match="g:ShapeChange"		mode="g:Keyword">Shape Change</xsl:template>
	<xsl:template match="g:Speed"			mode="g:Keyword">Speed</xsl:template>
	<xsl:template match="g:Spirit"			mode="g:Keyword">Spirit</xsl:template>
	<xsl:template match="g:Splitting"		mode="g:Keyword">Splitting</xsl:template>
	<xsl:template match="g:Streetwise"		mode="g:Keyword">Streetwise</xsl:template>
	<xsl:template match="g:Streewise"		mode="g:Keyword">Streewise</xsl:template>
	<xsl:template match="g:Strength"		mode="g:Keyword">Strength</xsl:template>
	<xsl:template match="g:Strength4"		mode="g:Keyword">Strength 4+</xsl:template>
	<xsl:template match="g:Student"			mode="g:Keyword">Student</xsl:template>
	<xsl:template match="g:Survival"		mode="g:Keyword">Survival</xsl:template>
	<xsl:template match="g:Swamp"			mode="g:Keyword">Swamp</xsl:template>
	<xsl:template match="g:Swordsman"		mode="g:Keyword">Swordsman</xsl:template>
	<xsl:template match="g:Teacher"			mode="g:Keyword">Teacher</xsl:template>
	<xsl:template match="g:Tech"			mode="g:Keyword">Tech</xsl:template>
	<xsl:template match="g:Undead"			mode="g:Keyword">Undead</xsl:template>
	<xsl:template match="g:Unique"			mode="g:Keyword">Unique</xsl:template>
	<xsl:template match="g:Vehicle"			mode="g:Keyword">Vehicle</xsl:template>
	<xsl:template match="g:View"			mode="g:Keyword">View</xsl:template>
	<xsl:template match="g:Viewing"			mode="g:Keyword">Viewing</xsl:template>
	<xsl:template match="g:Water"			mode="g:Keyword">Water</xsl:template>
	<xsl:template match="g:WaterElement"		mode="g:Keyword">Water Element</xsl:template>
	<xsl:template match="g:Weapon"			mode="g:Keyword">Weapon</xsl:template>
	<xsl:template match="g:Weapons"			mode="g:Keyword">Weapons</xsl:template>
</xsl:stylesheet>
