home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F23416_DisplayProds.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  847 b   |  31 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:template name="DisplayProds">
  5.     <xsl:param name="ProductNodes" select="." />
  6.  
  7.     <h1>Product Listing for <xsl:value-of select="$ProductNodes//@region" /> region</h1>
  8.  
  9.  
  10.     <!--Display the headings for each element as a table header -->
  11.     <table border="1">
  12.     <xsl:for-each select="$ProductNodes//product[1]/*" > 
  13.          <th><xsl:value-of select="name(.)"/></th>
  14.     </xsl:for-each> 
  15.  
  16.     <!--Display the data for each element as a table row -->
  17.     <xsl:for-each select="$ProductNodes//product">
  18.     <xsl:sort select="prodid" order="ascending" />
  19.     <tr>
  20.         <xsl:for-each select="*" > 
  21.         <td><xsl:value-of select="text()" /></td>
  22.         </xsl:for-each>
  23.     </tr>
  24.     </xsl:for-each>
  25.     </table>
  26.  
  27.  
  28. </xsl:template>
  29.  
  30.  
  31. </xsl:stylesheet>