Hi guys,
I'm having a trouble with using fn:root function. I want to check if given XPath selects root node. So i decided to do it with following
for eg. /test/nodes - is example XPath chosing non root element and i want to check if this is root element byt running one of these statements
fn:root(/test/nodes) = /test/nodes or fn:root() = /test/nodes
both of these return true on following document:
<?xml version='1.0' encoding='UTF-8'?> <test> <nodes> <node></node> </nodes> <nodes2> </nodes2> </test>
when I run just first part of statement fn:root(/test/nodes) I get: <test> <nodes> <node/> </nodes> <nodes2/> </test>
which is ok when I run separately /test/nodes i got this: <nodes> <node/> </nodes>
it's also ok but when I try to compare it together I get false which is definitelly not OK. i.e fn:root(/test/nodes) = /test/nodes .... returns true
Am I doing something wrong or it's a bug in base-X. I have tried also last BASE-X 6.03 and I'm having same problem.
Thank you for help
Jiri