From my testing, it appears that dojo's query() function only selects from among elements that are part of a page's DOM.
For example, suppose I have a node named rootNode that has some number of descendents with the class someClass. This code:
var nodeList = query(".someclass", rootNode);
will return an empty NodeList if rootNode has been removed from the DOM (but, of course, if rootNode is part of the DOM, it will return all the nodes with class someClass.
My question: is there a way to use query() in this situation? If not, what is the preferred way for handling this? It looks to me like some of NodeList's methods can be used with a filter(remove and place), but that's not quite the same.