简体   繁体   English

libxml2:如何按升序和降序对xmlNode结果进行排序?

[英]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 ? 有没有一种方法可以使用libxml2和C以升序或降序获取xpath结果?

Any help would be much appreciated. 任何帮助将非常感激。

No, this isn't possible with XPath 1.0. 不可以,这在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. 您要么自己对值进行排序(例如,使用C库函数qsort ),要么必须使用XSLT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM