[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Nested for-each-group and current-group()
Hi Martin, That was the issue. Thank you very much. I had to modify things to get the list nesting correct as well. Here is the finished template: <xsl:template match="/root"> <root> <xsl:for-each-group select="*" group-adjacent="if(self::topic) then 1 else 0"> <xsl:choose> <xsl:when test="current-grouping-key()=1"> <ol> <xsl:for-each select="current-group()"> <li> <xsl:for-each-group select="*" group-adjacent="if(self::subtopic) then 1 else 0"> <xsl:choose> <xsl:when test="current-grouping-key()=1"> <ul> <xsl:for-each select="current-group()"> <li> <xsl:apply-templates/> </li> </xsl:for-each> </ul> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </li> </xsl:for-each> </ol> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </root> </xsl:template> Rick
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|