<?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">20010508</xsl:variable>
<xsl:variable name="d2">20010512</xsl:variable>
<xsl:variable name="str1">Ship</xsl:variable>
<!--                          -->

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

  <h4 align = "center">
     Abbreviated and sorted list of Purchase Orders for a given Status value 
  </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:for-each select = "//POlist/PO" >  
      <xsl:sort select = "Id/trackNbr" data-type = "number" order = "ascending"/>  
      <xsl:if test =  
        "contains(Id/status,$str1) and 
        (substring-after(Id/date,'//') &gt; $d1 and
         substring-after(Id/date,'//') &lt; $d2)" >        
        <tr>
          <td> <xsl:value-of select="Id/trackNbr" />     </td>
          <td> <xsl:value-of select="Id/date" />         </td>
          <td> <xsl:value-of select="Id/status" />       </td>
          <td> <xsl:value-of select="Id/login" />        </td>
          <td> <xsl:value-of select="Contact/Name" />    </td>
        </tr>
      </xsl:if>
    </xsl:for-each>

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