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 / F23030_DisplayProds.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  854 b   |  30 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. <xsl:template name="DisplayProds">
  4.     <xsl:param name="ProductNodes" select="." />
  5.  
  6.     <h1>Product Listing for <xsl:value-of select="$ProductNodes//@region" /> region</h1>
  7.  
  8.  
  9.     <!--Display the headings for each element as a table header -->
  10.     <table border="1">
  11.     <xsl:for-each select="$ProductNodes//products/product[1]/*" > 
  12.          <th><xsl:value-of select="name(.)"/></th>
  13.     </xsl:for-each> 
  14.  
  15.     <!--Display the data for each element as a table row -->
  16.     <xsl:for-each select="$ProductNodes//product">
  17.     <xsl:sort select="prodid" order="ascending" />
  18.     <tr>
  19.         <xsl:for-each select="*" > 
  20.         <td><xsl:value-of select="text()" /></td>
  21.         </xsl:for-each>
  22.     </tr>
  23.     </xsl:for-each>
  24.     </table>
  25.  
  26.  
  27. </xsl:template>
  28.  
  29.  
  30. </xsl:stylesheet>