Project

Profile

Help

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

he / latest10 / hej / net / sf / saxon / event / package.html @ c10300c0

1
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
2
<!-- Copyright (c) 2014 Saxonica Limited. -->
3
<!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -->
4
<!-- If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
<!-- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -->
6
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
7

    
8
<html>
9

    
10
<head>
11
    <title>Package overview for net.sf.saxon.event</title>
12
</head>
13

    
14
<body>
15

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

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

    
27
<p>The immediate output of node constructors in a query or stylesheet goes to a {@link
28
    net.sf.saxon.event.Outputter}.When constructing the content of an element,
29
    a {@link net.sf.saxon.event.ComplexContentOutputter}
30
    is used;
31
    when constructing the content of a node such as a text node or attribute, a <code>SequenceOutputter</code>
32
    is used instead.</p>
33

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

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

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

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

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

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

    
62

    
63
</body>
64
</html>
(58-58/58)