Saxon is behaving correctly according to the spec. See

http://www.w3.org/TR/xpath20/#id-value-comparisons

When you use the eq operator, an untypedAtomic value is treated as a string, and you cannot compare a string to a number. Either use the "=" operator, or convert the string to a number explicitly by writing 

return number($val) eq sum($val2/*) 

Michael Kay
Saxonica


On 17 Jun 2013, at 12:04, Kunal Chauhan wrote:

Hi,

As per my requirement I am binding XQItem of a node.
and I am processing it, it gives me following error.

can't to compare xs:untypedAtomic type to xs:double

Below is an example :

let $val := <a>5</a>
let $val2 := <a><a1>3</a1>
                <a2>2</a2>
             </a>

return $val eq sum($val2/*)

Note : for $val and $val2, I am binding XQItem from the java code.
$val2 contains list of nodes, while $val having a single node.

When expression is evaluate, sum returns value in xs:double type while $val is xs:untypedAtomic.

So, that I am facing an error.

Is there any way to solve this error?


Regards,
--
Kunal Chauhan
mail4ck@gmail.com
[+918655517141]
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help