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 2952 - Clarify grouping of decimal-format declarations
Summary: Clarify grouping of decimal-format declarations
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: 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: 2006-03-01 03:25 UTC by David Marston
Modified: 2006-04-04 21:12 UTC (History)
1 user (show)

See Also:


Attachments

Description David Marston 2006-03-01 03:25:59 UTC
Part 16.4.1 refers to the ability to "group" multiple xsl:decimal-format
declarations sharing a name, and to group all the un-named ones. Subsequent
paragraphs say:
For any named decimal format, the effective value of each attribute is taken
from an xsl:decimal-format declaration that has that name, and that specifies an
explicit value for the required attribute. If there is no such declaration, the
default value of the attribute is used. If there is more than one such
declaration, the one with highest import precedence is used. (Similarly for the
un-named format)
I think the above states that explicit values for different attributes can be
merged when doing the grouping of several declarations, and that explicit
settings win over defaults. But then cosider this:
[ERR XTSE1290] It is a static error if a named or unnamed decimal format
contains two conflicting values for the same attribute in different
xsl:decimal-format declarations having the same import precedence....
and this:
[ERR XTSE1300] It is a static error if, for any named or unnamed decimal format,
the variables representing characters used in a picture string do not each have
distinct values.
This raises a slight doubt, and I think the spec should be completely
prescriptive about when the default values are put in effect. For example, if
you have only the declaration
<xsl:decimal-format name="A" decimal-separator="," />
then error 1300 can be raised because the explicit decimal-separator conflicts
with the default grouping-separator. But if the same stylesheet module has the
above and also
<xsl:decimal-format name="A" grouping-separator="_" />
then the two declarations together have no conflict, and the explicit settings
will win, as they should.

Without further clarification, an implementer could decide that each declaration
must be complete and consistent in itself, and raise 1300 on a per-decl basis,
which makes it hard to use the grouping feature. A stylesheet that worked on a
processor where the grouping occurs before the consistency check would fail on a
processor that checks consistency before grouping.

I think grouping first is the best approach. If the stylesheet writer wants to
combine multiple declarations under the other scenario, they would have to add
spurious attribute settings to each one just to make it consistent, and adding
those settings may thwart their effort to get the combination they want.

If you choose consistency checking before grouping, then the paragraphs I cited
first (explicit wins over default) must be modified to note that explicit
settings must be consistent within each declaration and in the grouped form.
Comment 1 Michael Kay 2006-03-02 19:05:56 UTC
I don't agree that there is a problem here. The spec is quite clear that you
combine multiple *declarations* with the same name to construct a
*decimal-format*, and errors 12990 and 1300 apply to *decimal-formats*, not to
*declarations*. The terms used are carefully defined and hyperlinked.
Declarations cannot conflict, only decimal-formats can conflict, and we explain
the relationship of decimal-formats to declarations quite precisely. In other
words, we mandate the approach you consider desirable, of grouping declarations
before doing any consistency checking.

Michael Kay
(personal response)
Comment 2 Sharon Adler 2006-04-04 21:12:24 UTC
IBM accepts Mikes Kay's reply and will close the bug