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 3784 - fn:trace is cumbersome with static typing
Summary: fn:trace is cumbersome with static typing
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3782
  Show dependency treegraph
 
Reported: 2006-10-02 18:59 UTC by Frans Englich
Modified: 2008-10-14 17:53 UTC (History)
1 user (show)

See Also:


Attachments

Description Frans Englich 2006-10-02 18:59:40 UTC
This is from a problem encountered in report #3782:

Since the return type for fn:trace isn't inferred from the input it is tracing, one must in most cases insert a 'treat as' expression each time one inserts an fn:trace call. I would find this very cumbersome. For example, this query is a static typing error:

trace("this Input is traced", "The trace message.") eq "a string"

because the left operand to 'eq' has item()* as static type.

I suggest that a section is added for fn:trace, and that its return type is inferred similarly to fn:reverse().

This is a large change, but the specification also has a large hole here, in my opinion. fn:trace() is very unpractical on a static typing implementation as it is now.
Comment 1 Jerome Simeon 2006-10-03 15:31:21 UTC
This is a good remark. I think that function never got the attention it deserved on the static typing front. However, this is really late in the process to change this, especially that it requires changes to two documents (F&O will have to point to static typing rules, the FS will have to invent new static typing rules).

Personally, I think this issue could be dealt with by implementation using a static typing extension for that version. The static typing extension should provide enough flexibility to do this.

- Jerome
Comment 2 Frans Englich 2006-10-05 15:50:23 UTC
I don't think there's that much to say. Here's a clear hole in the spec, but if the necessary changes can't be done, that's the end to the story. I have acceptance for closing as WONTFIX, although I would grumble as everyone else.
Comment 3 Jerome Simeon 2006-10-19 19:38:45 UTC
The XML Query and XSLT WGs have decided to reject the proposed change and leave the static semantics of fn:trace as is. This may be considered for a future version.
Best,
- Jerome, On Behalf of the WGs
Comment 4 Michael Dyck 2008-10-14 17:53:37 UTC
(Note that this suggestion was raised against FS 1.1, and approved, in Bug 5786.)