You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the only way to add a sibling element is to append a child element to its parent:
currentElement.up().ele("siblingElement");
This works great if you're building a new XML document from scratch, but it makes it impossible to update an existing XML document in a manner which preserves order. Consider the following document:
<parent>
<child1 />
<child2 />
</parent>
If currentElement points to <child1 />, calling .up().ele("siblingElement") would result in this output:
Problem
Currently, the only way to add a sibling element is to append a child element to its parent:
This works great if you're building a new XML document from scratch, but it makes it impossible to update an existing XML document in a manner which preserves order. Consider the following document:
If
currentElement
points to<child1 />
, calling.up().ele("siblingElement")
would result in this output:Proposal
Add two new methods,
eleBefore
andeleAfter
, which would add a sibling element before/after the current element.The text was updated successfully, but these errors were encountered: