@B.Wilson I don't understand your original point in context of this. Any elements may not have relation to each other, but in the internal structure of the namespace the order of the elements will reflect the order in the HTML document.
@B.Wilson Yes, getting all elements by an attribute is a similarly simple incantation. In-fact if that is the primary operation the most optimal data-structure would be a flat array of elements an and array of node depths.
@finooiigee Point is that round-tripping HTML through a parser needs to preserve the order on child elements, e.g. like if an img comes after a p or whatever. I guess you're saying that this will be true, but that the order data isn't accessible to the user. So it's not possible to ask a namespace whether an img comes before or after a given p, right?
Anyway, you're probably right that I've pushed this inquiry past the original intent. Was just wondering your reason for using namespaces as a data structure rather than arrays, and I think I grok your jibe.