XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2004, 01:44 PM
KayJayDK KayJayDK is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Denmark
Posts: 4 KayJayDK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to KayJayDK
XMLDOM sorting?

I have made an ASP script to parse a submitted form and appending the data to an XML file containing hyperlinks in the form

Code:
<?xml version="1.0"?>
<menu>
	<linkstotal>3</linkstotal>
	<link id="link1" title="mylink1" url="http://www.myplace.com/page1.asp"/>
	<link id="link2" title="mylink2" url="http://www.myplace.com/page2.asp"/>
	<link id="link3" title="mylink3" url="http://www.myplace.com/page3.asp"/>
</menu>


It just appends the submitted link to the list. However, I'd like to add categories and at the same time make the list sorted by category. I know you can sort the output in the XLS file but since I'm using ASP to output the links and would prefer to have the data already sorted when the script is run, I need a method to sort my XML data before saving the file.

Hope someone can help me or direct me to a place with some info.

Reply With Quote
  #2  
Old February 6th, 2004, 04:02 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
Sorry, you will have to load and parse the XML into an object in your ASP code. You will have to write something that sorts the elements in the object and creates a new XML document with the new link inserted in the correct order.

What is wrong with sorting on output?

Reply With Quote
  #3  
Old February 6th, 2004, 04:38 PM
KayJayDK KayJayDK is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Denmark
Posts: 4 KayJayDK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to KayJayDK
Thanks for the answer.

I was afraid that I might have to do it manually... oh well, not a big problem, but no need to write the code if it could be done automatically.

There's nothing wrong with sorting on output, it's just that I'll use the output on several pages on every pageview so it would be more efficient to have the sort done once and for all. Also to make the XML file more tidy if I'm going to edit it by hand for some reason at a later date.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XMLDOM sorting?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT