Hi there,
I'm afraid, I am missing a point on "except" used in combination with
"current-group()".
I do not understand why my solution does not work.
Could anybody give me a hint, please?
XML:
<line>Part_1<tab />Part_2a <foo /> Part_2b<tab />Part_3</line>
Desired result of transformation:
G1: Part_1
G2: Part_2a -FOO- Part_2b
G3: Part_3
Meaning:
Get hold of the nodes that are separated by <tab> and forget about the
<tab> itself.
<xsl:apply-templates select="current-group()[not (self::tab)]" />
does the job.
But
<xsl:apply-templates select="current-group() except tab" />
does not work.
Why? Where is my mistake?
XSL: (Using Saxon 9HE)
<xsl:template match="line">
<xsl:for-each-group select="node()" group-ending-with="tab">
<xsl:text>
G</xsl:text><xsl:value-of select="position()"
/><xsl:text>: </xsl:text>
<xsl:apply-templates select="current-group() except tab" />
<!-- the following does work:
<xsl:apply-templates select="current-group()[not (self::tab)]" />
-->
</xsl:for-each-group>
</xsl:template>
<xsl:template match="tab">
<xsl:text>TAB</xsl:text>
</xsl:template>
<xsl:template match="foo">
<xsl:text>FOO</xsl:text>
</xsl:template>
Thanks in advance,
Norbert
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--