I'm trying to implement a feature that will allow a user to sort the websites by their language. The order of the websites should reflect the language, and the language should be sorted alphabetically. I'm completely stuck on how to do this.
So in theory it should probably look like this after a sort:

Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 9, 2011, 5:44 PM EDT
string strNewXML = newDoc.ToString();
This is what your code should be:
VulpesRank #55 · 29.2K reputationPosted Jun 8, 2011, 12:22 PM EDT
Otherwise it's not so easy and you'd need to know in advance what variations might arise to be able to come up with a sensible approach.
Mahesh ChandRank #1 · 393.3K reputationPosted Jun 8, 2011, 2:23 PM EDT
Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 8, 2011, 4:36 PM EDT
string strXML = ""
+ "
+ "
+ "
+ "
+ "
+ "
XDocument oXDoc = XDocument.Parse(strXML);
var newDoc = new XDocument(new XElement("websites",
from p in oXDoc.Element("websites").Elements("site")
orderby p.Attribute("language").Value
select p));
string strNewXML = newDoc.ToString();
The strNewXML string variable will have the sorted xml string.
Mahesh ChandRank #1 · 393.3K reputationPosted Jun 8, 2011, 6:49 PM EDT
Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 8, 2011, 9:10 PM EDT
Adam Turner55 reputationPosted Jun 9, 2011, 5:01 PM EDT
Here is what I have so far:
PopulateBoxes(); //you shouldn't have to worry about this, it just updates based on the order, but I'll post it below
/***************************************************/
Adam Turner55 reputationPosted Jun 10, 2011, 7:34 AM EDT