DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: How do you sort an XML file?  (Read 4,247 times)

daddydave

  • test
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
    • Participated in NANY Challenge Once
How do you sort an XML file?
« on: June 23, 2010, 04:17 PM »
You have an XML file containing data. You have a frequent need to sort this XML file by various text elements within the XML file: last update time, name, category, image resolution, for example. How do you do it? (You can use a command line program or a GUI, or maybe there's some way to do this in Excel?)
« Last Edit: June 23, 2010, 04:20 PM by daddydave »

Veign

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 993
    • Gathering Badge
    • Participated in NANY Challenge Twice
Re: How do you sort an XML file?
« Reply #1 on: June 23, 2010, 04:22 PM »
Using XSL to Sort and Filter Your Data:
http://msdn.microsoft.com/en-us/library/ms950734.aspx

How to use XPath and Sorting in XML
http://www.developer.com/xml/article.php/1560361/How-to-use-XPath-and-Sorting-in-XML.htm

daddydave

  • test
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
    • Participated in NANY Challenge Once
Re: How do you sort an XML file?
« Reply #2 on: June 23, 2010, 04:49 PM »
Thanks Veign, that looks useful and reminded me of a powershell script I ran across when searching for ways to configure Intellitype (which also uses an xml file).

Original address: https://www.donationcoder.com/forum/index.php?topic=23185.0