Project

Profile

Help

How to connect?
Download (3.07 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.3 / hej / net / sf / saxon / s9api / package.html @ eca87e2d

1
<html>
2

    
3
<head>
4
<title>Package overview for net.sf.saxon.s9api</title>
5
</head>
6

    
7
<body>
8

    
9
<p>This package provides Saxon's preferred Java API for XSLT, XQuery, XPath, and XML Schema processing.
10
    The interface is designed to hide as much as possible of the detail of the
11
implementation. However, the API architecture faithfully reflects the internal architecture
12
of the Saxon product, unlike standard APIs such as JAXP and XQJ which in many cases force
13
compromises in the design and performance of the application.</p>
14

    
15
<p>An application starts by loading a {@link net.sf.saxon.s9api.Processor}, which allows configuration options
16
to be set. As far as possible, an application should instantiate a single <code>Processor</code>.</p>
17

    
18
<p>The interfaces for XSLT, XQuery, and XPath processing all follow the same pattern. There is a three-stage
19
execution model: first a compiler is created using a factory method in the <code>Processor</code> object.
20
The compiler holds compile-time options and the static context information. Then the compiler's
21
<code>compile()</code> method is called to create an executable, a representation of the compiled stylesheet,
22
query, or expression. This is thread-safe and immutable once created. To run the query or transformation,
23
first call the <code>load()</code> method to create a run-time object called variously an {@link net.sf.saxon.s9api.XsltTransformer},
24
{@link net.sf.saxon.s9api.XQueryEvaluator}, or {@link net.sf.saxon.s9api.XPathSelector}. This holds run-time context information
25
such as parameter settings and the initial context node; the object is therefore not shareable and should
26
only be run in a single thread; indeed it should normally only be used once. This object also provides 
27
methods allowing the transformation or query to be executed.</p>
28

    
29
<p>In Saxon-EE the <code>Processor</code> owns a {@link net.sf.saxon.s9api.SchemaManager} that holds
30
the cache of schema components and can be used to load new schema components from source schema documents.
31
It can also be used to create a {@link net.sf.saxon.s9api.SchemaValidator}, which in turn is used to validate instance
32
documents.</p>
33

    
34
<p>Source documents can be constructed using a {@link net.sf.saxon.s9api.DocumentBuilder}, which holds all the options
35
and parameters to control document building.</p>
36

    
37
<p>The output of a transformation, or of any other process that generates an XML tree, can be sent to a
38
{@link net.sf.saxon.s9api.Destination}. There are a number of implementations of this interface, including a
39
{@link net.sf.saxon.s9api.Serializer} which translates the XML document tree into lexical XML form.</p>
40

    
41
<p>There are classes to represent the objects of the XDM data model, including {@link net.sf.saxon.s9api.XdmValue},
42
{@link net.sf.saxon.s9api.XdmItem}, {@link net.sf.saxon.s9api.XdmNode}, and {@link net.sf.saxon.s9api.XdmAtomicValue}.</p>
43

    
44
<p>The s9api interface is designed to take advantage of Java 5 constructs such as generics and
45
iterables. </p>
46

    
47
<hr>
48

    
49
<p align="center"><i>Michael H. Kay<br/>
50
Saxonica Limited<br/>
51
30 July 2010</i></p>
52
</body>
53
</html>
(42-42/42)