[Home] [By Thread] [By Date] [Recent Entries]
David Carlisle wrote:
//CELL[position() = count(../following-sibling::ROW[1]/CELL[@test='yes']/preceding-sibling::CELL)]/following-sibling::CELL[1] No, not exactly, because that will also select the first CELL of each block (the '+ 1', which in your original solution could safely be used, but not here, because now it is always at least one, and never zero). But you are right as well for the corner case where the test is on position=1, which means that unfortunately I have to put in the self-test again (darn, why do they have ancestor:: | ancestor-of-self | descendant:: | descendant-or-self but not preceding-sibling:: | preceding-silbing-or-self:: etc ?). //CELL[count(../following-sibling::ROW[1]/CELL[@test='yes']/preceding-sibling::CELL | ../following-sibling::ROW[1]/CELL[@test='yes'])] And what happens if we have multiple @tst='yes'? Can that happen? In that case, all our predicates, in either solution should be changed, i.e. each: CELL[@test='yes'] must be then changed in CELL[@test='yes'][1] or whichever number the OP prefers -- Abel
|

Cart



