<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="using-xquery" page="xquery11support" subpage="trycatch"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: Try/Catch</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: Try/Catch"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Try/Catch</h1>
      <p>The try/catch expression is implemented, but omitting the ability to declare variables to receive
error information. The syntax is:</p>
      <div class="codeblock"
           style="border: solid thin; background-color: #B1CCC7; padding: 2px">
         <pre>
            <code>
"try" "{" expression "}" 
( "catch" NameTest ('|' NameTest)* "{" expression "}" )+
</code>
         </pre>
      </div>
      <p>The NameTest might be <code>*</code> to catch all errors, or <code>err:FODC0002</code> to catch a specific error. The forms
<code>*:local</code> and <code>prefix:*</code> are also supported. 
The namespace prefix <code>err:</code> is predeclared.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="groupby.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>