xsl-list
[Top] [All Lists]

RE: [xsl] Wrap changing element sequence into container: with 'for-each-group'?

2007-01-30 07:31:26
What I am having trouble to do is adding a container around a specific
(fixed-order) sequence of those `p´ elements, say, 
`p[style="a"]´ and `p[style="b"]´, 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][(_at_)style lt
current()/@style])]"

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
http://www.saxonica.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>
--~--

<Prev in Thread] Current Thread [Next in Thread>