<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="changes" page="s90" subpage="s9api90"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: New Java API</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: New Java API"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>New Java API</h1>
      <p>A brand new Java API is available in package <code>net.sf.saxon.s9api</code> (pronounced "snappy", stands for Saxon 9 API).
This is closely modelled on the successful .NET API. The design aims were to:</p>
      <ul>
         <li content="para">
            <p>Provide an API that is well documented and uncluttered by implementation detail</p>
         </li>
         <li content="para">
            <p>Provide uniformity across XSLT, XPath, and XQuery (for example, allowing XSLT and XQuery to be combined naturally
in a single pipeline)</p>
         </li>
         <li content="para">
            <p>Maximise the ability to create compiled objects that are reusable across multiple threads</p>
         </li>
         <li content="para">
            <p>Reuse existing JAXP classes and interfaces where appropriate, but abandon them when they no longer
deliver the right functionality</p>
         </li>
         <li content="para">
            <p>Provide an accurate representation of the XDM data model</p>
         </li>
         <li content="para">
            <p>Provide access to all mainstream Saxon functionality needed by typical users</p>
         </li>
         <li content="para">
            <p>Provide escape hatches to underlying implementation classes and methods for power users</p>
         </li>
         <li content="para">
            <p>Exploit new Java 5 features such as type-safe enumerations, generics, and iterables, while retaining
support for JDK 1.4 users</p>
         </li>
      </ul>
      <p>The new API does not replace any existing APIs: it is a separate layer on top of the Saxon product. It is provided
in a separate JAR file, saxon9-api.jar, and can be used only with Java 5. The main Saxon jar files, however, continue to
work with JDK 1.4.</p>
      <p>For details see the Javadoc: go to package <code>net.sf.saxon.s9api</code> and start with the <code>Processor</code>
class.</p>
      <p>Saxon will continue to support standardized interfaces such as JAXP and XQJ. However, JAXP has become cluttered and
inconsistent, and is still missing support for many XSLT 2.0 features. XQJ has been designed with a client-server architecture
in mind, and while it is usable with Saxon, it is not really optimized for the kind of applications where Saxon is deployed.
For users who want to exploit Saxon fully in their applications, rather than retaining portability across XSLT/XPath/XQuery
implementations, the new API offers a much cleaner choice.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="commandline90.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>