Re: [xsl] Conditional in-context nodeset variables

Subject: Re: [xsl] Conditional in-context nodeset variables
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 3 Jan 2008 16:38:50 +0000
On 03/01/2008, Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx> wrote:
> yep - it small simplified part of big code (more precisely - just testcase),
> i don`t use since it make my code behavior like it use pull model,
> but i am trying to use push model - maybe it wrong & i just not
> familiar with grouping,
> i feel myself with this task like cow on ice :)

a cow on ice... :)

Don't worry too much about push and pull - for grouping you have to
use pull - and for-each-group is excellent (like most things in XSLT
once you 'get' them)

Here's an example using for-each-group with group-ending-with:


    <xsl:output indent="yes"/>

    <xsl:variable name="input">

    <xsl:template match="/">
        <xsl:for-each-group select="$input/div/*" group-ending-with="h1|h2">
                <xsl:copy-of select="current-group()"/>


It generates this output:


Is that what you were after?  If not, modify the input and and
required output and post back.

Andrew Welch

Current Thread