[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] "Line"-Tokenizing at
in xhtml


Subject: Re: [xsl] "Line"-Tokenizing at <br/> in xhtml
From: Georges Schmitz <georges.schmitz@xxxxxxxxx>
Date: Tue, 07 Nov 2006 16:15:43 +0100

Many thanks to both of you!

Until now I just used normal group-by attribute of <xsl:for-each-group>,
it is never to late to learn new approaches :-).

But I have still a question: I don't understand how the use of
group-starting-with="br" delivers also the first line in my example? In
my greenness I would have expected that 3 <br/> elements give me 3
groups (indeed I get 4 groups and the result is the same as if I had a
sort of tokenizer on <br/>, which is exactly the solution I was
searching for). I can't find an explanation to this in the examples of
http://www.w3.org/TR/xslt20/#element-for-each-group.

Regards,
Georges

Michael Kay wrote:
> So long as the <br/> elements are children of the <p> element (not
> descendants), you can use
>
> <xsl:for-each-group group-starting-with="br">
>
> This will include the br element as a member of the group, but you can
> easily lose it using
>
> current-group()[not(self::br)]
>
> (You can use group-ending-with="br" as well, but if you drop the br elements
> the effect is identical).
>
> Michael Kay
> http://www.saxonica.com/ 


Current Thread