The select method returns an unordered Set and there is no way to reorder the returned nodes according to the order they appeared in the original document. This makes it harder to write programs that expect a particular order, like something that prints the <li> nodes in a <ol> or a program that reads data from the columns in a table row.
Maybe this isn't feasible for backwards compatibility reasons but, given the similarities to JQuery or BeautifulSoup I would expect select to return a list or ordered set. After that, if I wanted the old behaviour with sets it would just be a matter of creating the set explicitly with Set(element_list).
The
select
method returns an unordered Set and there is no way to reorder the returned nodes according to the order they appeared in the original document. This makes it harder to write programs that expect a particular order, like something that prints the<li>
nodes in a<ol>
or a program that reads data from the columns in a table row.Maybe this isn't feasible for backwards compatibility reasons but, given the similarities to JQuery or BeautifulSoup I would expect
select
to return a list or ordered set. After that, if I wanted the old behaviour with sets it would just be a matter of creating the set explicitly withSet(element_list)
.