[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 16:43:52 -0500
Re:  Flat to Structured: Handling List Items with  Subo
On 5/26/09 4:20 PM, "Michael Kay" <mike@xxxxxxxxxxxx> wrote:

> 
> I haven't followed the thread closely, but I would tackle the above by first
> using group-starting with to build the levels

I have now a solution that appears to be working using grouping. I
simplified things (I think) by putting the group of adjacent things into a
temporary container element so I could then do preceding and following
sibling checks that would be scoped to my group.

Given that, I then have a recursive template that takes a sequence of
paragraphs, the current container, and the level.

Given that information, I can know whether or not to start a new container
and how to select the groups within the input sequence.

For recursive calls I construct the context like so:

following-sibling::*[(@level = $level + 1) and
                     preceding-sibling::*[@level = $level][1][. is $me]]

Where $me is the current node that "contains" the following nodes.

There's probably a more elegant way to do this, but it seems to work for my
real input data.

Thanks to all for helping me work this out.

Cheers,

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

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.