Re: Positional predicates in pattern matching
Thanks for your quick reply David, > your modes one and two are identical as the only difference is > [true()] but a filter of [true()] never does anything. Yes, that was deliberate just to create two predicates. I understand why you get P2P3 instead of what you might have expected, i.e. P1P2. The problem I think I am having is the standard says that is only for the first predicate. So if I move my test to the second predicate, in this case by inserting a dummy [true()], then the position should no longer be taken a relative to the parent. To quote Michael Kay from the bottom of page 442 in the 2nd edition of the XSLT Programmers Reference, "If there are several predicates in the StepPatten, then position() and last() in predicates after the first apply to the nodes that survived the previous predicates" Kev.
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