Bug 14995 - [FO30] context dependence
[FO30] context dependence
Status: CLOSED FIXED
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0
Member-only Editors Drafts
PC Windows NT
: P2 normal
: ---
Assigned To: Michael Kay
Mailing list for public feedback on specs from XSL and XML Query WGs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-29 15:01 UTC by Tim Mills
Modified: 2011-12-13 18:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Mills 2011-11-29 15:01:09 UTC
The functions serialize, format-time, format-date and format-dateTime each have one variant which is marked context-dependent and one which is marked context-independent. e.g.

fn:serialize

    The one-argument form of this function is 
Comment 1 Michael Kay 2011-11-29 18:26:45 UTC
For format-date() etc I think it is correct, but for reasons that are difficult to defend. 

In hte case of format-date(), etc, the two-argument forms of these functions depend on the default language, calendar, etc, but this dependency is described in the spec as "implementation-defined" behaviour rather than "context-dependent" behaviour. If we made default language and calendar properties of the dynamic context, then the functions would become context-dependent. Which would have the unfortunate consequence that you wouldn't be able to partially apply them.

For fn:serialize(), I think the spec appears to be wrong: I can't see any reason why the single-argument function is described as context-dependent (though of course the result is in many ways implementation-dependent...)
Comment 2 Tim Mills 2011-11-29 22:10:50 UTC
I'm a little uneasy about this.  As you know, I'd like the defaults to be part of the context.  Were this to be adopted at some point in the future, it would be a breaking change due to the reasons you outline.
Comment 3 Michael Kay 2011-12-06 22:23:17 UTC
The WG decided that the default language, calendar, and place used by the format-date|time functions should be made explicit properties of the dynamic context. [F+O has been changed accordingly; the definitions are yet to be added to the language book].

The properties of fn:serialize() have been corrected.
Comment 4 Michael Kay 2011-12-13 16:31:12 UTC
Fixed as proposed in the last call draft.
Comment 5 Tim Mills 2011-12-13 18:01:52 UTC
Thanks.


  翻译: