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

<!--  Change parameters here  -->
<xsl:variable name="d1">20010407</xsl:variable>
<xsl:variable name="d2">20010609</xsl:variable>
<xsl:variable name="str1">Burk</xsl:variable>
<xsl:variable name="str2">Gales</xsl:variable>
<!--                          -->

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

    <h4 align = "center">
      List all Purchase Orders between certain dates which contain 
      either a Contact name of "Burk" or of "Gales" 
    </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">
  <xsl:if test = 
    "contains(ancestor::PO/Contact/Name,$str1) or contains(ancestor::PO/Contact/Name,$str2)">
    <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:if>   
</xsl:template>

</xsl:stylesheet>
