<?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="intro" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: Using XQuery</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: Using XQuery"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Using XQuery</h1>
      <p>This section describes how to use Saxon as an XQuery processor, either from the command line,
or from the Java API.</p>
      <p>For details of the .NET API, see <a class="bodylink" href="../dotnet/dotnetapi.xml">Saxon API for .NET</a></p>
      <p>The run-time code in Saxon that supports XQuery and XSLT is identical, reflecting the fact that
the two languages have very similar semantics. Most of the compile-time code (in particular, the
type checking logic and the optimizer) is also common. The XQuery support in Saxon consists essentially
of an XQuery parser (which is itself an extension of the XPath parser); the parser
generates the same internal interpretable code as the XSLT processor.</p>
      <p>The XQuery processor may be invoked either from the operating system command line,
or via an API from a user-written application. There is no graphical user interface provided.</p>
      <p>Saxon is an in-memory processor. Unless you can take advantage of <a class="bodylink" href="../sourcedocs/streaming.xml">streaming</a>, Saxon is designed
to process source documents that fit in memory. Saxon has been used successfully to process
source documents of 100Mbytes or more without streaming, but if you attempt anything this large, you need to be
aware (a) that you will need to allocate sufficient memory to the Java VM (at least 5 times the size
of the source document), and (b) that complex FLWOR expressions may be very time-consuming to
execute (In this scenario, Saxon-EE is recommended, because it has a more powerful optimizer for
complex joins). </p>
      <p><i>For details of how to set up collation URIs for use in XQuery,
see <a class="bodylink" href="../extensibility/collation.xml">Implementing a Collating Sequence</a></i></p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="commandline.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>