Project

Profile

Help

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

he / tags / 9.2.0.5 / hej / net / sf / saxon / event / package.html @ 90ee0d1a

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
Many 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 <code>Receiver</code> 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.</p>
18

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

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

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

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

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

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

    
48
<p>Saxon's schema validator is also implemented using this push pipeline model. The classes that perform
49
schema validation, however, are part of a different package: <code>com.saxonica.validate</code>.</p>
50

    
51
<hr>
52

    
53
<p align="center"><i>Michael H. Kay<br/>
54
Saxonica Limited<br/>
55
9 February 2005</i></p>
56
</body>
57
</html>
(63-63/63)