Skip to main content
Windward

What parameter created by Autotag makes the Java engine 12.x sort data in a forEach?

Overview

If you are not using AutoTag, adding the following parameter to an XPath select will sort data in a forEach.

 

Resolution

Ascending Xpath Sort 
Xpath: adding the clause “order by NODENAME” to the Xpath statement will add a sort

 

Descending Xpath Sort: 
Xpath: adding the clause “order by NODENAME descending” to the Xpath statement will add a sort

 

Multiple Node Xpath Sorting 
Sorting on REGION node first and then sorting on LASTNAME node after both using descending sort. If you wish to use ascending, simply remove the text “descending” after each node name. Nodes are separated by commas if you wish to have multiple sorts. 
Xpath: adding the clause “order by NODENAME descending, NODENAME descending” to the Xpath statement will add a sort