I am parsing and displaying an RSS feed in ASP Classic, and I would like to sort the items by a particular node alphabetically.
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load("http://myfeedhere.xml")
Set itemList = xmlDOM.getElementsByTagName("item")
''# Then I am getting the values of each node this way:
For Each item in itemList
For Each child in item.childNodes
Select case lcase(child.nodeName)
case "title"
title = child.text
case "link"
link = child.text
case "fname"
fname = child.text
case "lname"
lname = child.text
case "media:content"
media = child.getAttribute("url")
End Select
next
I need to sort the itemList by the lname” node, what is the best way to do this..
Adding the title and link to a dictionary object worked for me when I only needed two nodes. I called quicksort on the array of keys and then outputted accordingly. Further I have to be ready for duplicate last names which means the lastname cannot be the key.
With help and a big thank you to https://web.archive.org/web/20210125130007/http://www.4guysfromrolla.com/webtech/012799-3.shtml
for the two-dimensional quicksort function
I worked out a solution (besides telling the client to update to .net and C#)
…