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

Re: grouping problem

Subject: Re: grouping problem
From: Michael Ludwig <milu71@xxxxxx>
Date: Fri, 2 Apr 2010 17:16:43 +0200
Re:  grouping problem
Martin Honnen schrieb am 02.04.2010 um 14:07:31 (+0200):
> Michael Ludwig wrote:
> >Martin Honnen schrieb am 02.04.2010 um 12:06:46 (+0200):
> >
> >>      <xsl:for-each-group select="*" group-adjacent="self::ueberschrift 
> >>or self::absatz[matches(., 'I+\.')]">
> >>        <xsl:choose>
> >>          <xsl:when test="current-grouping-key()">
> >>            <xsl:copy-of select="current-group()"/>
> >>          </xsl:when>
> >>          <xsl:otherwise>
> >>            [...]
> >
> >It took me a while to understand this. I find it really clever!
> The matching of the roman number needs improvement I think, based on
> http://markmail.org/message/tw36hslmzf6fxw6w
> it could be changed to
> self::absatz[matches(., 
> '^M*(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\.$')]

Well, definitely - but that's not what I meant :-)

I had solved this using:

  @group-starting-with="absatz[ matches( . , '[IVXLCDM]+\.' ) ]"

for the outer group operation, in doing which I got trapped by the
semantics of the document. And then I had to deal with the special
case of the first group (<ueberschrift>), repeating the grouping

  <xsl:when test="self::absatz[ matches( . , '[IVXLCDM]+\.' ) ]">

Reading your post I realized that your approach was much better in that
it does the grouping according to the requirements of the processing
that needs to be done (set the nodes up up for an additional level of
grouping, or else copy them), and not (as mine does) according to the
semantics of the document.

Not sure I'm conveying my thoughts here - blame it on the Einbecker
Urbock I just had :-)

Frohe Ostern!
Michael Ludwig

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.