[Bug 10275] New: [F+O 1.1] The third argument of format-number()

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10275

           Summary: [F+O 1.1] The third argument of format-number()
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 1.1
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


The third argument of the format-number() function is the name of a decimal
format, supplied as a string in the form of a lexical QName. Since this is a
run-time value, it would be much preferable for this argument to be an xs:QName
value, thus avoiding a run-time dependency on the static context (which is
messy for implementations to manage, and messy for users when code is
copied-and-pasted from one module into another).

The problem of course is backwards compatibility: this function has been in
XSLT since version 1.0, but is new to XQuery. It would be nice to do the right
thing for XQuery users while retaining compatibility for XSLT.

We could tackle this by providing two signatures for the function: a "current"
signature and a "legacy" signature. The "current" signature would declare this
argument as xs:QName. The "legacy" signature would declare it as
xs:anyAtomicValue and the semantics would require that it is either a string in
the form of a lexical QName, or an xs:QName value. The host language would
choose which form to offer.

An alternative and perhaps simpler solution would be for decimal format names
in XQuery to be NCNames rather than QNames. Because decimal formats are scoped
to a module in XQuery, rather than being global, using a QName seems rather
unnecessary. This approach solves the problem for XQuery, though it doesn't
help us move XSLT forwards, where it would be nice to allow xs:QName values in
this and other similar interfaces (for example, the first argument to key()).

Incidentally, the XQuery definition of decimal formats does not say what
namespace the QName is in if it is unprefixed. It should match the rule for
format-number(), where no prefix means no namespace.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 30 July 2010 10:01:07 UTC