[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: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Tue, 26 May 2009 15:51:19 -0500
Re:  Flat to Structured: Handling List Items with  Subo
On 5/26/09 3:38 PM, "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:

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

I don't think it's quite as easy as my sample data suggested.

Once I have a group of contained things, there's no guarantee that the
first-level containers are homogenous.

For example, I could have an ordered list followed by an unordered list,
which would give a group like:

<p type="li" container="ol" level="1">
<p type="p" container="li" level="2">
<p type="li" container="ol" level="1">
<p type="p" container="li" level="2">
<p type="li" container="ul" level="1">
<p type="p" container="li" level="2">

Where the result should be:


I don't see a way to get that result using group-starting-with on the group

But I think that sibling recursion might be more tractable on the group
members since I don't have to worry about excluding elements that don't have
a container at all.


Eliot Kimber | Senior Solutions Architect | Really Strategies, Inc.
email:  ekimber@xxxxxxxxxxxx <mailto:ekimber@xxxxxxxxxxxx>
office: 610.631.6770 | cell: 512.554.9368
2570 Boulevard of the Generals | Suite 213 | Audubon, PA 19403
www.reallysi.com <http://www.reallysi.com>  | http://blog.reallysi.com
<http://blog.reallysi.com> | www.rsuitecms.com <http://www.rsuitecms.com> 

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.