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 5596 - [FS] Missing rule in 7.2.5 The fn:collection?
Summary: [FS] Missing rule in 7.2.5 The fn:collection?
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 enhancement
Target Milestone: ---
Assignee: Michael Dyck
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard: consider for 1.1
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-01 13:26 UTC by Tim Mills
Modified: 2008-04-30 06:31 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2008-04-01 13:26:10 UTC
In F&O 15.5.6 (fn:collection) says "If $arg is the empty sequence, the function behaves as if it had been called without an argument"

The static typing rules in FS 7.2.5 should reflect this.  I suspect it should be something along the lines of:

statEnv |-  QName of func expands to (FN-URI,"collection")
statEnv |-  Implementation-defined default sequence has type Type
statEnv |-  Expr : empty-sequence()
------------------------------------------------------------------
statEnv |-  QName(Expr) : Type
Comment 1 Michael Dyck 2008-04-26 01:35:24 UTC
As I understand it, the rules of FS 7.2.5 are complete, and consistent with F+O 15.5.6, they just aren't as precise as they could be in the case where the argument's static type is empty. So unless that lack of precision causes serious problems, I don't think I can process this as an erratum. (Note that an implementation is free to infer the more precise type under FS 6.1.1 Static Typing Extensions.)
Comment 2 Tim Mills 2008-04-28 07:21:28 UTC
That's a shame.  We do of course implement this rule.  Might it be considered as a feature request for XQuery 1.1 FS?

It seems unfortunate that fn:collection() and fn:collection( () ) should be typed differently when the behaviour is meant to be the same.
Comment 3 Michael Dyck 2008-04-28 07:44:59 UTC
(In reply to comment #2)
> Might it be considered as a feature request for XQuery 1.1 FS?

Yes, I've marked it as "consider for 1.1" in the Status Whiteboard.

> It seems unfortunate that fn:collection() and fn:collection( () ) should be
> typed differently when the behaviour is meant to be the same.

I agree, but I don't think "unfortunate" warrants an erratum.
Comment 4 Tim Mills 2008-04-28 07:57:14 UTC
Thanks.  The only argument in favour of adding it as an erratum would be:

"If $arg is the empty sequence, the function behaves as if it had been called without an argument."

but I don't think I'd even try to argue that the static type is a part of the behaviour.
Comment 5 Michael Dyck 2008-04-29 22:24:31 UTC
At their meeting today, the WGs approved the response in comment #1, so I am changing this issue's Severity to "enhancement" and marking it as resolved-WONTFIX (and keeping "consider for 1.1" in the Status Whiteboard). If you accept this resolution, please mark the issue CLOSED.
Comment 6 Tim Mills 2008-04-30 06:31:37 UTC
Thanks.

I'd like to request that the static typing rules of fn:trace also be considered for 1.1 (Bug 3784).