On Fri, 3 May 2002, Eddie Mc Greal wrote: > after furter investigation I found the following > the reason for the change (1.8 to 1.9) was the following xpath > > count(/PLAY/ACT/SCENE[1]) should be 5 and not 1. > However, the fix for this problem (made by xcut) is incorrect. > The problem is the use of the unique map to filter out identical nodes but >/PLAY/ACT/SCENE produces several SCENE nodes. Only adding the first one leads to the >bug that count only finds 1 instead of 5. > I've removed the unique map (any objections? why was it used in the first place?) >and checked it in. All test pass including count(/PLAY/ACT/SCENE[1])
The IdentityHashMap? That's there, because of things involving '..'. /PLAY/ACT/.. That selects the ACTs, obviously, and then their parents. Typically, a play has 5 ACTs, so then we're looking at 5 instances of the PLAY parent. Being a node-set (instead of a node-bag), we have to eliminate the duplicate instances of PLAY. The Map, if its the one I'm thinking of, though, should be an IdentityHashMap, which would allow 5 different ACT elements in it, as long as they were not the same instance. (It uses the identity hashCode and ==, instead of hashCode() and equals()). So, I guess the test we need is that: count(/PLAY/ACT/SCENE/../..) == 1 or count(/PLAY/ACT/SCENE/..) == 5 -bob _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest