David Carlisle wrote:
//CELL[position() =
count(../following-sibling::ROW[1]/CELL[(_at_)test='yes']/preceding-sibling::CELL)]/following-sibling::CELL[1]
yes that's simpler, but I think it needs to be
//CELL[position() = 1 +
count(../following-sibling::ROW[1]/CELL[(_at_)test='yes']/preceding-sibling::CELL)]
as if the test node is a first child you want the first child (that is
position()=1) rather than the first sibling of the node with
position()=0 (as there is no such node).
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[(_at_)test='yes']/preceding-sibling::CELL
| ../following-sibling::ROW[1]/CELL[(_at_)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[(_at_)test='yes']
must be then changed in
CELL[(_at_)test='yes'][1]
or whichever number the OP prefers
-- Abel
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--