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 2565 - string/untyped comparison in fn-indexof-mix-args-018
Summary: string/untyped comparison in fn-indexof-mix-args-018
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.8.0
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-05 02:17 UTC by Jerome Simeon
Modified: 2005-12-19 16:46 UTC (History)
0 users

See Also:


Attachments

Description Jerome Simeon 2005-12-05 02:17:22 UTC
In fn-indexof-mix-args-018:

As written, I believe the test should return the empty sequence.

   fn:index-of(($input-context/bib/book/publisher), "Addison-Wesley")

   This uses eq for comparison.

   However, <publisher>Addison-Wesley</publisher> eq "Addison-Wesley"
   returns false()

   since fn:data(<publisher>Addison-Wesley</publisher>)
   returns xdt:untypedAtomic("Addison-Wesley")

   and xdt:untypedAtomic("Addison-Wesley") eq "Addison-Wesley"
   returns false()

- Jerome
Comment 1 David Carlisle 2005-12-05 17:08:58 UTC
doesn't eq return true() ?

http://www.w3.org/TR/xquery/#id-value-comparisons
says (step 4) that 
  If the atomized operand is of type xdt:untypedAtomic, it is cast to xs:string.

so the underlying operator gets passed two strings (which are equal)

David
Comment 2 Jerome Simeon 2005-12-19 16:45:26 UTC
Yes. Agreed. I'm just wrong on this.
- Jerome