From: James F. <jam...@ex...> - 2010-07-18 09:35:47
|
courtesy Norm Walsh via twitter paraphrasing: 'During eval of a fn, the context item, pos, size is undefined, except where it is def by some expr inside the fn' section 3.1.5 Function Calls in XQuery spec defines the correct behavior for this. so looks like we need to sort this out, we should probably also create an xquery level unit test for this as well ... something I think we should do whenever we apply a patch/bug/tweak that can be characterized easily as expected result from xquery unit test. J On 17 July 2010 14:21, Dmitriy Shabanov <sha...@gm...> wrote: > On Sat, 2010-07-17 at 13:31 +0200, James Fuller wrote: >> I can appreciate that both functions ( e.g. local:test() and name() ) >> when given no argument use default context but can't find in xquery >> related specs what the rules are for default context for a function >> with no arguments. > > The function don't have context. You right, it should throw error. (BTW, > I like the way it work now) > >> should this throw an [XPDY0002] evaluation of an expression relies on >> some part of the dynamic context that has not been assigned a value: >> {context item}. > > -- > Cheers, > > Dmitriy Shabanov > > |