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 61a07ad commit 289202dCopy full SHA for 289202d
src/common/xml-traverser.ts
@@ -64,7 +64,19 @@ export class XmlTraverser {
64
}
65
66
getSiblings(node: Node): Node[] {
67
- return [...this.getChildAttributeArray(<Element>node.parentNode), ...this.getChildElementArray(node.parentNode)];
+ if (this.isElement(node)) {
68
+ return this.getSiblingElements(node);
69
+ }
70
+
71
+ return this.getSiblingAttributes(node);
72
73
74
+ getSiblingAttributes(node: Node): Node[] {
75
+ return this.getChildAttributeArray(<Element>node.parentNode);
76
77
78
+ getSiblingElements(node: Node): Node[] {
79
+ return this.getChildElementArray(node.parentNode);
80
81
82
hasSimilarSiblings(node: Node): boolean {
0 commit comments