<?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="s9api91"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: S9API</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: S9API"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>S9API</h1>
      <p>A new method <code>Processor.writeXdmValue(XdmValue, Destination)</code> has been added, allowing any
XDM value (for example, a document node) to be written to any <code>Destination</code> (for example, a <code>Serializer</code>, 
a <code>Validator</code>, or a <code>Transformer</code>). For usage examples, see the S9APIExamples demonstration program.</p>
      <p>A new constructor has been added to <code>XdmValue</code> allowing an <code>XdmValue</code> to be constructed
from a sequence of items.</p>
      <p>A new interface <code>MessageListener</code> is available. A user-written implementation of <code>MessageListener</code>
may be registered with the <code>XsltTransformer</code> to receive notification of <code>xsl:message</code> output. The class
has a single method <code>message()</code>, which is called once for each message; the parameters include the message content
(as an XML document), a boolean indicating whether <code>terminate="yes"</code> was requested, and a <code>SourceLocator</code>
to distinguish which <code>xsl:message</code> instruction generated the output.</p>
      <p>New methods have been added to <code>ItemTypeFactory</code> to allow creation of ItemTypes and XdmAtomicValues representing
external Java objects, which can be passed to a stylesheet or query for use in conjunction with external functions (extension functions).
An example of how to achieve this has been added to the sample application <code>S9APIExamples.java</code> (test QueryF).</p>
      <p>New methods are provided on the <code>XQueryCompiler</code> allowing the query to be supplied as a <code>File</code>, as
a <code>Reader</code>, or as an <code>InputStream</code>. Methods are also provided to specify the encoding of the query source text.</p>
      <p>New methods are available on classes <code>XQueryEvaluator</code>
and <code>XsltTransformer</code> to allow the output from the <code>trace()</code> function to be directed
to a specified output stream, or to be discarded.</p>
      <p>A new method is available on the <code>XPathCompiler</code> class to import a schema namespace for reference
within the body of the expression.</p>
      <p>New methods are available on <code>XQueryExecutable</code> and <code>XPathExecutable</code> to obtain the result type of
the query or expression, as determined by static analysis.</p>
      <p>New methods are available on <code>ItemType</code> and <code>OccurrenceIndicator</code> to determine whether one type
subsumes another.</p>
      <p>These methods make it easier to write application code that can handle query results when the type of the result is not
known <i>a priori</i>.</p>
      <p>A new method is available on <code>XPathCompiler</code> allowing XSLT patterns to be compiled. A pattern
is treated as an expression that returns true if the pattern matches the context node, false otherwise.</p>
      <p>A new method is available on <code>XPathSelector</code> to return the effective boolean value of the XPath
expression.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="jaxp91.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>