<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3832</bug_id>
          
          <creation_ts>2006-10-13 15:59:51 +0000</creation_ts>
          <short_desc>Static typing in use cases</short_desc>
          <delta_ts>2007-09-14 11:35:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nick Jones">nick</reporter>
          <assigned_to name="Frans Englich">frans.englich</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12440</commentid>
    <comment_count>0</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2006-10-13 15:59:51 +0000</bug_when>
    <thetext>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(), &quot;XML&quot;)

Cbcl.Xml.XPath2.XPathException: Static type check failed for function &apos;http://www.w3.org/2005/xpath-functions:contains&apos;.  Expected &apos;http://www.w3.org/2001/XMLSchema:string?&apos; for argument &apos;0&apos;, but found &apos;http://www.w3.org/2001/XMLSchema:string*&apos;.



rdb-queries-results-q1
rdb-queries-results-q5
rdb-queries-results-q7

contains($i/description, &quot;Bicycle&quot;)

Cbcl.Xml.XPath2.XPathException: Static type check failed for function &apos;http://www.w3.org/2005/xpath-functions:contains&apos;.  Expected &apos;http://www.w3.org/2001/XMLSchema:string?&apos; for argument &apos;0&apos;, but found &apos;http://www.w3.org/2001/XMLSchema:string*&apos;.



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 &apos;http://www.w3.org/2005/xpath-functions:year-from-date&apos;. Expected &apos;http://www.w3.org/2001/XMLSchema:date?&apos; for argument &apos;0&apos;, but found &apos;http://www.w3.org/2001/XMLSchema:date*&apos;.



string-queries-results-q2

contains($t/text(), &quot;Foobar Corporation&quot;)

Cbcl.Xml.XPath2.XPathException: Static type check failed for function &apos;http://www.w3.org/2005/xpath-functions:contains&apos;.  Expected &apos;http://www.w3.org/2001/XMLSchema:string?&apos; for argument &apos;0&apos;, but found &apos;http://www.w3.org/2001/XMLSchema:string*&apos;.



string-queries-results-q4

let $partners := local:partners($c/name)

Cbcl.Xml.XPath2.XPathException: Static type check failed for function &apos;http://www.w3.org/2005/xquery-local-functions:partners&apos;.  Expected &apos;http://www.w3.org/2001/XMLSchema:string&apos; for argument &apos;0&apos;, but found &apos;http://www.w3.org/2001/XMLSchema:string*&apos;.



string-queries-results-q5

where contains(string($item/content), &quot;Gorilla Corporation&quot;)

Cbcl.Xml.XPath2.XPathException: Static type check failed for function &apos;http://www.w3.org/2005/xpath-functions:string&apos;.  Expected &apos;(http://www.w3.org/2001/XMLSchema:anyAtomicType | attribute() | comment() | document() | element() | processing-instruction() | text())?&apos; for argument &apos;0&apos;, but found &apos;element()*&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12441</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-10-13 16:38:12 +0000</bug_when>
    <thetext>&gt;where contains($t/text(), &quot;XML&quot;)

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&apos;s wrong, of course, because it fails when an element contains comments or PIs. It&apos;s too late to undo the damage now, but such tests should be changed to say

where contains(string($t), &quot;XML&quot;)

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13200</commentid>
    <comment_count>2</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2006-12-15 13:19:26 +0000</bug_when>
    <thetext>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: &lt;&lt; ...
rdb-queries-results-q6: ... *
rdb-queries-results-q2: contains(...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16555</commentid>
    <comment_count>3</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-09-14 09:34:51 +0000</bug_when>
    <thetext>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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16575</commentid>
    <comment_count>4</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2007-09-14 11:35:56 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>