Click to See Complete Forum and Search --> : Sorting tabular data


zynythyzer
01-22-2005, 11:24 AM
I am fairly new to XML and am going to build my first XML-driven site. What I was hoping to do was create a table which will be filled with about 500-1000 rows of data and span across 3 colums.

First column | Second column | Third column.

Now my question is if I click on "First column" can I sort the data in ascending alpha order? If I clicked on "Second column" can I then sort the data? The same for the third column.

In the past I've used a MySQL database to store other data and then call it up and sort it using PHP. Is such a thing possible using XML to sort data based on which column I click on?

Thanks for reading. :)

Khalid Ali
01-22-2005, 11:29 AM
yes 2 things you can do. Use php to parse xml file and sort it and re-display it.
Second is use JavaScript to already loaded contents to be sorted out and then re display the content

zynythyzer
01-22-2005, 11:30 AM
Any websites, documents, or tuturials you could point me to?

Khalid Ali
01-22-2005, 05:44 PM
you already mentioned that you did this using PHP so I guess you would be looking for a solution in JavaScript, post your question in JavaScript section and you will get allots of help...this has been answered and solution provided fo uncoutable times

zynythyzer
01-22-2005, 07:06 PM
Originally posted by Khalid Ali
you already mentioned that you did this using PHP so I guess you would be looking for a solution in JavaScript, post your question in JavaScript section and you will get allots of help...this has been answered and solution provided fo uncoutable times

I've used PHP to call up data from MySQL. But I've never worked with XML technologies and sorting data from an XML document.

I really don't care what language is used to accomplish sorting data this data as long as it is functional.

Thanks for any help.

AdamGundry
01-23-2005, 03:40 AM
Perhaps you could use the <xsl:sort> element (http://www.w3schools.com/xsl/el_sort.asp). You might need PHP or JavaScript to change the value of the select attribute.

Adam