We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 088e2a7 commit 8397398Copy full SHA for 8397398
lib/xmldoc.js
@@ -131,6 +131,20 @@
131
}
132
return undefined;
133
};
134
+
135
+ XmlElement.prototype.descendantsNamed = function (name) {
136
+ var matches = [];
137
138
+ for (var i = 0, l = this.children.length; i < l; i++) {
139
+ var child = this.children[i];
140
+ if (child.type === "element") {
141
+ if (child.name === name) matches.push(child);
142
+ matches = matches.concat(child.descendantsNamed(name));
143
+ }
144
145
146
+ return matches;
147
+ };
148
149
XmlElement.prototype.descendantWithPath = function (path) {
150
var descendant = this;
0 commit comments