point taken - didn't think of that However there is still a problem - I don' think the IdentityHashMap works correctly.
The following doesn't produce the correct result count(PLAY/ACT/SCENE[1] ) returns 1 when I take out the identity map I get 5 but then all the ancestor test fail! (obvious to me now ) So, I'll commit my version of the DefaultLocationPath as I'm pretty sure it is correct - can you look at the IdentityMap issue - all the ancestor test are currently broken Eddie ----- Original Message ----- From: bob mcwhirter <[EMAIL PROTECTED]> To: Eddie Mc Greal <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, May 03, 2002 3:51 PM Subject: Re: [Jaxen] DefaultLcationPath > 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 _______________________________________________________________ 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