[xslt] bug in format-number/grouping-separator
- From: "stein lakenet no" <stein velvet lakenet no>
- To: xslt gnome org
- Subject: [xslt] bug in format-number/grouping-separator
- Date: Sat, 2 Feb 2002 15:45:27 +0100
i had trouble setting the grouping-separator to another
value than ',' with libxslt 1.0.10. could find no
differnce in numbers.c in cvs. see attached document
for reproduction and a patch that solved my problem
ragards,
stein
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="text"/>
<xsl:decimal-format name="no" grouping-separator="." decimal-separator=","/>
<xsl:template match="/root">
formatted: <xsl:value-of select="format-number( @number, '###.###.###,00', 'no')"/>
# this patch will produce the intended result: '123.456.789,01'
diff numbers.c.orig libxslt/numbers.c
1097c1097
< format_info.group, (xmlChar)',');
---
> format_info.group, self->grouping[0]);
</xsl:template>
<!-- this will reproduce the bug: ',' as grouping-separator
# xsltproc version:
Using libxml 20413, libxslt 10010 and libexslt 703
xsltproc was compiled against libxml 20413, libxslt 10010 and libexslt 703
libxslt 10010 was compiled against libxml 20413
libexslt 703 was compiled against libxml 20413
# xsltproc thisfile.xsl number.xml
<?xml version="1.0"?>
123,456,789,01
# cat number.xml
<?xml version="1.0"?>
<root number="123456789.01"/>
-->
</xsl:stylesheet>
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]