|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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? |
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XMLDOM sorting? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|