Re: [xsl] Flat to Structured: Handling List Items with Subordinate Paragraphs

Subject: Re: [xsl] Flat to Structured: Handling List Items with Subordinate Paragraphs
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 26 May 2009 17:08:55 -0400
Hi Eliot,

Yeah, sibling recursion was something we had to resort to before we had native grouping constructs, to allow XSLT to see structural relations where it only had contiguity.

These days, grouping-based solutions using group-adjacent, group-starting-with and group-ending-with are available; they are much easier to get one's head around and much much easier to abstract, generalize, encapsulate and maintain, which you are very much likely to want.

As a consequence, sibling recursion of the classic sort is hardly necessary in XSLT 2.0. Structural induction becomes a special kind of grouping problem.

Cheers,
Wendell

At 04:31 PM 5/26/2009, you wrote:
Hmmm--took me a minute to see the boolean(@container) in this line:

<xsl:for-each-group select="*" group-adjacent="boolean(@container)">

So that has the effect of creating a group for each continguous sequence of
contained things, which is certainly a characteristic I can impose on my
data (I control both the set of named styles and how they map to the
annotations added the <p> elements in the data being processed).

Given that, I think I should be able to process the group of contained
things with recursive for-each-groups.


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread