p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: Date Format


Message #1 by "Basim Nawaz" <basim_nawaz@h...> on Thu, 20 Jun 2002 15:47:57 +0000
Split the date into three parts using substring-before() and
substring-after(). Format the day as two digits using format-number().
Convert the month name to a number either by using a 12-way xsl:choose
statement, or by looking the value up in a temporary tree:

<xsl:variable name=3D"months">
<january/><february/><march/>...
</xsl:variable>

<xsl:value-of
select=3D"count(xx:node-set($months)/*[name()=3D$m]/preceding-sibling::*)
+1"
/>

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...

> -----Original Message-----
> From: Basim Nawaz [mailto:basim_nawaz@h...]
> Sent: 20 June 2002 16:48
> To: P2P_XSLT
> Subject: [xslt] Date Format
>
>
> Hi Mike and all
> I have a problem with date format.
>
> Input xml files are auto..coming from another app. with date
> formate "d.
> Month(in Danish) yyyy". And my application must them save in
> Oracle database
> in Format "dd-mm-yyyy".
>
> Example:
> INPUT:
> <femdigi omr=E5de=3D"Hele landet">
> <udsendt_dato>
> 9. oktober 2001
> </udsendt_dato>
> ....
> </femdigi>
>
>
> Any suggestions?
> Regards
> Nawaz
>
> _________________________________________________________________
> Join the world=92s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
>


  Return to Index