This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Our version of XQuery implements static typing and passed all but one of the 43 static typing tests. We also statically type checked roughly 4000 of the XQTS test cases and found 40 cases that had one or more static type errors, 34 of these are listed below: The most common errors were passing sequences of length * to functions requiring an optional item. The second most common type error involved queries returning the empty type such as count(<elem/>/text()) which is an error according FS 4.0. We only implemented the empty type rule for path expressions but found that it reported many misspelled element names in our queries some of which were running in production. We would like to know if others agree that these are static errors. It may be premature to fix them in XQTS if the FS is still undergoing change. We are experimenting with type coercions that are more lenient when dealing with xdt:untypedAtomic sequences and are getting good results. This would eliminate 7 of the cases reported below. For our tests (as allowed in the XQTS instructions) we replaced statements of the form: declare variable $input-context external; with statements of the form: declare variable $input-context := doc("..."); This allows our type checker to infer the type of $input-context as document-node(). If this is not done, the inferred type of $input-context is item()* which will produce an enormous number of type errors. nametest-9 path expression returns () which is a type error predicates-24 empnum is a sequence, xs:string takes an item? unabbreviatedSyntax-14 $h/self::hours is empty which is a type error filterexpressionhc4 xs:integer(hours) is a type error nodeexpression31 $input-context1/works/employee[1]/empnum is a seq nodeexpression47 $input-context1/works/employee[1]/empnum is a seq Constr-elem-empty-3 (<elem/>)/node() is empty and so is a type error Constr-elem-empty-4 ((<elem></elem>)/node()) is empty, a type error Constr-cont-adjtext-3 (<elem>{''}</elem>)/text() is empty, a type error Constr-cont-adjtext-4 ((<elem>{()}</elem>)/text()) is empty, a type error Constr-docnode-parent-1 document {()})/..) is empty, a type error ForExprType002 should use attribute(name,xdt:anyAtomicType*) fn-node-name-2 node-name takes an optional node() fn-node-name-3 $input-context1/works/employee[2] is a sequence fn-normalize-space0args-1 a[normalize-space() = '...'] is a sequence fn-name-2 $input-context1/works/employee[1] is a sequence fn-name-3 $input-context1/works/employee[1] is a sequence fn-name-5 $input-context1/works/nonexistent is empty fn-name-17 $h/self::div is empty and so is a type error fn-name-18 $input-context1/works/employee[2] is a sequence fn-name-21 $input-context1/works/employee[1] is a sequence fn-name-22 $input-context1/works/employee[1] is a sequence fn-document-uri-13 type error works not present in emptydoc fn-document-uri-14 type error works not present in emptydoc fn-indexof-mix-args-019 bib/book[1]/publisher/text() is a sequence xmp-queries-results-q9 $t/text() is a sequence rdb-queries-results-q2 $i/description is a sequence rdb-queries-results-q2 $item/description is a sequence rdb-queries-results-q6 $item/reserve_price is a sequence rdb-queries-results-q7 description is a sequence sgml-queries-results-q10 $x is a sequence string-queries-results-q2 $t/text() is a sequence string-queries-results-q4 $c/name is a sequence string-queries-results-q5 $item/title and $item/date are sequences
Bill: Thank you for the comment. The testing Task Force is discussing your points and acknowledges that a number of them are bugs the need fixing. The rest will be evaluated in the next few weeks. Thanks, Carmelo Montanez
(In reply to comment #1) > Bill: > > Thank you for the comment. The testing Task Force is discussing > your points and acknowledges that a number of them are bugs the > need fixing. The rest will be evaluated in the next few weeks. > > Thanks, > Carmelo Montanez > I think one way of doing this would be to replace declarations of the following form: declare variable $input-context external; with declarations that explicitly give the type: declare variable $input-context as document-node() external; That might require less reshuffling of the framework.
Bill: Once again thanks. As you indicated you can always change the "declare variable $input-context external;" to suit your needs. In regards to the NIST tests and Use Cases tests: 1) Reviewed the NIST tests and attempted to remove the static typing issues. 2) The Use Cases are being reviewed at this time, so it is better to wait on those. Assigning this bug to Ravi as this may involve some of his tests. Thanks, Carmelo
Fixed fn-indexof-mix-args-019. Changed bib/book[1]/publisher/text() -> bib/book[1]/publisher[1]/text()