[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: mixed content grouping by whitespace

Subject: Re: mixed content grouping by whitespace
From: James Cummings <james@xxxxxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2010 10:52:30 +0100
Re:  mixed content grouping by whitespace
On Mon, Apr 12, 2010 at 01:19, G. Ken Holman
<gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> When I completed my solution I found it almost identical to yours, except
> that I used group-starting-with=. B I also could not think of a way to do
> in one pass.

It seems that when the solution requires a two pass one done all in
one stylesheet, I have difficulty getting my head around it. From what
I can see yours is basically similar to Gerrit's but uses an element
in a my: namespace.  You group starting with my:text (which surrounds
the whitespace)...

> B  B <xsl:for-each-group select="$content"
> B  B  B  B  B  B  B  B  B  B  B  B group-starting-with="my:text">
> B  B  B <xsl:copy-of select="self::my:text/node()"/>
> B  B  B <w>
> B  B  B  B <xsl:copy-of select="current-group()[not(self::my:text)]"/>
> B  B  B </w>
> B  B </xsl:for-each-group>

Where Gerrit took the value of current-group when the
current-grouping-key was a true boolean, you do a copy-of but then
select the nodes inside the self::my:text .... that confused me for a
bit and I'm not sure I don't see why you don't just do <xsl:value-of
select="self::my:text"/> (hrmm, that I say 'just' here is probably
unfair, they both work out as the same thing.) This works because
you're doing group-starting-with() so you know the first thing in the
group is the my:text node.

These things are  starting to make my brain melt less than previously,
which is a start I guess.

Many thanks!


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.