tags:

views:

162

answers:

1

I'm using Eclipse's XQDT with Zorba 0.9.5. I'm trying to call the Zorba internal function zorba:print(...) from within a FLWOR expression, but it gets ignored.

Specifically, I'm doing something like the following

import module namespace zorba =
      "http://www.zorba-xquery.com/zorba/internal-functions";

for $l in list 
  let $bar := <hello />
  let $foo := zorba:print($bar)
  return (<nothing/>)

I can't put the print statement on its own because sequential statements aren't allowed in FLWOR exressions.

Any idea how I can get print calls to work?

A: 

The problem here is the following:

You use a flwor-expression to call zorba:print. In a flwor you have lazy evalution and since you don't use $foo, zorba:print gets not executed.

So in order to get zorba:print executed, you have to use $foo in your flwor.

In the next release of zorba will be much better support for the new XQuery Scripting Extension and then it will be easy to enforce the execution of side effect functions.

Markus Pilman