<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="ISO-8859-1" />

<xsl:template match="/">
  <html>
    <head>
      <title>Cogwheel phase cycling</title>
    </head>
    <body bgcolor="White" text="Black">
        <h2>Cogwheel phase cycling for 3-pulse MQMAS</h2>
        <table border="4">
          <tr>
            <th>p<sub>AB</sub></th>
            <th>windingA</th>
            <th>p<sub>BC</sub></th>
            <th>windingB</th>
            <th>windingC</th>
          </tr>
          <xsl:apply-templates />
        </table>
    </body>
  </html>
</xsl:template>

<xsl:template match="C[((../@w - ../../@w)*(../../@p - 3) 
                     + (@w - ../@w)*(../@p - 1)) mod 23 = 0]">
    <tr>
      <td><xsl:value-of select='../../@p' /></td>
      <td><xsl:value-of select='../../@w' /></td>
      <td><xsl:value-of select='../@p' /></td>
      <td><xsl:value-of select='../@w' /></td>
      <td><xsl:value-of select='@w' /></td>
    </tr>
</xsl:template>

</xsl:stylesheet>
