[xquery-talk] Elegant form of testing for () and ''

Fourny Ghislain gfourny at inf.ethz.ch
Fri Mar 4 17:23:13 PST 2011

Hi David,

() ne '' should return the empty sequence, the effective boolean value of which is false so that the function returns "<untitled>" as well when $name is empty - or did I miss something?

The following query works fine with Zorba (it returns "<untitled>"):

declare function local:getname( $e ) as xs:string
let $name := $e/name/string()
  if( $name ne '' ) then $name else "<untitled>"


Could it be that it crashes for another reason?

Kind regards,

More information about the talk mailing list