Project

Profile

Help

Download (2.72 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.4 / hej / net / sf / saxon / serialize / package.html @ a3c08363

1 98329f8c O'Neil Delpratt
<html>
2
3
<head>
4
<title>Package overview for net.sf.saxon.serialize</title>
5
</head>
6
7
<body>
8
9
<p>This package contains code for serializing trees using the standard W3C-defined serialization methods
10
(xml, html, text). Additional Saxon-specific serialization methods are in package {@link com.saxonica.serialize}.</p>
11
12
<p>Serialization in Saxon operates as a push-based event pipeline in which the components of the pipeline
13
implement the {@link net.sf.saxon.event.Receiver} interface.
14
    This 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 pipeline for serialization is assembled by the {@link net.sf.saxon.lib.SerializerFactory} based
20
on a supplied set of serialization parameters. Only those components needed for the chosen serialization
21
parameters are included in the pipeline; for example, a Unicode normalizer is inserted at the appropriate
22
place in the pipeline if Unicode normalization is requested in the serialization parameters.</p>
23
24
<p>The immediate output of node constructors in a query or stylesheet goes to a {@link net.sf.saxon.event.SequenceReceiver}.
25
This is a subclass of <code>Receiver</code> that can handle an arbitrary sequence, containing atomic values
26
as well as nodes. When constructing the content of an element, a {@link net.sf.saxon.event.ComplexContentOutputter} is used;
27
when constructing the content of a node such as a text node or attribute, a <code>SequenceOutputter</code>
28
is used instead.</p>
29
30
<p>The final serialization classes are subclasses of {@link net.sf.saxon.serialize.Emitter}, but much of the serialization work
31
(such as indentation or application of character maps) is done by other classes on the pipeline. These
32
are generally constructed by extending the {@link net.sf.saxon.event.ProxyReceiver} class.</p>
33
34
<p>The Emitter is an abstract implementation of the Receiver interface. As well as supporting
35
the Receiver interface, it provides methods for controlling the destination of serialized output
36
(a Writer or OutputStream) and for setting serialization properties (in a Properties object).
37
In practice nearly all the implementations of Receiver are currently subclasses of Emitter,
38
but this may change in the future.</p>
39
40
<p>The package includes emitters for the standard output methods xml, html, and text, and
41
proxy emitters to allow a sequence of filters to be applied to the output.</p>,
42
43
44
<hr>
45
46
<p align="center"><i>Michael H. Kay<br/>
47
Saxonica Limited<br/>
48
30 July 2010</i></p>
49
</body>
50
</html>