[Home] [By Thread] [By Date] [Recent Entries]
Terry Ofner wrote:
Your two template rules work well. However, I think I have managed to misrepresent the problem--one of the main pitfalls of submitting queries, it seems. This stylesheet should do: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template><xsl:template match="bodymatter"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:for-each-group select="*" group-starting-with="story[cluster_num]"> <level1 class="unit" unitnum="{position()}"> <xsl:for-each-group select="current-group()" group-starting-with="story[story-title]"> <xsl:choose> <xsl:when test="current-group()[1][self::story[story-title]]"> <level2 class="selection"> <xsl:apply-templates select="current-group()"/> </level2> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </level1> </xsl:for-each-group> </xsl:copy> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://JavaScript.FAQTs.com/
|

Cart



