Dear Ankit,
BaseX is not a schema aware XQuery processor, hence your results.
In BaseX fn:nilled() will always return false.
Element nodes in BaseX will always be untyped, see for instance: http://www.w3.org/TR/xpath-datamodel-30/#ElementNode => Property 11 and http://www.w3.org/TR/xpath-functions-30/#func-nilled => in the notes. So with respect to the specification fn:nilled() is working correctly, however it fails to live up to the expectations :-)
You can, nevertheless, mimic the fn:nilled() behavior, using this custom function I hacked together for you: https://gist.github.com/micheee/b16586464b895f08ddfb
Depending on what you need, this might work just well.
Hope this helps.
Best from Constance,
Michael
P.S.The example code in my function has been shamelessly adapted from: http://www.xqueryfunctions.com/xq/fn_nilled.html :-)
On 15 Jan 2015, at 11:11, ankit kumar wrote:
I am trying to run fn:nilled() function in base-x, but every time a node with xsi:nil="true" is passed to the function it return false. Please help me out.