xsl-list
[Top] [All Lists]

Re: [xsl] "Line"-Tokenizing at <br/> in xhtml

2006-11-07 08:16:09
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/ 
  


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

<Prev in Thread] Current Thread [Next in Thread>