Ron, this is in .net C#, this is not sorting in xslt sorry for the confusion
but at this point i have come to believe it is not possible to sort an iterator except for putting it all into new sortable structure by going over every item in the iterator...
the way i see it in the article, i still need to go over my iterator to pump the xml back into an xdocument in order to sort it with the linq functionality
and secondly, but probably more difficult to ignore, the site runs in a 2.0 environement. this technique will probably only work on 3.5.
sorting content of a xpathnodeiterator returned by getXmlNodeByXPath...
hi, when working with xml documents, i am used to creating a navigator, and applying sort on it trough an xpathExpression in c#
but the umbraco library function getXmlNodeByXpath returns an iterator already, is there a way to sort this return value?
best regards
Sander
Have you tried <xsl:sort> http://www.w3schools.com/xsl/el_sort.asp
Ron, this is in .net C#, this is not sorting in xslt sorry for the confusion
but at this point i have come to believe it is not possible to sort an iterator except for putting it all into new sortable structure by going over every item in the iterator...
Have you considdered using linq to xml?
http://mstanciu.blogspot.com/2008/08/sorting-elements-in-xml-document.html
When using C# I always prefer to use Linq to Xml
You can load the contents of your iterator using XDocument.Parse(
i will give it a shot first thing in the morning, or maybe if i find some time tonight.
thanks for the input and i'll get back to this post after trying it out.
i'm back quicker than i tought,
2 remarks:
You can use:
If you can't install 3.5 this technique is useless indeed.
Some other code you can use instead of getXmlNodeByXpath :
Ron
is working on a reply...