RE: [xsl] Date formatting using XSLT extensions functions

Subject: RE: [xsl] Date formatting using XSLT extensions functions
From: David.Pawson@xxxxxxxxxxx
Date: Mon, 28 Apr 2003 14:21:06 +0100
How about identifying the source of the date?
That way you could fix its format and deal with it.

No software I know of would take (almost) a random
string and figure it out as a date?

Otherwise, use whatever language your processor has
access to and parse the string char by char in
an external function.

xslt 2 has date functions, but they won't help you
if you don't know what format they are in.

regards DaveP



> Thanks for the suggestion; I'm sure I'll use some aspects of it.
> However, rather than parsing the date as a string value, i.e. the
> characters at position 4 and 5 equate to the month, I was 
> hoping to deal
> with the date as a proper date. The reason for this is 
> because different
> databases have ever so slightly different ideas of what a date looks
> like, but the date handling objects in the scripting 
> languages appear to
> deal with this. For instance a date could appear in any of 
> the following
> formats:
> 
> 	- 13/03/2003 4:58:32 pm
> 	- 2003-03-13 16:58:35
> 	- March 13, 2003
> 
> 
> As you see simply parsing the date would give unexpected results, even
> though the dates validate OK using the VBScript IsDate() function.
> Besides, I suppose I'd like to know what I'm doing wrong when calling
> the extension function.
> 
> Thanks again for your feedback.
> 
> 
> Kaine
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

- 

NOTICE: The information contained in this email and any attachments is 
confidential and may be legally privileged. If you are not the 
intended recipient you are hereby notified that you must not use, 
disclose, distribute, copy, print or rely on this email's content. If 
you are not the intended recipient, please notify the sender 
immediately and then delete the email and any attachments from your 
system.

RNIB has made strenuous efforts to ensure that emails and any 
attachments generated by its staff are free from viruses. However, it 
cannot accept any responsibility for any viruses which are 
transmitted. We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email 
and any attachments are those of the author and do not necessarily 
represent those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread