Kester -- Sorry for the delay in responding but I only received your email from the list today.
Bug 1 ----- I get the value 122.26 which is the correct value for my locale (en_US). I believe that XalanJ is doing the right thing here and that xp is wrong. I'll explain why. I'm guessing that your default Locale is German. You can verify this by writing a small java program like this: public class defaultLocale { public void main(String[] argv) { System.out.println(java.util.Locale.getDefault()); } } Your xsl:decimal-format element is ignored. Here's why: The xsl:decimal-format element is a named decimal-format since it has a "name" attribute. Since it is a named decimal-format, it is -not- the default decimal format. When you invoke the format-number function with only two arguments, the default decimal-format element is used. However, you do not have a default decimal format element so Xalan supplies one for you as if you specified <xsl:decimal-format> with no attributes. In the German locale, the period (.) is the grouping-separator character. That means that the pattern that you specified is #<<grouping-separator>>## This pattern has no decimal-separator, only a grouping-separator. It means: "Show the integer part of the number to format with a grouping separator of period. The grouping separator is placed every two characters counting from the right to the left." This is what XalanJ is doing. You can verify this by writing a small java program that contains the lines: java.text.DecimalFormat myFormat = (java.text.DecimalFormat) java.text.NumberFormat.getInstance(); System.out.println(myFormat.applyLocalizedPattern("#.##").format(122.2640); Bug 2 ----- I'll defer to the Xerces folks on this with the caveat that alpha software is alpha software. Bug 3 ----- This was a bug and is fixed in the latest CVS version of XalanJ. HTH, Gary Kester Habermann wrote: > > Hi, > > I'd like to report two bugs and one case where I'm not quite sure, > wether this is a bug. I'm sending this to both xerces-dev and > xalan-dev because I'm not quite sure in each case which one is > concerned. > > All files to reproduce these effects are attached. > > These bugs occur using various Java virtual machines > (Blackdown JDK 1.1.8, Sun J2SE 1.3.1, IBM Java2) > > Bug 1: > ------ > > (1) decimal point in wrong position > (2) selection of other symbol for decimal point doesn't work > > Buggy behavior: > > Using: xerces.jar, xalan.jar: > xerces: 1.3.1, 1.4 > xalan: 2.0.1, 2.1.0 (CVS) > Command: java org.apache.xalan.xslt.Process -IN bug1.xml -XSL bug1.xsl > Result: 1.22 > > Using other tool, correct behavior: > > Using: xp.jar, xt.jar: > Command: java com.jclark.xsl.sax.Driver bug1.xml bug1.xsl > Result: 122,26 > > Bug 2: > ------ > > (1) xerces 2.0.0-alpha neither accepts files with version attribute > in xsl:stylesheet nor without > (2) other versions of xerces accept both > > Example Files: > > (a) bug2a.xsl is correct, no output > (b) bug2b.xsl is not correct, attribute version missing in xsl:stylesheet > otherwise identical to bug2a.xsl > > Buggy behavior: > > Using: xerces.jar, xalan.jar: > xerces: 2.0.0-alpha (CVS) > xalan: 2.0.1, 2.1.0 (CVS) > > Command: java org.apache.xalan.xslt.Process -IN bug2a.xml -XSL bug2a.xsl > Result: bug2a.xsl; Line 2; Column 36; > XSLT Error > (javax.xml.transform.TransformerConfigurationException): "version" attribute > is not allowed on the xsl:stylesheet element! > > Command: java org.apache.xalan.xslt.Process -IN bug2b.xml -XSL bug2b.xsl > Result: XSLT Error > (javax.xml.transform.TransformerConfigurationException): xsl:stylesheet > requires attribute: version > > Correct(?) behavior: > > Using: xerces.jar, xalan.jar: > xerces: 1.3.1, 1.4 > xalan: 2.0.1, 2.1.0 (CVS) > > Command: java org.apache.xalan.xslt.Process -IN bug2a.xml -XSL bug2a.xsl > Result: no output > > Command: java org.apache.xalan.xslt.Process -IN bug2b.xml -XSL bug2b.xsl > Result: no output > > Bug 3: > ------ > > (1) handling of variable scopes differes from other tools > which behavior is correct? > > Behavior of current xalan: > > Using: xerces.jar, xalan.jar: > xerces: 1.3.1, 1.4 > xalan: 2.0.1, 2.1.0 (CVS) > Command: java org.apache.xalan.xslt.Process -IN bug3.xml -XSL bug3.xsl > Result: Name: Fred > Amount: 1 > Value: 17 > Subtotal: 17 > Name: Barney > Amount: 3 > Value: 25 > Subtotal: 75 > Name: Wilma > Amount: 2 > Value: 11 > Subtotal: 22 > Total: 114 > > Using other tool, different behavior: > (xalan 1.2.2 behaves like this, too) > > Using: xp.jar, xt.jar: > Command: java com.jclark.xsl.sax.Driver bug3.xml bug3.xsl > Result: Name: Fred > Amount: 1 > Value: 17 > Subtotal: 17 > Name: Barney > Amount: 3 > Value: 25 > Subtotal: 75 > Name: Wilma > Amount: 2 > Value: 11 > Subtotal: 22 > Total: 22 > > Regards, Kester. > -- > Kester Habermann <[EMAIL PROTECTED]> LinuxTag 2001 > http://www.linuxtag.org/ Tel: +49.631.3109371 Fax: +49.631.3109372