<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="changes" page="intro91" subpage="xquery91"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: XQuery 1.0</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: XQuery 1.0"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>XQuery 1.0</h1>
      <p>The change defined by bug 5083 is implemented: namespace URIs declared in a direct element constructor may contain
doubled curly braces ("{{" or "}}") to represent single curly braces, and must not contain curly braces unless they are
so doubled.</p>
      <p>The <a class="bodylink" href="../../sourcedocs/streaming.xml">streaming copy</a> optimization, previously available only with XSLT, is now
available also with XQuery. This allows a subset of XQuery expressions to be evaluated in streaming mode, that is, without building
the tree representation of the source document in memory. The facility is available only in Saxon-SA. It can be invoked either
using the extension function <code>saxon:stream()</code> or by means of the pragma <code>(# saxon:stream #){ expr }</code>. 
Use the <code>-explain</code> switch on the command line to check whether the optimization is successful.</p>
      <p>An additional option <code>-xsd:schemadoc1.xsd;schemadoc2.xsd...</code> is available on the command line. This supplies
a list of additional schema documents to be loaded. These are not automatically available in the static context of the query, but they
are available for use when validating input documents (or result documents). The argument can also be used to supply the schema
location of a schema document imported by the query, in the case where the query refers only to the target namespace of the schema
and not to its location.</p>
      <p>For consistency, the command line now allows the file name containing the query text to be specified using the option
<code>-q:filename</code>, and an inline query can be specified using <code>-qs:querytext</code> (place the option in quotes
if the query text contains spaces). The existing convention of specifying the query file as the last option before any query parameters
will continue to work.</p>
      <p>An additional command line option <code>-traceout</code> allows the output from the <code>trace()</code> function to be directed
to a file, or to be discarded. A corresponding option is available in the API (classes <code>DynamicQueryContext</code>
and <code>XQueryEvaluator</code>).</p>
      <p>The native API for XQuery, specifically the <code>StaticQueryContext</code> object, now allows external
variables to be declared, as an alternative to declaring them in the Query prolog. This facility has not yet
been added to S9API, pending user feedback.</p>
      <p>The extension <code>saxon:validate-type</code> now allows validation of attribute nodes (the expression may be a computed
attribute constructor). This was previously accepted in the syntax, but had no effect.</p>
      <p>The ability to compile queries into Java source code has been extended, in that some constructs that were not previously
supported can now be compiled. Some restrictions remain. One important enhancement is that many calls to Java extension
functions can now be compiled. This is particularly beneficial because it means that these calls no longer rely on Java
reflection, which gives the opportunity for a substantial performance improvement.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="xqj91.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>