<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" />

<xsl:variable name="d1">20010407</xsl:variable>
<xsl:variable name="d2">20010609</xsl:variable>

<xsl:template match="/">
  <html>
  <body>

    <h4 align="center">
       Abbreviated list all Purchase Orders between 04/07/2001 and 09/09/2001 
    </h4>

    <table cellpadding="4" border="1">
      <thead>
        <th>Tracking #                    </th>
        <th>Date                          </th>
        <th>Status                        </th>
        <th>Login Name                    </th>
        <th>Contact                       </th>
      </thead>

      <xsl:apply-templates select= 
        "//PO/Id[substring-after(date,'//') &gt; $d1  and
                 substring-after(date,'//') &lt; $d2]" />

    </table>
  </body>
  </html>
</xsl:template>

<xsl:template match="Id"> 
  <tr>
    <td> <xsl:value-of select="./trackNbr" />                </td>
    <td> <xsl:value-of select="./date" />                    </td>
    <td> <xsl:value-of select="./status" />                  </td>
    <td> <xsl:value-of select="./login" />                   </td>
    <td> <xsl:value-of select="ancestor::PO/Contact/Name" /> </td>
  </tr>      
</xsl:template>

</xsl:stylesheet>
