xsl-list
[Top] [All Lists]

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

2009-05-26 17:44:19
On 5/26/09 4:20 PM, "Michael Kay" <mike(_at_)saxonica(_dot_)com> 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::*[(_at_)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(_at_)reallysi(_dot_)com <mailto:ekimber(_at_)reallysi(_dot_)com>
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> 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--