Hi Ankit,
Currently, BaseX has no schema support; this is why you'll need to make type comparison explicit in your XQuery code.
Hope this helps, Christian
On Wed, Feb 4, 2015 at 9:19 AM, ankit kumar anky4bugs@gmail.com wrote:
Hi,
Thanks for your prompt reply. My scenario is that i have a node of complex type. I don't have any knowledge that what may be the value inside the node of any type, I have to compare node whether they are equal or not, also taking care of different scientific notation for same value.is this possible in BaseX.
Thanks Ankit
On 4 February 2015 at 13:16, Christian Grün christian.gruen@gmail.com wrote:
Hi Ankit,
I am trying to compare to compare two nodes containing same double values with different scientific notation, matching the two nodes return false. But it should return true. Please help me out.
The reason is that the values are compared as nodes, not as doubles. You'll have to convert your input to numeric values. Here are two solutions that work:
let $a := number(<a>123.4</a>) let $b := number(<a>12.34E1</a>) return deep-equal($a,$b)
let $a := <a>123.4</a> let $b := <a>12.34E1</a> return xs:double($a) eq xs:double($b)
Best, Christian
============================================== let $a := <a>123.4</a> let $b := <a>12.34E1</a> return deep-equal($a,$b)
Expected : true Output : false
Thanks Ankit