This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24596 - Overriding xsl:decimal-format
Summary: Overriding xsl:decimal-format
Status: CLOSED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-10 11:46 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
1 user (show)

See Also:


Attachments

Description Abel Braaksma 2014-02-10 11:46:45 UTC
We currently disallow overriding xsl:decimal-format, we say explicitly:

"An xsl:decimal-format declaration within a package applies only to calls on format-number appearing within that package." [1]

However, since decimal-format is important in localization scenario's, this greatly limits localizing packages, which would require package authors to write functions or templates that take parameters that can be used for decimal-formatting. 

I think it is better if we allow overriding decimal formats, as the use-case for having xsl:decimal-format is otherwise greatly limited.


[1] http://www.w3.org/TR/xslt-30/#package-local-declarations
Comment 1 Michael Kay 2014-02-12 16:02:43 UTC
I think that for serious localization one needs to control decimal format at run time rather than to override it at compile time: you want to format numbers differently for different users without recompiling the stylesheet or package.

If you want the equivalent of being able to override a decimal format you can put your number formatting inside a function and allow people to override the function. The override of this function will pick up the decimal format from the package in which the overriding function is defined.
Comment 2 C. M. Sperberg-McQueen 2014-02-13 11:29:14 UTC
The WG discussed this in Prague, and eventually concluded that making decimal formats overridable would require a substantial change in the machinery of binding, whereas the workaround of packaging the functionality in an overridable function does not require changes to binding.  (Also, it requires work from the stylesheet author instead of from us.)  So:  no action.