home *** CD-ROM | disk | FTP | other *** search
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" />
-
- <xsl:template match="/">
- <xsl:apply-templates select="/rs/z" />
- </xsl:template>
-
- <xsl:template match="z[position() mod 3 = 1]">
- <xsl:variable name="thisGroup"
- select=".|following::z[position() < 3]" />
-
- <table>
- <tr>
- <xsl:apply-templates select="$thisGroup" mode="header" />
- </tr>
-
- <xsl:for-each select="@*[name() != 'date']">
- <tr>
- <xsl:apply-templates select="$thisGroup" mode="row">
- <xsl:with-param name="breakfType" select="name()" />
- </xsl:apply-templates>
- </tr>
- </xsl:for-each>
- </table>
- </xsl:template>
-
- <xsl:template match="z" mode="header">
- <xsl:if test="position()=1">
- <td>Breakfast Type</td>
- </xsl:if>
-
- <td>
- <xsl:value-of select="@date" />
- </td>
- </xsl:template>
-
- <xsl:template match="z" mode="row">
- <xsl:param name="breakfType" />
-
- <xsl:if test="position()=1">
- <td>
- <xsl:value-of select="$breakfType" />
- </td>
- </xsl:if>
-
- <td>
- <xsl:value-of select="@*[name()=$breakfType]" />
- </td>
- </xsl:template>
- </xsl:stylesheet>
-
-
-