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 28850 (default-language) - New function "default-language()" provides the default language
Summary: New function "default-language()" provides the default language
Status: CLOSED FIXED
Alias: default-language
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 enhancement
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: 2015-06-25 19:50 UTC by Markus KARG
Modified: 2016-12-16 19:55 UTC (History)
1 user (show)

See Also:


Attachments

Description Markus KARG 2015-06-25 19:50:42 UTC
Abstract

The intent of this issue is to propose a new function "default-language()" to be added to this specification.


Justification

Version 3.0 of the specification added several functions which take respect of the default language at time of execution. The format-date and format-integer functions for example have versions that use the default language in case no explicit language is provided.

The XPath language allows to provide user defined functions, and is also able to invoke user defined functions defined in XSLT. There might exist cases when users or library vendors author user defined functions having a need to know the default language. For example, a user defined function could format phone numbers according to local formatting rules. Also loading of translated string literals is a valid example for the need of knowing the default language.

Currently there is no standard way for a user defined function to learn about the default language. Hence it makes sense to provide a "default-language()" function which taks no argument but returns a language token string in exactly that form that also is accepted by the existing format-date and format-integer functions.
Comment 1 Michael Kay 2015-06-25 20:40:37 UTC
Many thanks for raising this. There is a strong presumption against adding new functionality during the Candidate Recommendation phase, but you have provided a good justification of the requirement. The WG will consider the request.
Comment 2 Jonathan Robie 2015-07-15 18:44:07 UTC
The Working Group has considered this request, and will add the function.
Comment 3 Michael Kay 2015-07-19 14:23:00 UTC
The function is now in the spec.