Subject: Re: [xsl] Preceding siblings test From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Tue, 14 Sep 2010 17:23:13 +0200 |
I'm still a novice at XSLT and am having a problem coming up with a test for elements preceding a particular element, but only up to the first occurrence of the same (or parent) element. For example, in this XML:
<list> <a/> <item>...</item> <b/><b/><a/> <item>...</item> <item>...</item> <a/><a/> <item>...</item> </list>
Assume in this example, <a> and <b> elements can occur before each item (any number of each). When I start processing an <item>, how do I get a list of just those nodes before the first preceding <item> or parent <list> element?
It sounds however as if you might want to consider <xsl:for-each-group select="*" group-ending-with="item"> in a template matching the "list" element. That's also XSLT 2.0 however.
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Preceding siblings test, Hintz, David | Thread | Re: [xsl] Preceding siblings test, Hermann Stamm-Wilbra |
[xsl] Preceding siblings test, Hintz, David | Date | [xsl] [ANN] Release of SketchPath-P, Philip Fearon |
Month |