Re: if a condition is not met
Indeed and same here.
With the solution of George C. Bina in mind, I wanted to give the XSLT 2.0 approach a new try. Well, it ends up somewhere high in the obfuscated code bin, I believe. Here's the tree-walking algorithm from George applied in a single XPath 2.0 expression:
times/time[@time = ../../cells/cell[last()]/@endTime]/following-sibling::* |
times/time[@time = ../../cells/cell/@startTime]/preceding-sibling::* |
times/time[@time = ../../cells/cell[@endTime != following-sibling::*/@startTime]/@endTime]
[@time = ../../cells/cell[@startTime != preceding-sibling::*/@endTime]
I leave the explanation of this monster as an exercise to the reader ;) I just wanted to find out whether the OP's request was doable on one line (and I am sure it can be done more concise and hopefully without the expensive 'except' operator, I tried '>>' etc, but had some context-node problems).
Cheers, -- Abel Braaksma
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format