xsl-list
[Top] [All Lists]

Re: [xsl] mixed content grouping by whitespace

2010-04-12 04:53:07
On Mon, Apr 12, 2010 at 01:19, G. Ken Holman
<gkholman(_at_)cranesoftwrights(_dot_)com> wrote:
When I completed my solution I found it almost identical to yours, except
that I used group-starting-with=.  I also could not think of a way to do it
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)...

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

-James

--~------------------------------------------------------------------
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>
--~--