in reply to Re: Re: Re: Re: Idea for XPath implementation
in thread Idea for XPath implementation
I still don't see why you'd need to access banana without full path. Is the idea that you want to find all properties that a banana has? For example, if banana occurs in both the colors branch and flavors branch, you want to know that bananas have both color and flavor (you'd also know what color and what flavor it is, too)my %lookup; add_node("/colors/banana"); sub add_node { my $fullpath = shift; my $leaf = (split '/', $fullpath)[-1]; push @{$lookup{$leaf}}, $fullpath; }
thor
|
|---|