Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - Re: [xsl] select immediately following siblings with constraints? [Thread Next] RE: [xsl] select immediately following siblings with constraints?To: Date: 2/23/2006 7:14:00 PM > XPath gives > no way to look along an axis up to a particular point and no further. > (Well, actually I shouldn't say this categorically about XPath 2.0 > without giving it some good hard thought first, or inviting others to > demonstrate a method. :-) Let's say you want all the nodes on a forwards axis X up to and excluding the first one that satisfies condition PRED. Then you can write for $stop in x::node()[PRED][1] return x::node()[.<<$stop] substituting >> if it's a reverse axis. If you want to include the stop node, return (x::node()[.<<$stop], $stop) It's not vastly elegant - this is one of those things that could have been done so much better with higher-order functions - but it's workable. It's not too difficult to optimize, either, though Saxon doesn't attempt this currently. Michael K | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
