Project

Profile

Help

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

he / latest9.3 / hej / net / sf / saxon / event / package.html @ 9acaa097

1
<html>
2

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

    
7
<body>
8

    
9
<p>This package provides classes that feed SAX-like events from one tree to another.
10
Some of these classes are associated with serializing the output of a stylesheet, but there
11
are also classes for building a tree from a stream of events, for stripping whitespace, and
12
so on.</p>
13

    
14
<p>The {@link net.sf.saxon.event.Receiver} interface defines a class that accepts a stream of events, with one method
15
defined for each kind of event. The events are modelled on the design of SAX, but adapted
16
to the XPath data model and to the use of Saxon's NamePool. Attributes and namespaces are
17
notified individually <i>after</i> the start of the relevant element. Many of the classes
18
in this package are implementations of the <code>Receiver</code> interface.</p>
19

    
20
<p>The immediate output of node constructors in a query or stylesheet goes to a {@link net.sf.saxon.event.SequenceReceiver}.
21
This is a subclass of <code>Receiver</code> that can handle an arbitrary sequence, containing atomic values
22
as well as nodes. When constructing the content of an element, a {@link net.sf.saxon.event.ComplexContentOutputter} is used;
23
when constructing the content of a node such as a text node or attribute, a <code>SequenceOutputter</code>
24
is used instead.</p>
25

    
26
<p>The final destination of the push pipeline is sometimes a serializer, and sometimes a tree builder.
27
The final serialization classes are subclasses of <code>Emitter</code>, but some of the serialization work
28
(such as indentation or application of character maps) is done by other classes on the pipeline. These
29
are generally constructed by extending the <code>ProxyReceiver</code> class.</p>
30

    
31
<p>The Emitter is an abstract implementation of the Receiver interface. As well as supporting
32
the Receiver interface, it provides methods for controlling the destination of serialized output
33
(a Writer or OutputStream) and for setting serialization properties (in a Properties object).
34
In practice nearly all the implementations of Receiver are currently subclasses of Emitter,
35
but this may change in the future.</p>
36

    
37
<p>The package includes emitters for the standard output methods xml, html, and text, and
38
proxy emitters to allow a sequence of filters to be applied to the output.</p>,
39

    
40
<p>The class <code>ContentHandlerProxy</code> allows events to be converted into standard SAX events and
41
sent to a SAX2 <code>ContentHandler</code>. Similarly, the class <code>ProxyReceiver</code> acts as a
42
<code>ContentHandler</code>, accepting SAX2 events and feeding them into a <code>Receiver</code> pipeline.</p>
43

    
44
<p>The class <code>Builder</code> is a <code>Receiver</code> that constructs a tree representation of the
45
document in memory. There are two subclasses for Saxon's two native tree models. Other classes such as
46
a <code>Stripper</code> and a <code>NamespaceReducer</code> are used to modify the document by adding
47
filters to the pipeline.</p>
48

    
49
<p>Saxon's schema validator and serializer are both implemented using this push pipeline model.
50
    The classes that perform
51
schema validation are part of  package: {@link com.saxonica.validate}, while the serialization classes
52
    are in {@link net.sf.saxon.serialize}.</p>
53

    
54
<hr>
55

    
56
<p align="center"><i>Michael H. Kay<br/>
57
Saxonica Limited<br/>
58
30 July 2010</i></p>
59
</body>
60
</html>
(41-41/41)