unitrules.xsl

Copy all of the text below into a file called unitrules.xsl

<?xml version="1.0"?>

<!-- Written by I_War 22/10/2003 -->

<!-- Rise of Nations Clan site -->

<!-- www.infidels.org.uk -->

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

<xsl:variable name='TableStyle'>font-size:67%; text-align:left; vertical-align:top; table-layout:fixed;</xsl:variable>

<xsl:variable name='HeaderStyle'>border-bottom:1 solid black;border-top:1 solid black;background-color:#ffc000;</xsl:variable>

<xsl:variable name='StripeStyle1'>background-color:#ffffd0</xsl:variable>

<xsl:variable name='StripeStyle2'>background-color:#ffffb0</xsl:variable>

<xsl:variable name='BodyStyle'>font-family:verdana;margin:10;background-color:#fffff0;</xsl:variable>

<xsl:template match="ROOT">

    <html>

    <head>

        <title>

            Rise of Nations Unit Stats

        </title>

    </head>

    <body style='{$BodyStyle}'>

      <h3>Rise of Nations Thrones and Patriots Basic Unit Statistics</h3>

      <table id='BodyTable' style="{$TableStyle}" cellspacing='0'>

          <col style="width:35ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:15ex;"/>

          <col style="width:20ex;"/>

          <col style="width:15ex;"/>

          <thead>

              <tr>

                  <th style="{$HeaderStyle}">Name</th>

                  <th style="{$HeaderStyle}">Attack</th>

                  <th style="{$HeaderStyle}">Hits</th>

                  <th style="{$HeaderStyle}">Range</th>

                  <th style="{$HeaderStyle}">Movement</th>

                  <th style="{$HeaderStyle}">Line of Sight</th>

                  <th style="{$HeaderStyle}">Armour</th>

                  <th style="{$HeaderStyle}">Splash</th>

                  <th style="{$HeaderStyle}">Category</th>

                  <th style="{$HeaderStyle}">Notes</th>

              </tr>

          </thead>

          <tbody style='vertical-align:top'>

              <xsl:apply-templates>

                  <xsl:sort select='CAT' order='ascending' data-type='text'/>

                  <xsl:sort select='NAME' order='ascending' data-type='text'/>

              </xsl:apply-templates>

          </tbody>

      </table>

      <br/>

      <table style="{$TableStyle}" >

        <thead>

        <tr>

            <th>Notes</th>

        </tr>

        </thead>

        <tbody>

          <tr> 

              <td> a = Lessen movement effects of terrain<br/>

                      b = Unit is a horse-drawn cart type thing<br/>

                      c = Unit is a very special support unit<br/>

                      d = Unit is a special support unit<br/>

                      f = Unit flies like a helicopter<br/>

                      g = Unit attacks sideways (most ships)<br/>

                      h = Unit does not need to be "researched" once prerequisite discovered<br/>

                      i = Unit is part of infantry family</td>

              <td> j = Unit available w preq even if predecessors not researched.<br/>

                      l = Unit can garrison in town/tower<br/>

                      m = Unit can garrison in fort<br/>

                      n = Unit destroyed when it attacks<br/>

                      o = Unit is cloaked<br/>

                      p = Unit is not built at buildings<br/>

                      q = Unit attacks with a "broadside" attack<br/>

                      r = Unit is siege line (catapults, etc)</td>

              <td> s = Unit is stealth (cloaked when not moving)<br/>

                      t = Unit is a tank<br/>

                      u = Unit is a submarine<br/>

                      v = Unit can fire while moving<br/>

                      w = Unit "strafes" targets<br/>

                      x = Unit continues to block movement when dead<br/>

                      y = Unit is a non-standard or "unique" unit<br/>

                      z = Unit rocks left/right when it attacks</td>

          </tr>

          <tr> 

              <td colspan='3'><br/>Visit <a href='http:\\www.infidels.org.uk'>www.infidels.org.uk</a> for more information on Rise of nations and the Infidels clan<br/>Stylesheet by I_War</td>

          </tr>

        </tbody>

      </table>

    </body>

    </html>

</xsl:template>

<xsl:template match="UNIT">

    <tr>

        <xsl:call-template name="CommonMessageProcessing" />

        <td> <xsl:apply-templates select="TYPENAME"/> </td>

        <td> <xsl:apply-templates select="ATTACK"/> </td>

        <td> <xsl:apply-templates select="HITS"/> </td>

        <td> <xsl:apply-templates select="RANGE"/> </td>

        <td> <xsl:apply-templates select="MOVES"/> </td>

        <td> <xsl:apply-templates select="LOS"/> </td>

        <td> <xsl:apply-templates select="ARMOR"/> </td>

        <td> <xsl:apply-templates select="SPLASH"/> </td>

        <td> <xsl:apply-templates select="CAT"/> </td>

        <td> <xsl:apply-templates select="FLAGS"/> </td>

    </tr>

</xsl:template>

<xsl:template name="CommonMessageProcessing">

    <xsl:choose>

        <xsl:when test = "CAT = 'Air' or CAT = 'Civilian' or CAT = 'Foot' or CAT = 'Mounted' or CAT = 'Sail'">

            <xsl:attribute name="style">

                <xsl:value-of select="$StripeStyle1"/>

            </xsl:attribute>

        </xsl:when>

        <xsl:otherwise>

            <xsl:attribute name="style">

                <xsl:value-of select="$StripeStyle2"/>

            </xsl:attribute>

        </xsl:otherwise>

    </xsl:choose>

</xsl:template>

</xsl:stylesheet>