From e789468531597875c9c171d0554230856d40a2b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 6 Aug 2014 13:56:08 +0200 Subject: [PATCH 1/1] wlxml: Node.find --- src/wlxml/wlxml.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index cb43f07..40ab196 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -106,6 +106,16 @@ $.extend(WLXMLElementNode.prototype, WLXMLDocumentNodeMethods, smartxml.ElementN 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), -- 2.20.1