RE: question regarding element types in function definitions/XQuery

As to the first part: This is currently indeed one of the mostly worked
on topics in the working group. Your input is valuable as external
feedback and will be taken into account in the discussion.

As to the defaulted types: The defaulted type has to be item*. The
formal semantics is based on an earlier version...

HTH
Michael

> -----Original Message-----
> From: Todd A. Mancini [mailto:todd.mancini@daxat.com]
> Sent: Friday, February 21, 2003 8:01 AM
> To: public-qt-comments@w3.org
> Subject: question regarding element types in function
definitions/XQuery
> 
> 
> I know this has been answered in one way or another over the past year
> or so, but I'm still having trouble understanding the specifications
as
> the language and semantic specs. don't seem to exactly agree, and the
> publicly available issue resolution is somewhat unreadable.
> 
> If I define a function as follows:
> 
> define function foo($i as element my:elementdef) { 1 }
> 
> does this raise a static type error if I have not imported a schema
> defining element my:elementdef ?
> 
> However, if I define a function as follows:
> 
> define function foo($i as element my:elementdef of type xs:integer) {
1
> }
> 
> does this raise a static type error if I have not imported a schema
> defining element my:elementdef?  Conversely, what if I have defined an
> element my:elementdef?  Provided xs:integer is a subtype of the type
of
> the globally defined my:elementdef, is this acceptable?  Or, does this
> signature imply that the argument need only have the element name
> my:elementdef, with a type xs:integer, regardless of the existence of
> my:elementdef as a global element definition?
> 
> 	Thanks,
> 	-Todd
> 
> PS: Another difference between the language and semantic
specifications
> relates to untyped function arguments and function return values.  The
> language spec has them as xs:anyType whereas the semantic spec has
them
> as item*.  Although the difference is subtle, I believe that item*
> matches more values than xs:anyType.  (e.g.  (element foo, attribute
> bar) matches item* but not xs:anyType, whose value space has all
> attributes preceding all elements, assuming I'm correctly interpreting
> 3.2.4 in semantic spec.)
> 

Received on Friday, 21 February 2003 11:44:11 UTC