Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Timestamp formatting in XSLT [Thread Next] Re: Timestamp formatting in XSLTTo: NULL Date: 10/23/2009 5:01:00 PM jai wrote: > I have a dateTime format as an XML element (<PDFTIMESTAMP>2009-10-09 > 13:10:58.00000</PDFTIMESTAMP>). This dateTime format is not accepted > by XSLT 2.0 using Saxon 9. > > I came to know that 2009-10-09T13:10:58.00000 is proper format for > dateTime. > > I actually do a sort using PDFTIMESTAMP inside a for-each loop as > below: > > <xsl:for-each-group select="current-group()" group-by="RECEIPTTYPE"> > > <xsl:sort select="max(PDFTIMESTAMP/xs:dateTime(.)" > order="descending"/> > > In xs:dateTime(.), the issue is comming as format of current dateTime > is not correct. If the XML element's value cannot be corrected to > acceptable format, what can i do to convert the the improper dateTime > comming in xs:dateTime(.) to work? If only the 'T' is missing then you can certainly do e.g. <xsl:sort select="max(PDFTIMESTAMP/xs:dateTime(concat(substring(., 1, 10), 'T', substring(., 11))))"/> -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
