[Home] [By Thread] [By Date] [Recent Entries]
Michael Terry wrote:
I think I misunderstood what becomes the context node. Take the first one I mentioned: In XSLT 2.0 there are a couple of provisions that make it a bit easier to create an XPath. But in 1.0, it is just about what you say: the context node at any given point is the one that is selected. How would you know whether it needs the position() of first element, the second, the third? You can use, however, a predicate, which translates freely like "having" in SQL. In this case, the contextnode is the one that the predicate is making a selection about. following has context node * for position() a/b/c/*[position() = 2] following has context node c for position() a/b/c[position() = 2]/* following has context node a for position(), but beware, it is in the third predicate, so it counts only the subset selected by the earlier predicates. a[count(b/c/*) = '12'][b[@x = 'rr']][position() = 2] HTH, -- Abel Braaksma
|

Cart



