Subject: Re: [xsl] mixed content grouping by whitespace From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Tue, 13 Apr 2010 00:52:44 +0200 |
<xsl:for-each-group select="$sep/node()" group-adjacent="boolean(self::tei:seg[@type='sep'])">
This groups the nodes in the variable you've created by the boolean (so the truth or falsehood of whether the pattern matches? I didn't know you could do that in a group-* pattern) of the existence of the segs you've created on tei:seg/text() which mark the whitespace.
[1] http://www.w3.org/TR/xslt20/#err-XTTE1100 [2] http://www.w3.org/TR/xpath-functions/#func-boolean [3] http://www.w3.org/TR/xslt20/#d5e21264
<xsl:choose> <xsl:when test="current-grouping-key()"> <xsl:value-of select="current-group()" /> </xsl:when>
When it is one of those whitespace segs, then just put out the value of the whitespace, temporary element vanishes.
<xsl:otherwise> <w xmlns="http://www.tei-c.org/ns/1.0"> <xsl:apply-templates select="current-group()"/> </w> </xsl:otherwise>
Otherwise, wrap it in a word element.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] mixed content grouping by, James Cummings | Thread | Re: [xsl] mixed content grouping by, Wendell Piez |
Re: [xsl] The output of evaluating , G. Ken Holman | Date | [xsl] Assigning serial numbers, Siddhi Thakkar |
Month |