Search code examples
clibxml2

libxml2: How to sort xmlNode result in ascending and descending order?


Is there a way where I can get xpath result in ascending or descending order, using libxml2 and C ?

Any help would be much appreciated.


Solution

  • No, this isn't possible with XPath 1.0. You either have to sort the values yourself (using the C library function qsort, for example) or you have to use XSLT.