}
}.bind(this));
return toret;
+ },
+ getContextRoot: function() {
+ var contextRoot;
+ [this].concat(this.parents()).some(function(n) {
+ if(n.isContextRoot()) {
+ contextRoot = n;
+ return true;
+ }
+ });
+ return contextRoot;
+ },
+ hasSameContextRoot: function(other) {
+ return this.getContextRoot().sameNode(other.getContextRoot());
}
};
return child.is(query);
}.bind(this));
},
+ find: function(query) {
+ var doc = this.document;
+ return this._$.find('*')
+ .map(function() {
+ return doc.createDocumentNode(this);
+ })
+ .filter(function() {
+ return this.is(query);
+ });
+ },
_getXMLDOMToDump: function() {
var DOM = this._$.clone(true, true),
};
WLXMLDocumentNode.prototype = Object.create(smartxml.DocumentNode.prototype);
-
var WLXMLTextNode = function() {
smartxml.TextNode.apply(this, arguments);
};