Cureent date
"Sathasivam, Elayaraja" <[email protected]> Thu, 7 Aug 2008 15:42:05 +0530
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <E72D281EC5EF2E44A0295DA9E02B36150174825C@BLREX002.corp.capgemini.com> |
XSLT: Version 1.0
Processor: Xalan-C_1_8_0-windows_2000-msvc_60
/xerces-c_2_5_0-windows_nt-msvc_60
Platform: Windows XP
If I want to print the current date with the format (Tue 2007 Nov 06
19:21:00 MET ), Is it mandatory to build xerces-C with ICU ? I would
like to do the job without using ICU. Is it possible...?????
TestCurrentDateFormat.xsl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [
<!ENTITY space "<xsl:text> </xsl:text>">
<!ENTITY tab "<xsl:text>	</xsl:text>">
<!ENTITY sep "<xsl:text>|</xsl:text>">
<!ENTITY cr "<xsl:text>
</xsl:text>">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date" version="1.0">
<xsl:output method="text"/>
<xsl:include href="date.format-date.template.xsl"/>
<xsl:template match="/">
<xsl:variable name="currentDate" select="date:date-time()"/>
<xsl:variable name="result">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time"
select="2008-08-02"/> <!-- to print current date replace the date as
$currentDate-->
<xsl:with-param name="pattern" select="'MMM
dd,yyyy'"/>
</xsl:call-template>
</xsl:variable>
<xsl:text>CurrentDate without format:</xsl:text> <xsl:value-of
select="$currentDate"/>&cr;
<xsl:text>CurrentDate with format :</xsl:text> <xsl:value-of
select="$result"/>&cr;
</xsl:template>
</xsl:stylesheet>
Output:
XSLT Warning: The function 'format-number()' is not implemented..Source
tree node: #document. (Line -1, column -1.)
XSLT Warning: The function 'format-number()' is not implemented..Source
tree node: #document. (Line -1, column -1.)
CurrentDate without format:2008-08-07T09:50:1706:00
CurrentDate with format :Jan 1,1998
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list