StXPathSortNodeSet(XPath, locale, type, num_order);
XPath
locale
The locale ID string to use for sorting. If you leave this empty, the default locale is used.type
0 – Text sorting1 – Numeric sortingorder
0 – Ascending1 – DescendingSorts the node set that has been pushed onto the data context memory stack. The sorting is performed based on the provided parameters.If you want to sort the node set using different sort keys, you can invoke the function mutliple times. Becuase the sorting is stable, the order is preserved unless each sorting changes the order of the nodes. This means that for each sorting operation the result from the previous sorting is considered the original order.For the desired result, the sorting operations must be done using the least significant sorting key first, and the most significant last. For example, you want to primarily sort countries, but you also want to sort the cities within a country. Then you must sort the cities first, and then the countries.StXPathPushNodeSet("/data/message/item[number(value)>100");StXPathSortNodeSet("item_description", "en-US", 0, 0);StXPathSortNodeSet("value", "", 1, 1);while(StXPathNextPosition()){log(1, StEvalXpath("item_description"));}StXPathPopNodeSet();
OpenText StreamServe 5.6 | Updated: 2013-03-01 |