home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template name="DisplayProds">
- <xsl:param name="ProductNodes" select="." />
-
- <h1>Product Listing for <xsl:value-of select="$ProductNodes//@region" /> region</h1>
-
-
- <!--Display the headings for each element as a table header -->
- <table border="1">
- <xsl:for-each select="$ProductNodes//products/product[1]/*" >
- <th><xsl:value-of select="name(.)"/></th>
- </xsl:for-each>
-
- <!--Display the data for each element as a table row -->
- <xsl:for-each select="$ProductNodes//product">
- <xsl:sort select="prodid" order="ascending" />
- <tr>
- <xsl:for-each select="*" >
- <td><xsl:value-of select="text()" /></td>
- </xsl:for-each>
- </tr>
- </xsl:for-each>
- </table>
-
-
- </xsl:template>
-
-
- </xsl:stylesheet>