|
Subject: Re: [xsl] Nested for-each-group and current-group() From: "Rick Quatro rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 11 May 2020 15:43:23 -0000 |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Nested for-each-group and, Martin Honnen martin | Thread | Re: [xsl] Nested for-each-group and, Wendell Piez wapiez@ |
| Re: [xsl] Nested for-each-group and, Martin Honnen martin | Date | Re: [xsl] Nested for-each-group and, Wendell Piez wapiez@ |
| Month |