Skip to content

Commit

Permalink
Remove Sibling Node Mixing
Browse files Browse the repository at this point in the history
Issue: #197
  • Loading branch information
DotJoshJohnson committed Jun 13, 2018
1 parent 61a07ad commit 289202d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/common/xml-traverser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 289202d

Please sign in to comment.