Computing.Net > Forums > Programming > XML file rearrangement

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

XML file rearrangement

Reply to Message Icon

Original Message
Name: ShaqDiesel
Date: July 31, 2006 at 10:43:09 Pacific
Subject: XML file rearrangement
OS: blah
CPU/Ram: blah
Model/Manufacturer: blah
Comment:

How do I order an XML file by its timestamp tag? I have an xml file with content that is in a mixed timestamp order, and I want to rearrange the file based on the time and date in its timestamp tag in ascending order. Thanks.


Report Offensive Message For Removal


Response Number 1
Name: Guy
Date: August 4, 2006 at 15:56:19 Pacific
Reply: (edit)

Well, you will have to write some code to do that.

What blah language are you thinking about?

Maybe think about XSLT?

Guy


Report Offensive Follow Up For Removal

Response Number 2
Name: StreamLogic
Date: August 6, 2006 at 15:36:49 Pacific
Reply: (edit)

ShaqDiesel,

There are a couple options here. As Guy mentioned, you can definitely use XSLT to create a new XML file which is sorted. Look into using <xsl:sort/> within the XSLT file and making the output file XML rather than HTML, etc.

The second option is to use the XML DOM. This would give you the most control and you could simply run a quicksort on the attribute or element which needed to be sorted, then write a new XML once all elements are sorted.

Hope this helps point you in the right direction.


Curtis Hughes
StreamLogic Inc.
http://www.streamlogicinc.com


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software