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 28515 - [QT3] format-integer-040, expects error, but is valid format string
Summary: [QT3] format-integer-040, expects error, but is valid format string
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 05:33 UTC by Abel Braaksma
Modified: 2015-04-20 14:04 UTC (History)
1 user (show)

See Also:


Attachments

Description Abel Braaksma 2015-04-20 05:33:33 UTC
This test tests "format-integer(1234, '123١')", and expects "FODF1310" to be thrown, but the spec says, under 4.6.1:

   A mandatory-digit-sign is a ·character· in Unicode category Nd. All 
   mandatory-digit-signs within the format token must be from the same digit 
   family, where a digit family is a sequence of ten consecutive characters in 
   Unicode category Nd, having digit values 0 through 9. Within the format token, 
   these digits are interchangeable: a three-digit number may thus be indicated 
   equivalently by 000, 001, or 999.

and later:

    If the primary format token contains at least one Unicode digit then it is 
    taken as a decimal digit pattern, and in this case it must match the regular 
    expression ^((\p{Nd}|#|[^\p{N}\p{L}])+?)$.

The digit "١", or "١" or "ARABIC-INDIC DIGIT ONE" is part of \p{Nd} and therefore fits the above regular expression. 

According to the earlier interchangeable rule, I think the correct outcome is "1234" for this test.
Comment 1 Michael Kay 2015-04-20 08:03:46 UTC
It seems to me that this format string clearly violates the rule

All mandatory-digit-signs within the format token must be from the same digit family

and violating one rule is enough to make it an error.

Perhaps you are misreading "these digits are interchangeable": it is intended to mean that the digits within a digit family are interchangeable.
Comment 2 Abel Braaksma 2015-04-20 13:47:47 UTC
> All mandatory-digit-signs within the format token must be from the same 
> digit family

I think I didn't know / get / understand what "digit family" means. The way I understood it, it is either Nd, Nl or No. 

Reading it again, I see that it is written clearly and I even quoted it in comment#0: "[...]where a digit family is a sequence of ten consecutive characters[...]".

And yes, the characters in this test are clearly not consecutive within a range of 10 digits.
Comment 3 Abel Braaksma 2015-04-20 14:04:17 UTC
Resolving the bug as invalid.