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

(Probably trivial) grouping problem

Subject: (Probably trivial) grouping problem
From: "Stefan Tilkov" <stefan.tilkov@xxxxxxxxx>
Date: Sat, 19 Jul 2003 09:49:28 +0200
xsl grouping preceeding
I can't for the life of me figure out how to solve a simple problem. I 
know that it is related to grouping, but my XSL (and XPath) knowlegde is 
not up to translating answers given to similar problems to my particular 
case. 

I have a couple of paragrahps, marked up this way:

<para title="title1">
        some text
</para>
<para>
        a para without a title
</para>
<para title="title2">
        more text
</para>
<para>
        yet another untitled para
</para> 

I want to turn them into this:

<section>
        <title>title1</title>
        <para>
                some text
        </para>
        <para>
                a para without a title
        </para>
</section>
<section>
        <title>title2</title>
        <para>
                more text
        </para>
        <para>
                yet another untitled para
        </para> 
</section>

That is, I want to create sections from paragraphs, turning the title into 
an element belonging to the section. My experiments with following-sibling 
and preceeding-sibling all had the problem that *all* paragraphs without a 
title were returned, and I somehow need to get access to only those before 
the next para with a title. 

Any help would be greatly appreciated.

Stefan

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.