1<?xml version="1.0"?> 2 3<!-- the slow way... --> 4 5<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 6 7<xsl:output encoding="utf-8"/> 8 9<xsl:template name="getsku"> 10 <xsl:if test="position() != 1"> 11 <xsl:text>, </xsl:text> 12 </xsl:if> 13 <xsl:value-of select="sku"/> 14</xsl:template> 15 16<xsl:template match="categories/category"> 17 <tr> 18 <td><xsl:value-of select="name"/></td> 19 <td> 20 <xsl:for-each select="//products/product[category=current()/id]"> 21 <xsl:call-template name="getsku"/> 22 </xsl:for-each> 23 </td> 24 </tr> 25</xsl:template> 26 27<xsl:template match="/"> 28 <html> 29 <table border="1"> 30 <xsl:apply-templates select="//categories/category"/> 31 </table> 32 </html> 33</xsl:template> 34 35</xsl:stylesheet>