|
Subject: Re: [xsl] Sibling recursion? From: "Norm Tovey-Walsh ndw@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 3 Mar 2022 16:23:07 -0000 |
> I would be grateful for any insights.
This seems to work, YMMV.
<xsl:template match="p">
<p>
<xsl:for-each-group select="node()"
group-adjacent="self::q or self::text()[normalize-space(.)='']">
<xsl:choose>
<xsl:when test="current-grouping-key()">
<q>
<xsl:for-each select="current-group()">
<xsl:if test="position() gt 1">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:sequence select="node()"/>
</xsl:for-each>
</q>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="current-group()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
</p>
</xsl:template>
Be seeing you,
norm
--
Norman Tovey-Walsh <ndw@xxxxxxxxxx>
https://nwalsh.com/
> We are at the very beginning of time for the human race. It is not
> unreasonable that we grapple with problems. But there are tens of
> thousands of years in the future. Our responsibility is to do what we
> can, learn what we can, improve the solutions, and pass them
> on.--Richard Feynman
[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Sibling recursion?, Eliot Kimber eliot.k | Thread | Re: [xsl] Sibling recursion?, David Birnbaum djbpi |
| Re: [xsl] Sibling recursion?, Eliot Kimber eliot.k | Date | Re: [xsl] Sibling recursion?, Graydon graydon@xxxx |
| Month |