|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Formatting Numbers and Dates
Howdy,
Are there builtin ways (methods) available in XSL to format
numbers and Dates? With IE5, I could use formatNumber()
and formatDate() methods (as shown below). But this
apparent extenstion (<xsl-eval>) makes the style sheet not
portable.
/* DATE_F - contains a unix time() value */
<xsl:apply-templates select="DATE_F">
<xsl:template match="DATE_F">
<TD align="center">
<FONT size="2"><xsl:eval>formatDate(new
Date(parseInt(this.text) * 1000).getVarDate(), "MMM dd
yyyy")</xsl:eval></FONT>
</TD>
</xsl:template>
</xsl:apply-templates>
/* NUM_F contains a decimal, with no
trailing zeroes */
<xsl:apply-templates select="NUM_F">
<xsl:template match="NUM_F">
<TD align="center">
<FONT size="2"><xsl:eval>formatNumber(this.nodeTypedValue,
"0.00")</xsl:eval></FONT>
</TD>
</xsl:template>
</xsl:apply-templates>
Thanks in advance..
-senthil
----------------------------------------------------------------------------
---------
Senthil Vaiyapuri
408-861-4691
Portal Software
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








