I must be misunderstanding something here and would appreciate anyone's help. The bug I originally spoke of is a red herring I think. This isn't really xalan-specific, but I have searched extensively and have found no way to do what I want.
The format-number() function in xslt is meant to take a number and convert it to the format provided in the format string, possibly using the decimal-format object to determine what characters have meaning in the format string. The format string is locale-specific, ok. But how do I format a string using some generic method and have the output formatted with the locale in mind? For example, I want to take
<data>
<value>12345.12345</value>
<precision>2</precision>
</data>
in the xml document and transform it into:
12,345.12 in American English,
12 345,12 in Czech,
and 12.345,12 in most other European locales.
I use <xsl:choose> based on the precision, but I cannot find a way of using format-number(vlaue, "#,##0.00") to get what I want. I can use xml tags to define the number-separator and decimal and use whatever is passed in as those values, but if there is an American English machine with the number-separator tag defined as "." (which would be most European locales), I get an exception about a Malformed format string because that is the special character used as the decimal. So, I can create a decimal-format object and use the tags to define the number-separator, etc., but it seems that this should be _much_ easier than what I am experiencing. I simply want the number displayed in the default locale.
The only thing I can think of is to insert the number-separator and decimal into the string from the decimal-format object, but how do I get a handle on this in xslt? The syntax would be something like:
format-number(value, "#" + (get value of decimal-format::number-separator here) + "##0" + (get value of decimal-format::decimal here) + "00")
Sorry so ignorant, but this seems like a pretty basic thing, and I can't find how to achieve the goal. Am I missing something very simple? I must be..... Any help would be appreciated.
Thanks.
Tom Mitchell
"Tom Mitchell Jr." wrote:
Hi Henry,Thanks for the info. I'm pretty new to bugzilla, but I found the bug at:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3036
and the "version" field says "current CVS" so I thought it was not in a release yet. I am using 2.4.1 presently, however, so I will try 2.5.1 before poking any further. Thanks for your time.
Tom
Henry Zongaro wrote:
Hi Tom,--Is that bug number correct? If so, the fix for it should have been
in Xalan-Java releases for some time. (Thanks to Sarah McNamara for
pointing that out.) We haven't been very good about closing off a bug
report once a release containing the fix for it is available; that could
be a source of confusion.If you are still experiencing that problem or a problem like it,
please reopen the bug report or open a new one, as appropriate.Regarding the next release, does anybody have any objection to
mid-October? That would give us time to include some more bug fixes in a
new release, as well make any documentation changes required to
accommodate Apache mirrors [1].Thanks,
Henry
[1] http://marc.theaimsgroup.com/?l=xml-apache-general&m=106172323716191&w=2
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]"Tom Mitchell Jr." <[EMAIL PROTECTED]>
2003-08-20 05:07 PM
To: [EMAIL PROTECTED]
cc:
Subject: release timetable...
Hello,
I am looking at a bug fix (#3036) that is in CVS but not in any
release. I cannot seem to find information on when the next release
might come out with this fix. Can someone point me in the right
direction?Thanks.
Tom Mitchell
=============================
Tom Mitchell,Jr.
Fathom Development Team
Progress Software
One Indian Head Plaza
Nashua, NH 03060
603.594.6905
www.progress.com
=============================
I close my eyes
And feel the water rise around me
Drown the beat of time
Let my senses fall away
I can see much clearer now,
I'm blind.
Find all you need in your mind
If you take the time.
-Dream Theater
==============================
--
=============================
Tom Mitchell,Jr.
Fathom Development Team
Progress Software
One Indian Head Plaza
Nashua, NH 03060
603.594.6905
www.progress.com
=============================
I close my eyes
And feel the water rise around me
Drown the beat of time
Let my senses fall away
I can see much clearer now,
I'm blind.
Find all you need in your mind
If you take the time.
-Dream Theater
==============================
