in reply to Idea for XPath implementation

What happens if <banana> also had children of <good> and <bad>? Now you would have to search for and track back two chains... and when you add apple/orange etc., it gets slower and slower.

Also, a HoHoH... will always be considerably faster than a linear search of an array.


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Replies are listed 'Best First'.
Re: Re: Idea for XPath implementation
by Jaap (Curate) on Apr 01, 2003 at 11:02 UTC
    First all <bad>'s are searched for and traced back. In this way, you get all the query results.

    You make a good point about the slow linear search but as i mentioned in my post, i want to keep the idea clear so i didn't talk about optimisations. However, the order of the array is important for some XPath queries so we'd make a second - binary sorted - array for speed.