Remove Sibling Node Mixing

Issue: #197
This commit is contained in:
Josh Johnson 2018-06-12 21:46:48 -04:00
parent 61a07adb59
commit 289202d64b
1 changed files with 13 additions and 1 deletions

View File

@ -64,7 +64,19 @@ export class XmlTraverser {
}
getSiblings(node: Node): Node[] {
return [...this.getChildAttributeArray(<Element>node.parentNode), ...this.getChildElementArray(node.parentNode)];
if (this.isElement(node)) {
return this.getSiblingElements(node);
}
return this.getSiblingAttributes(node);
}
getSiblingAttributes(node: Node): Node[] {
return this.getChildAttributeArray(<Element>node.parentNode);
}
getSiblingElements(node: Node): Node[] {
return this.getChildElementArray(node.parentNode);
}
hasSimilarSiblings(node: Node): boolean {