hi I want to sort my data using XSl. I am using <xsl:sort select="*[name(.)=$SortCol]" order="{$SortOrder}" data- type="{$dataType}"/> this xommand for sorting But one of my column is of type date. so how do I specify the datatype for date. My date format is dd mon yyyy
On Mar 18, 9:56 am, Palwi wrote: > hi > I want to sort my data using XSl. I am using > <xsl:sort select="*[name(.)=$SortCol]" order="{$SortOrder}" data-> type="{$dataType}"/> > this xommand for sorting > > But one of my column is of type date. so how do I specify the datatype > for date. My date format is dd mon yyyy 1. you are using XSL 1.0 or 2.0? 2. If you are using xsl 1.0 this doesn't have datatypes like date, time, integer, etc. You split the date and sort it. e.g <xsl:sort select="substring-before(' ',date)" data-type="number"/> Regards, Balaji. M
Palwi wrote: > I want to sort my data using XSl. I am using > <xsl:sort select="*[name(.)=$SortCol]" order="{$SortOrder}" data- > type="{$dataType}"/> > this xommand for sorting > > But one of my column is of type date. so how do I specify the datatype > for date. My date format is dd mon yyyy XSLT 2.0 supports the xs:date data type but it has the format yyyy-mm-dd so you would need to reorder your date strings. With XSLT 1.0 you need to sort numbers or strings, you can do that also by reordering your date strings in the format yyyymmdd. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/