Hi,
On Fri, 02 Jun 2006 21:54:32 +0200, ion <> wrote:
> Hi! I'm struggling with doing this in an elegant wayI'd like to get the
> complete list of bippities, then compare the
> bippities of each broomstick to them, and make a mark for each present
> member of the complete set of bippities in a particular broomstick,
> like
I have no idea if this will conform to your idea of elegance (it uses
plain dumb for-each loops), but this solution seems to work:
<xsl:stylesheet version="1.0"
xmlns

sl="http://www.w3.org/1999/XSL/Transform">
<xsl

utput method="xml" indent="yes"/>
<xsl:key name="b" match="bippity" use="."/>
<xsl:variable name="bip"
select="//*[generate-id()=generate-id(key('b',.)[1])]"/>
<xsl:template match="bedknob">
<table>
<thead>
<tr>
<xsl:for-each select="$bip">
<th><xsl:value-of select="."/></th>
</xsl:for-each>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="broomstick"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="broomstick">
<xsl:variable name="this" select="bippity"/>
<tr>
<xsl:for-each select="$bip">
<td>
<xsl:if test=".=$this">X</xsl:if>
</td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>
regards,
--
Joris Gillis (
http://users.telenet.be/root-jg/me.html)
Veni, vidi, wiki (
http://www.wikipedia.org)