[Home] [By Thread] [By Date] [Recent Entries]
Raman Gupta wrote:
Close, but not close enough. This would be of interest to Mathieu Malaterre as well, if he is listening You are expressing: * Take all nodes [...] having preceding-sibling::g2 a sibling preceding myself and with the name 'g2' [...] having last() a position that is the last in the list (the list being "siblings preceding myself and with the name 'g2' ") This means in even better English: select all nodes that has a preceding sibling with the name 'g2'. In your statement, last() does not do anything and is redundant. This is just the same as when you would make the following xpath: some/node/*[childnode[last()]] Here, too, is last() meaning just the same as [1], or leaving out the predicate completely. BTW, having to select the last 'g2' in your English sentence means the g2 on the preceding/following sibling access, not being on the following sibling axis (i.e., not being in front of it). Expressed as: *[not(following-sibling::g2)] meaning: not having any following sibling of type g2. Which is basically what you said, I think. HTH, Cheers, -- Abel Braaksma
|

Cart



