[xquery-talk] Elegant form of testing for () and ''
gfourny at inf.ethz.ch
Fri Mar 4 17:23:13 PST 2011
() 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?
More information about the talk