Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to sort values via XPath

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 8/24/2009 12:22:00 PM
Norbert Pürringer wrote:

> does anyone know how to get a sorted list of XML nodes via XPath? I
> know the function distinct-values but I there seems to be no function
> like sorted-values.

Pure XPath alone (at least in versions 1.0 and 2.0) does not provide any 
features to sort. However languages like XQuery or XSLT which make use 
of XPath provide features to sort, XQuery with the order by clause in 
FLWOR expressions (http://www.w3.org/TR/xquery/#id-orderby-return) and 
XSLT with the xsl:sort element (http://www.w3.org/TR/xslt20/#xsl-sort) 
and XSLT 2.0 additionally with xsl:perform-sort 
(http://www.w3.org/TR/xslt20/#creating-sorted-sequence).

Depending on the XPath API you use there might also be sorting features 
exposed for instance in .NET's XPath's API you can use 
http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathexpression.addsort.aspx

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent