XQuery 3.0

From BaseX Documentation
Revision as of 14:01, 12 January 2011 by CG (talk | contribs) (Created page with "==Try/Catch== The well-known try/catch construct can be used in BaseX to intercept run-time errors. This feature will also be part of the new [http://www.w3.org/TR/xquery-11/#id...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Try/Catch

The well-known try/catch construct can be used in BaseX to intercept run-time errors. This feature will also be part of the new XQuery 3.0 Recommendation.

Example:

 try {
   1 + '2'
 } catch *($code, $desc) {
   concat('Error [', $code, ']: ', $desc)
 }

Result: Error [XPTY0004]: '+' operator: number expected, string found.