Subject:last node in preceding-sibling Author:cauchy ke Date:04 Apr 2007 11:14 PM
Hi, I use this to search the receding-sibling node:
preceding-sibling::Macro[@name='file' and last()]/family/firstname
but the problem is it will return all the preceding sibling and position on the first node. What I want is the last node, which means the node very close the self.
Subject:last node in preceding-sibling Author:(Deleted User) Date:05 Apr 2007 03:56 AM
Hi,
if you want the closest node to the context node you should not use last(), but position()=1 (preceding-sibling is a reverse axis.
But placing the check in "and" with a test for an attribute value will match only if the previous node is a match; if you want to select the closest match, you will have to split the predicate in two