<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="changes" page="intro" subpage="api-94"/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Changes to application programming interfaces</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Changes to application programming interfaces"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Changes to application programming interfaces</h1> <p><i>This section includes changes to the main s9api interface library, as well as other significant application programming interfaces</i></p> <p>In s9api, an <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/XQueryEvaluator.html"><code>XQueryEvaluator</code></a> is now a <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/Destination.html"><code>Destination</code></a>, so queries can participate in s9api pipelines in the same way as transformations.</p> <p>In s9api, the base output URI of an <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/XsltTransformer.html"><code>XsltTransformer</code></a> is now taken from the <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/Destination.html"><code>Destination</code></a> if (a) no base output URI has been explicitly set, and (b) the destination is a Serializer writing to a supplied File.</p> <p>A class <code>XdmFunctionItem</code> has been added to both s9api and the Saxon.NET API to represent items that are functions (as distinct from atomic values and nodes).</p> <p>It is now possible to set a default collection and a collection URI resolver at the level of the <a class="bodylink" href="../../javadoc/net/sf/saxon/Controller.html"><code>Controller</code></a> (that is, an individual transformation or query); previously it could only be set globally, in the <a class="bodylink" href="../../javadoc/net/sf/saxon/Configuration.html"><code>Configuration</code></a>. There is now a defined constant URI (<code>Collection.EMPTY_COLLECTION</code>) which always represents an empty collection, without needing to be resolved by the URI resolver.</p> <p>It is now possible to set an extension function library at the level of an individual query (via the <a class="bodylink" href="../../javadoc/net/sf/saxon/query/StaticQueryContext.html"><code>StaticQueryContext</code></a> object), or an individudual stylesheet (via the <a class="bodylink" href="../../javadoc/net/sf/saxon/trans/CompilerInfo.html"><code>CompilerInfo</code></a> object. Previously an extension function library could only be defined at the <a class="bodylink" href="../../javadoc/net/sf/saxon/Configuration.html"><code>Configuration</code></a> level.</p> <p>In the JAXP <code>XPathFactory</code> implementation, Saxon configuration properties (as listed in <a class="bodylink" href="../../javadoc/net/sf/saxon/lib/FeatureKeys.html"><code>FeatureKeys</code></a>) can now be supplied to the <code>getFeature()</code> and <code>setFeature()</code> methods, provided the properties are of type boolean.</p> <p>A new class <a class="bodylink" href="../../javadoc/net/sf/saxon/event/Transmitter.html"><code>Transmitter</code></a> is available as a new kind of JAXP <code>Source</code>, recognized in all Saxon interfaces that accept a <code>Source</code>. A Transmitter writes events to a <a class="bodylink" href="../../javadoc/net/sf/saxon/event/Receiver.html"><code>Receiver</code></a>. This is useful when the input to a streamed transformation is supplied programmatically.</p> <p>A new simplified interface for defining context-free extension functions is available as part of the s9api package: <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/Processor.html"><code>Processor.registerExtensionFunction</code></a>, where the argument implements the interface <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/ExtensionFunction.html"><code>ExtensionFunction</code></a>. TODO: documentation, examples, tests</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="spi-94.xml">Next</a></p> </td> </tr> </table> </body> </html>