|
next
|
 Subject: Sort data-type problem Author: LZ Alex Date: 05 Aug 2005 05:03 AM
|
Hi guys, I hope you can help me because I was looking deeply for
a solution but no one for the moment. (Sorry for my english).
Let's see: I have a XSL StyleSheet which receives 10 parameters
coming from 10 <SELECT> on a web page where the user select
one by one, the fields he want the data (table) to be sorted.
At the begining I added 10 <sort> tags to the <for-each> loop
which process the data. That's ok.
After that, I find the "data types" problem: text, number and date fields.
I solved the problem with TEXT and NUMBER fields because I have
in one XML the metadata about each field including its data type and
I put an adequate XPATH expression in the "data-type" of each "sort" tag.
My problem is that I have to detect the "date" fields at runtime
to put an apropiate <sort> tag on the form:
<xsl:sort select="substring('date-field',7,4)" order="ascending" data-type="number"> <-- year -->
<xsl:sort select="substring('date-field',4,2)" order="ascending" data-type="number"> <-- month -->
<xsl:sort select="substring('date-field',1,2)" order="ascending" data-type="number"> <-- day -->
Let me know if you need more comments, code...
Please, help!! I'm becoming desperate...
|
|
|