The reason you are noticing this failure is that the behaviour of 'format-number' was corrected in our recent releases.
The decimal-format describes the attributes of the pattern as well as the formatted number. From the spec (http://www.w3.org/TR/xslt#format-number):
"The xsl:decimal-format element declares a decimal-format, which controls the interpretation of a format pattern used by the 'format-number' function."
For your situation, you need to modify your pattern match, e.g. "format-number(value, '#.##0,00','euro');
-Matt.
| Ignacio Barrancos Martinez
<[EMAIL PROTECTED]>
12/02/2004 10:36 AM
|
|
Hi all:
I'm trying to compile Xalan with format-number support. I have read the
instructions at http://xml.apache.org/xalan-c/readme.html#unix, and i
doing, in a RedHat Advanced Server 2.1, and Enterprise Linux 3.0, with
various supported gcc versions in these distributions,
In RedHat AS 2.1:
-----------------
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.1)
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.1)
gcc3) gcc version 3.0.4 (Red Hat Linux 7.2 3.0.4-1)
g++3) gcc version 3.0.4 (Red Hat Linux 7.2 3.0.4-1)
In RedHat EL 3.0:
-----------------
gcc3) gcc versión 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
g++3) gcc versión 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
Actually, i'm trying to compile in RH EL 3.0 (gcc 3.2.3), ICU 2.6.1,
XalanC++ 1.8 and XercesC++ 2.5.
The secuence of steps is next:
1º) Configure the enviroment:
--------------------------
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
export PATH=/usr/local/bin:$PATH
2º) For compiling ICU
----------------------------------
tar -xzvf icu-2.6.1.tgz
cd icu/source
chmod +x runConfigureICU configure install-sh
./runConfigureICU LinuxRedHat --prefix=/usr/local/stow/icu
make
if [ $? -eq 0 ]; then
make install
cd /usr/local/stow
stow icu
cd -
fi
3º) For compiling XERCES
-------------------------------------
tar -xzvf xerces-c-src_2_5_0.tar.gz
export XERCESCROOT=$PWD/xerces-c-src_2_5_0
export ICUROOT=/usr/local/stow/icu
cd xerces-c-src_2_5_0/src/xercesc
autoconf
chmod a+x runConfigure configure install-sh
./runConfigure -plinux -ticu -P /usr/local/stow/xerces
gmake && make install
if [ $? -eq 0 ]; then
cd /usr/local/stow
stow xerces
cd -
fi
4º) For compiling XALAN
-------------------------------------
tar -xzvf Xalan-C_1_8_0-src.tar.gz
#XERCESCROOT, ICUROOT has defined at previous step
export XALANCROOT=$PWD/xml-xalan/c
export XALAN_USE_ICU=1
cd $XALANCROOT
chmod a+x runConfigure configure install-sh
./runConfigure -plinux -d -P $1
make clean
make && make install
if [ $? -eq 0 ]; then
cd /usr/local/stow
stow -D icu
stow xalan
stow icu
cd -
fi
5º) Testing Xalan 1.8
-------------------
I have wrote a simple xml and xsl files :
---8<---- test.xml ---------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<test>
<value>123453.1232</value>
</test>
---8<---- test.xsl ---------------------------------
<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:decimal-format decimal-separator="."
grouping-separator=","/>
<xsl:decimal-format name="euro"
decimal-separator=","
grouping-separator="." />
<xsl:output method="text"
encoding="iso-8859-1" />
<xsl:template match="/test">
Number without format: <xsl:value-of
select="value"/>
Number with format: <xsl:value-of
select="format-number(value,'#,##0.00','euro')"/><xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
---8<---- end of tests files -----------------------
With ....
XalanC++ version 1.4,
XercesC++ version 2.1.0,
ICU version 2.2
compiled in the same machine (with the same compiler, etc), from a
console, i type ....
[EMAIL PROTECTED] ibm78m]$ Xalan test.xml test.xsl
Number without format: 123453.1232
Number with format: 123.453,12
Works fine, but with
XalanC++ version 1.8,
XercesC++ version 2.5.0,
ICU version 2.6.1
recentely compiled (steps 1-4), in the same linux, ....
[EMAIL PROTECTED] ibm78m]$ Xalan test.xml test.xsl
XSLT Warning: The call to 'format-number' function failed..Source tree
node: test. (file:///home/ibm78m/test.xslLine 17, column 60.)
Number without format: 123453.1232
Number with format:
--------- And, finaly, these are my questions ....
a) What i'm doing wrong?
b) Is It a bug in the command utility XalanExe/XalanExe.cpp?
c) How can i repair it?
Thanks in advance,
Ignacio Barrancos Martínez
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
