This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The following use cases tests are giving us static type checking error for function calls on the lines indicated. I am unsure of the best resolution, but here is the list anyway: xmp-queries-results-q9 where contains($t/text(), "XML") Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xpath-functions:contains'. Expected 'http://www.w3.org/2001/XMLSchema:string?' for argument '0', but found 'http://www.w3.org/2001/XMLSchema:string*'. rdb-queries-results-q1 rdb-queries-results-q5 rdb-queries-results-q7 contains($i/description, "Bicycle") Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xpath-functions:contains'. Expected 'http://www.w3.org/2001/XMLSchema:string?' for argument '0', but found 'http://www.w3.org/2001/XMLSchema:string*'. rdb-queries-results-q9 item_tuple[year-from-date(end_date) = 1999 and month-from-date(end_date) = $m] Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xpath-functions:year-from-date'. Expected 'http://www.w3.org/2001/XMLSchema:date?' for argument '0', but found 'http://www.w3.org/2001/XMLSchema:date*'. string-queries-results-q2 contains($t/text(), "Foobar Corporation") Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xpath-functions:contains'. Expected 'http://www.w3.org/2001/XMLSchema:string?' for argument '0', but found 'http://www.w3.org/2001/XMLSchema:string*'. string-queries-results-q4 let $partners := local:partners($c/name) Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xquery-local-functions:partners'. Expected 'http://www.w3.org/2001/XMLSchema:string' for argument '0', but found 'http://www.w3.org/2001/XMLSchema:string*'. string-queries-results-q5 where contains(string($item/content), "Gorilla Corporation") Cbcl.Xml.XPath2.XPathException: Static type check failed for function 'http://www.w3.org/2005/xpath-functions:string'. Expected '(http://www.w3.org/2001/XMLSchema:anyAtomicType | attribute() | comment() | document() | element() | processing-instruction() | text())?' for argument '0', but found 'element()*'.
>where contains($t/text(), "XML") This is one of the few cases reported where static typing is quite right to reject the query. This use of /text() in the published use cases is really bad coding style and has been slavishly copied by large sections of the XQuery user community. It's wrong, of course, because it fails when an element contains comments or PIs. It's too late to undo the damage now, but such tests should be changed to say where contains(string($t), "XML") Michael Kay
The following use cases also have functions which have expressions typed as being * passed in which causes static typing errors ns-queries-results-q7: normalize-uri(...) sgml-queries-results-q10: << ... rdb-queries-results-q6: ... * rdb-queries-results-q2: contains(...)
A fix has been attempted in CVS, XQTS_current.zip is updated. If the resolution is satisfactory, feel free to change status to CLOSED. Otherwise, reopen this report. If no feedback is returned within two weeks, status will be changed to CLOSED. Thanks for reporting!
I think as a result of the change for this xmp-queries-results-q2 is now not working, due to an extra exactly-one for $b; the enclosed expression does contain more than one item.