xml - Return Statement in Xquery -
i want change current return statement in xquery, :
return <p>xml file stored successfully</p>
i want make return statement capable of handling situation if there error, return error code user, if there no error, return message above user.
i think if-else construct should placed under return purpose. have no idea condition should there if, experts little? in advance.
the xquery 3.0 working draft introduces try-catch expressions, might looking for:
declare namespace err = "http://www.w3.org/2005/xqt-errors"; let $x := "string" return try { $x cast xs:integer } catch * { $err:code (: variable contains error code :) }
Comments
Post a Comment