Rank: Advanced Member
Groups: Registered
Joined: 6/23/2015(UTC) Posts: 59  Thanks: 5 times
|
Is there a chance to sort a tree internally not using a server request? If so, does any example exist in the docs? Thanks
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 484
Was thanked: 81 time(s) in 81 post(s)
|
Yes, it is possible. You can do it with Append Node command by appending sorted nodes to the same tree.
For example, given the tree structure $PERSISTENT/Root/Nodes/@name in order to sort the Nodes within the Root element, I would use
Append to Node $PERSISTENT/Root new Nodes for $i in $PERSISTENT/Root/Nodes order by $i/@name return $i as last Child [x]remove appended nodes from their current location
By checking the "remove appended nodes" you basically reappend the same sorted nodes and remove the existing ones at the same time.
|
 1 user thanked bbv for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/23/2015(UTC) Posts: 59  Thanks: 5 times
|
Great, thanks for helpful sample!
|
|
|
|
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.