zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #07766
Re: [Merge] lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba
> > - The fn:path functions returns a wrong result for the following doc/query:
> >
> > doc.xml
> > <a><b/><b/></a>
> >
> > fn:path(doc("doc.xml")/a/b[2])
> > /"":a[2]/"":b[1]
> Oh It seems I used the wrong value for the position. I have a question about
> this I was using Item->getRefCount() for the value of the position of the
> node, but it appears to be wrong is that info on the node stored anywhere
> else? if not should I implement it as info inside the Item? or just for the
> function?
getRefCount() returns the number of references to the node. It cannot be used as the position among siblings. I'm afraid there is no such information stored in a node. You probably have to count the number of preceding siblings, i.e. go to the parent and iterate over the children until you reached the node in question.
--
https://code.launchpad.net/~zorba-coders/zorba/xquery3.0_funcs/+merge/101591
Your team Zorba Coders is subscribed to branch lp:zorba.
References