<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="expressions" page="xpath30new" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: New features in XPath 3.0</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: New features in XPath 3.0"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>New features in XPath 3.0</h1>
      <div class="boxed"
           style="border: solid thin; background-color: #B1CCC7; padding: 2px">These features are available in Saxon only if explicitly enabled, either directly, or by requesting
      support for XSLT 3.0 or XQuery 3.0. In both cases, this requires Saxon-PE or above.</div>
      <p>Some of the new features in XPath 3.0 are as follows. For full details, see the W3C specifications.</p>
      <ol>
         <li>
            <p>Local variables can be declared in a <code>let</code> expression, for example
         <code>let $x := /*/@version return //e[@version = $x]</code></p>
         </li>
         <li>
            <p>Inline function items can be declared, and used as arguments to higher-order
         functions. For example <code>map(//employee, function($e){$e/salary + $e/bonus})</code>.
         A <i>function item</i> is a third kind of item, alongside nodes and atomic values.
         The function represented by a function item <code>$f</code> can be invoked using a dynamic
         function call <code>$f(args)</code>.</p>
         </li>
         <li>
            <p>Expanded QNames can be written in the notation <code>"uri":local</code>, allowing
         XPath expressions to be written that do not depend on an externally-supplied namespace context.</p>
         </li>
      </ol>
      <p>A number of new functions are available, including <code>head</code>, <code>tail</code>, <code>map</code>, 
         <code>filter</code>, <code>map-pairs</code>, <code>pi</code>, <code>sin</code>, <code>cos</code>, <code>tan</code>,
      <code>asin</code>, <code>acos</code>, <code>atan</code>, <code>sqrt</code>, <code>format-integer</code>, and others.
         For details see <a class="bodylink" href="../functions/intro.xml">XSLT 2.0 and XPath 2.0 Functions</a>.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"/>
            </td>
         </tr>
      </table>
   </body>
</html>