Why am I getting all those element a's which have value 2 and 3.
Can anybody pls help
Joined: Aug 25, 2003
Try replacing the preceding with 'preceding-sibling' to get the desired result.
Joined: Jun 23, 2005
Actually, when you use //a[preceding::a=.] you are looking for all <a> elements which have another preceding <a> element with the same value (by preceding I mean: happens before in the xml document). Here why you get those results: