[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Formatting of numbers, dynamically

Subject: Formatting of numbers, dynamically
From: "David B. Bitton" <david@xxxxxxxxxxxxxx>
Date: Mon, 11 Mar 2002 16:34:27 -0500
formatting currency in xsl
I am current using format-number($node, '#,##0.00') for formatting currency.
We are now implementing foreign currencies into our application.  For every
transaction, I have an element, CurrencyCode, which contains the ISO
currencyCode and an attribute @minor_unit which tells me how many digits
follow the decimal seperator.  My question is how I can dynamically build
the formatting string.

I was reading this morning in the March 2002 issue of MSDN magazine about
how XSLT is a "Functional programming language", and therefore xsl:variable
entities are "not really variables, rather runtime-assigned constants"
because once they are assigned, the values cannot be changed.  So, this lead
me to start thinking about how I could wrap an xsl:for-each with the
xsl:variable element to produce my output.  What I don't know if how to
obtain functionality like:

for(i=0;i<=@minor_unit;i++){ ... };

I do not want to use an enbedded JScript solution because I want the XSL to
be portable (namely between MSXML and Xalan).  So, how would I construct the
@select attribute in the xsl:for-each to just loop a predetermined number of
times?

--

David B. Bitton
david@xxxxxxxxxxxxxx
www.codenoevil.com

Diversa ab illis virtute valemus.


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.