After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778170 - decimal-format and format-number() don't recognize namespaces
decimal-format and format-number() don't recognize namespaces
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other All
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-04 09:38 UTC by jacobborisov
Modified: 2017-02-07 15:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jacobborisov 2017-02-04 09:38:45 UTC
While checking for possible duplicate names for the decimal-format top-level elements, libxslt performs plain string names comparison, although according to the specification there should be comparison by expanded names, like for templates, variables etc.

Steps to reproduce:
Create:

<?xml version="1.0"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
<xsl:decimal-format xmlns:testns="urn:test:1" name="testns:format" decimal-separator="," />
<xsl:decimal-format xmlns:testns="urn:test:2" name="testns:format" decimal-separator="." />

</xsl:stylesheet>

Load and run stylesheet.

Actual results:
xsltParseStylestyleDecimalFormat: testns:format already exists

Expected results:
Successful stylesheet run

Does this happen every time?
Yes
Comment 1 jacobborisov 2017-02-04 10:21:06 UTC
Furthermore, for decimal-format libxslt ignores names expansion completely. Another example:

<?xml version="1.0"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
<xsl:decimal-format xmlns:testns="urn:test:1" name="testns:format" decimal-separator="," />

<xsl:template match="/" xmlns:newns="urn:test:1">
    <xsl:value-of select="format-number(123, '0,00', 'newns:format')" />
</xsl:template>

</xsl:stylesheet>

Actual results:
format-number() : undeclared decimal format 'newns:format'

Expected results:
123,00
Comment 2 Nick Wellnhofer 2017-02-07 15:13:58 UTC
Fixed with the following commit:

https://git.gnome.org/browse/libxslt/commit/?id=38d4a907541379e7c3381324776fcb9f0c4324ee

Thanks for the report.