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

RE: Wrap changing element sequence into container: wit

Subject: RE: Wrap changing element sequence into container: with 'for-each-group'?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 30 Jan 2007 14:31:04 -0000
RE:  Wrap changing element sequence into container: wit
> What I am having trouble to do is adding a container around a specific
> (fixed-order) sequence of those `p4 elements, say,
> `p[style="a"]4 and `p[style="b"]4, where the first of these
> may not always occur.

I suspect you're giving an example rather than an exact specification, so
any solution you are given might not work.

If you can identify a comparison between two adjacent siblings which, if
true, means that they go in different containers, then you can use
group-starting-with. For example, in this case the condition might be that
the element is not immediately preceded by an element with a value for
@style that is alphabetically less than the current element's @style:

group-starting-with="p[not(preceding-sibling::p[1][@style lt

If that's not the case, then you'll have to tell us what the precise
specification of the problem is. There are of course some cases where you
will have to resort to sibling recursion.

Michael Kay

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.