2 ms·
> How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing! I tried. It got tiring. Sometimes peo
by shaftway 6y ago
> How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing!
I tried. It got tiring. Sometimes people would loop through all possible priorities plugging them into an XPath query and pop the first element of the highest priority that matched. Some would do two XPath queries, one across all nodes to get the max priority and a second to query the first element (ignoring the lack of a need to run the query a second time at all). Some would insist that XPath has some function that would let you select a node with an attribute that has the maximum numeric value.
I'd have been fine with your solution.