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 1261 - [XQuery] Meta type for Sequence Type
Summary: [XQuery] Meta type for Sequence Type
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All Windows 2000
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Keywords: futureConsideration
Depends on:
Reported: 2005-04-20 08:22 UTC by Henry Luo
Modified: 2005-05-04 23:34 UTC (History)
0 users

See Also:


Description Henry Luo 2005-04-20 08:22:49 UTC
I can see that XQuery has been carefully defined so that Sequence Type 
Definition (under spec 2.5.3) is only part of the syntax construct rather than 
a type by itself.

But has WG considered treating Sequence Type Definition as true data type which 
can be assigned to variables? In that way, complicated Sequence Type Definition 
can be used just by refering the variable rather than having to literally type 
it every time. And the variable can be passed to functions and the language 
become more flexible.

I know that'll lead a lot of other questions, like how to compare meta type, 
how to construct dynamic meta type, etc. 
Is it because of those complicated issues that the WG is avoiding the issue in 
this version?
Comment 1 Michael Kay 2005-04-20 13:23:55 UTC
There are two comments here:

(a) should types be first-class values (in the same way as many programming
languages make Class a subclass of Object). This would also allow schema (or
metadata) introspection in the same way as SQL and other database languages
permit. The answer to this is yes, it should eventually be allowed, and it was a
conscious decision to rule this out of scope for XQuery version 1.

(b) should it be possible to declare the type of a variable or function
dynamically? The answer is that this might make sense but only in the context of
a dynamic evaluation capability (constructing XPath expressions from strings at
run-time), which is something that again the WGs decided was out of scope for
this round (the XSL WG in particular spent considerable time on this as the
feature has often been requested.)

Michael Kay (personal response)
Comment 2 Don Chamberlin 2005-05-04 23:34:06 UTC
Thanks for your comment. The Query working group discussed your suggestion on 
May 4, 2005 and decided that the functionality that you suggest is beyond the 
scope of XQuery Version 1. We will revisit this comment during discussions of a 
future version of XQuery. In the meantime, we consider this comment to be 
--Don Chamberlin