<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="changes" page="intro93" subpage="xpath30-93"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: XPath 3.0 changes</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: XPath 3.0 changes"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>XPath 3.0 changes</h1>
      <p>Support for XPath 3.0 (previously known as XPath 2.1) is provided.
                  To enable this, call <code>setLanguageVersion("2.1")</code> on the s9api <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/XPathCompiler.html"><code>XPathCompiler</code></a>, or 
equivalent calls on the <a class="bodylink" href="../../javadoc/net/sf/saxon/sxpath/XPathEvaluator.html"><code>net.sf.saxon.sxpath.XPathEvaluator</code></a>.
                  Within XSLT, XPath 3.0 syntax is supported if the version attribute on the principal
stylesheet module is set to "3.0". From JAXP XPath interfaces, support for XPath 3.0 is supported by casting the <code>XPath</code> object to
                  <a class="bodylink" href="../../javadoc/net/sf/saxon/xpath/XPathEvaluator.html"><code>net.sf.saxon.xpath.XPathEvaluator</code></a> and calling 
                  <code>xpath.getStaticContext().setXPathLanguageLevel(new DecimalValue("2.1"))</code>.</p>
      <p>The following features are available when XPath 3.0 is enabled:</p>
      <ul>
         <li content="para">
            <p>The let expression (<code>let $x := expr, $y := expr return expr</code>).</p>
         </li>
         <li content="para">
            <p>The new context-independent QName syntax (<code>"uri":local</code>, also <code>"uri":*</code>)</p>
         </li>
         <li content="para">
            <p>Facilities associated with higher-order functions: function literals, partial function application, dynamic function invocation, inline functions,
plus associated functions such as <code>map()</code>, <code>filter()</code>, <code>fold-left()</code>, and <code>fold-right()</code>.</p>
         </li>
         <li content="para">
            <p>New functions and operators: see <a class="bodylink" href="../../changes/intro93/fo30-93.xml">Changes to functions and operators</a>
            </p>
         </li>
         <li content="para">
            <p>Enhancements to regular expressions (non-capturing groups <code>(?:xxxx)</code>) and flags (the <code>q</code> flag)</p>
         </li>
      </ul>
      <p>The s9api API, together with lower-level APIs for running XPath (including the <a class="bodylink" href="../../javadoc/net/sf/saxon/expr/StaticContext.html"><code>StaticContext</code></a> interface)
                  have been enhanced to allow the required type of the context item to be supplied as a property of the static context.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="xpath20-93.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>