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

Re: Flat to Structured: Handling List Items with Subo

Subject: Re: Flat to Structured: Handling List Items with Subordinate Paragraphs
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 May 2009 16:38:28 -0400
Re:  Flat to Structured: Handling List Items with  Subo
At 2009-05-26 15:31 -0500, Eliot Kimber wrote:
On 5/26/09 3:04 PM, "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:

>> Can anyone point me in the right direction?
>
> Consider the solution below.  I'm making assumptions like a container
> is defined by adjacent elements with @container, and that the
> container type is homogenous (so I only need to look at the first),
> and that list items are always of type 'li'.  It gives what you are
> asking for, but you may need to modify it based on a more precise
> definition of containers.

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,

Indeed. In my class I have an explicit example of this because some students have the preconceived notion that the adjacent values are somehow obliged to be user data, when in fact the adjacent values can be any calculated value.


And, then, I tell the students to read <xsl:for-each-group> as if it were written <xsl:for-the-first-member-of-each-group> so that they remember what node the current node is ... that way the first node can be processed directly and the others processed with current-group()[position()>1] ... there is no need to access current-group[1] because that is the current node.

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).

Excellent.


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

Yep!


Good luck.

. . . . . . . . Ken

p.s. for other readers, our Los Angeles class starts in less than two weeks and we still have room for late registrants (though the hotel is hounding us for catering numbers, so if you are interested, please let us know ASAP)


-- XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08 Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.