Opened 13 years ago

Last modified 11 years ago

#3590 closed enhancement

XmlStore: use dojo.query() more — at Initial Version

Reported by: bill Owned by: skinner
Priority: high Milestone: 1.3
Component: Query Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

This is nit-picking, but probably XmlStore::_getItems() should be changed to use dojo.query to get the nodes:

var nodes = dojo.query(this._rootItem || "*");

instead of

		if(this._rootItem){
			nodes = document.getElementsByTagName(this._rootItem);
		}
		else{
			nodes = document.documentElement.childNodes;
		}

And then also should use orphan:

return nodes.orphan(function(node){ ... });

rather than

		for(var i = 0; i < nodes.length; i++){
			var node = nodes[i];
			if(node.nodeType != 1 /*ELEMENT_NODE*/){
				continue;
			}
            var item = this._getItem(node);
...
			items.push(item);
		}
		for(var i in items){
			var element = items[i].element;
			element.parentNode.removeChild(element); // make it root
		}
		return items;

Change History (0)

Note: See TracTickets for help on using tickets.